Skip to content

Change AwsLambdaInstrumentor span attribute settings to match faas semconv #2371

Closed
@tammy-baylis-swi

Description

@tammy-baylis-swi

Is your feature request related to a problem?
No.

Describe the solution you'd like
Python AwsLambdaInstrumentor attribute settings are not consistent with the latest faas semconv. Specifically, I think these instrumentor changes are needed:

  1. ResourceAttributes.FAAS_ID --> ResourceAttributes.CLOUD_RESOURCE_ID
  2. SpanAttributes.FAAS_EXECUTION --> SpanAttributes.FAAS_INVOCATION_ID

For this solution, change these set_attribute calls. Make special note in the release notes that this is breaking. This is not additive like #2368.

Describe alternatives you've considered
I've thought about and brought up 2 other ideas on Slack:

Idea (A)
The Python AwsLambdaInstrumentor upgrades to a newer semconv version. Would it need to be an opt-in for users like for http instrumentation? (i.e. this recent issue) Would this need to be presented to an Otel Spec project group? (i.e. this issue)

Idea (B)
The Python AwsLambdaInstrumentor gets request/response hooks implemented like in NodeJS. This would allow users to add any attributes they like. I see this was requested, discussed in Otel Spec, PR'd (rejected), discussed at faas project sig, alternatively PR'd as a SpanProcessor requirement (rejected), and brought up again in Slack. I haven't found any other updates since May 2023.

In this otel-faas thread, it was mentioned that the faas attributes are not stable so a breaking change would be ok. Therefore we could implement the quick, in-place change.

Additional context

  1. https://cloud-native.slack.com/archives/C01PD4HUVBL/p1711140906040599
  2. https://cloud-native.slack.com/archives/C04HVBETC9Z/p1711387797268909

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions