Converting Lambda Telemetry API Event
objects to OpenTelemetry
Spans
The AWS Lambda Telemetry API schema is semantically compatible with OpenTelemetry (OTel). This means
that you can convert your AWS Lambda Telemetry API Event
objects to OpenTelemetry (OTel)
Spans. When converting, you shouldn't map a single Event
object to a single OTel Span. Instead, you
should present all three events related to a lifecycle phase in a single OTel Span. For example, the start
,
runtimeDone
, and runtimeReport
events represent a single function invocation. Present
all three of these events as a single OTel Span.
You can convert your events using Span Events or Child (nested) Spans. The tables on this page describe the
mappings between Telemetry API schema properties and OTel Span properties for both approaches. For more information
about OTel Spans, see Span
Map to OTel Spans with Span Events
In the following tables, e
represents the event coming from the telemetry
source.
Mapping the *Start events
OpenTelemetry | Lambda Telemetry API schema |
---|---|
|
Your extension generates this value based on the |
|
Use |
|
N/A, because the event hasn't completed yet. |
|
Set to |
|
Set to |
|
Parse the AWS X-Ray header found in |
|
Parse the X-Ray header found in |
|
Use |
|
N/A for an X-Ray trace context. |
|
Parse the X-Ray header found in |
|
Your extension can add any custom values here. |
Mapping the *RuntimeDone events
OpenTelemetry | Lambda Telemetry API schema |
---|---|
|
Your extension generates the value based on the |
|
Use Alternatively, use |
|
N/A, because the event hasn't completed yet. |
|
Set to |
|
If Otherwise, set to |
|
Use |
|
Use |
|
Use |
|
Parse the AWS X-Ray header found in |
|
Parse the X-Ray header found in |
|
Use the same |
|
N/A for an X-Ray trace context. |
|
Parse the X-Ray header found in |
|
Your extension can add any custom values here. |
Mapping the *Report events
OpenTelemetry | Lambda Telemetry API schema |
---|---|
|
Your extension generates the value based on the |
|
Use Alternatively, use |
|
Use |
|
Set to |
|
Use the same value as the |
|
Parse the AWS X-Ray header found in |
|
Parse the X-Ray header found in |
|
Use the same |
|
N/A for an X-Ray trace context. |
|
Parse the X-Ray header found in |
|
Your extension can add any custom values here. |
Map to OTel Spans with Child Spans
The following table describes how to convert Lambda Telemetry API events into OTel Spans with Child (nested)
Spans for *RuntimeDone
Spans. For *Start
and *Report
mappings, refer to the
tables in Map to OTel Spans with Span Events, as they're the same for Child Spans. In this table,
e
represents the event coming from the telemetry source.
Mapping the *RuntimeDone events
OpenTelemetry | Lambda Telemetry API schema |
---|---|
|
Your extension generates the value based on the |
|
Use Alternatively, use |
|
N/A, because the event hasn't completed yet. |
|
Set to |
|
If Otherwise, set to |
|
Parse the AWS X-Ray header found in |
|
Parse the X-Ray header found in |
|
Use the same |
|
N/A for an X-Ray trace context. |
|
Parse the X-Ray header found in |
|
Your extension can add any custom values here. |
|
Use |
|
Use |
|
Use |
|
Same as parent |
|
Same as parent |
|
Same as parent |
|
Use parent |
|
Generate a new |
|
N/A for an X-Ray trace context. |
|
Same as parent |