opentelemetry-js-contrib icon indicating copy to clipboard operation
opentelemetry-js-contrib copied to clipboard

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

Open calindurnea opened this issue 1 year ago • 2 comments

  • [x] This only affects the JavaScript OpenTelemetry library
  • [ ] This may affect other libraries, but I would like to get opinions here first

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.

calindurnea avatar Nov 22 '24 11:11 calindurnea

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

pichlermarc avatar Nov 22 '24 16:11 pichlermarc

@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?

calindurnea avatar Nov 22 '24 21:11 calindurnea