docs/sf/guides/dashboard/monitoring/traces.md
Traces, Spans, Logs, and Events are captured and made available in Trace Explorer for your AWS Lambda functions when Instrumentation is enabled.
Serverless Dashboard provides a set of tools to analyzing Traces.
Similar to the Metrics View, the Trace Explorer provides a starting point for troubleshooting AWS Lambda function invocations across your org. You can use the rich filters to narrow in on errors, warnings, and performance issues across all of your AWS Lambda functions across your org.
Filtering allows you to narrow in on particular behavior and time frame for to isolate invocations. You can filter on:
ERROR_TYPE_UNCAUGHT) - The Lambda function handler had a
fatal error and caused the invocation to fail.ERROR_TYPE_CAUGHT_USER) - The Lambda function handler had
an error that was captured using the SDK, structured logging library (e.g. Pino,
AWS Lambda PowerTools, Winston), or standard out (e.g. console.error).WARNING_TYPE_USER) - The Lambda function handler had a warning
that was captured using the SDK, structured logging library (e.g. Pino, AWS
Lambda PowerTools, Winston), or standard out (e.g. console.warn).ERROR_TYPE_CAUGHT_SDK_USER) - An SDK usage error that was
reported due to misuse of the SDK. These errors do not cause handler failures,
but misusage of the SDK may result in partial collection. For example, using the
setTag method with invalid inputs will result in this type of error, and the
tag will not be set.WARNING_TYPE_SDK_USER) - A warning reported by the SDK due
to user misuse in the handler, but not due to misuse of the SDK. For example, if
both a callback and Promise resolution is attached this will cause unwanted
side-effects on the SDK.Trace Details provides a way to look at the details of an individual AWS Lambda Invocation trace, including the spans, tags, logs, and events.
The Trace details are deep-linked so you can easily share the URL with your team when collaboratively troubleshooting.
The pane on the right, the Inspector, presents the details about the Trace. If a Span, or an Events are selected from the timeline, then the Inspector will show details about the selected item.
The Inspector for the trace will present details about the trace as tags. These
tags include information about the runtime, like Cold Start, Request ID,
and Arch, as well as metrics like Memory Used, Billed ms, Invoke. Check
out the tooltips for details on each of the tags.
A Trace contains a set of Spans associated with and displayed in the style of a Gantt chart. This chart provides you with context for when, and how long various subsequent interactions took.
A span can be selected from the timeline to view the details of the span in the Inspector.
Logs are also collected and made available in the Trace details. To view the
logs for the Lambda invocation, select the root span, aws.lambda.
If the logs are structured and formatted as JSON, they will be parsed and displayed with pretty formatting.
Events, like Spans, are displayed on the timeline. Events can be selected to view the details.
Events include a name, message, and stack when available. The Node.js and
Python Serverless SDKs capture the stacktraces for all requests when possible.
It also captures Error objects, so the name, message, and stack from the
Error are made available as an error in the Inspector.