open-telemetry / opentelemetry-js-contrib

OpenTelemetry instrumentation for JavaScript modules
https://opentelemetry.io
Apache License 2.0
709 stars 531 forks source link

[opentelemetry-instrumentation-aws-lambda] cloud.account.id to be set as span attribute instead of resource attribute #2547

Open calindurnea opened 4 days ago

calindurnea commented 4 days ago

I have previously opened a bug https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2463 related to cloud account id resource attribute being mapped to labels.cloud_account_id instead of cloud.account.id in elastic.

This was closed as it was not considered a bug with OpenTelemetry, but another person brought up a point that it might actually be a misconfiguration in the opentelemetry-instrumentation-aws-lambda instrumentation.

in this case, the bug is with the instrumentation. cloud.account.id is a resource attribute, but the instrumentation is setting it as a span attribute:

I was not able to get any replies to this in that thread, so I would like to open this discussion to figure out if that is an actual bug or not.

If this is not the correct template for that, please let me know and i will try to fix it.

pichlermarc commented 3 days ago

Yep, resource attributes should not go onto a span, that's correct. I think that might be incorrect in the current implementation here.

calindurnea commented 3 days ago

@pichlermarc thank you for the reply.

Would that mean that this attribute would be better fitted in the "opentelemetry-resource-detector-aws" package rather than here?