Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture topic ARNs in SNS instrumentation #1609

Open
1 of 2 tasks
ssmoulik opened this issue Mar 13, 2024 · 5 comments
Open
1 of 2 tasks

Capture topic ARNs in SNS instrumentation #1609

ssmoulik opened this issue Mar 13, 2024 · 5 comments
Labels
comp:instrumentation.aws Things related to OpenTelemetry.Instrumentation.AWS

Comments

@ssmoulik
Copy link

Issue with OpenTelemetry.Instrumentation.AWS

List of all OpenTelemetry NuGet
packages
and version that you are
using (e.g. OpenTelemetry 1.3.2):

OpenTelemetry.Instrumentation.AWS - 1.1.0-beta.1
OpenTelemetry.Instrumentation.AWSLambda 1.3.0-beta.1

Runtime version : net6.0

Is this a feature request or a bug?

  • Feature Request
  • Bug

What is the expected behavior?

When a Producer publishes a message to a SNS topic, the span representing the Publish operation should have attributes that help in uniquely identifying the SNS topic.

The topic arn can be included in the attribute messaging.destination.name. This would be inline with the recommendation provided in messaging semcov https://github.com/open-telemetry/semantic-conventions/blob/main/docs/messaging/messaging-spans.md.

What is the actual behavior?

In the current instrumentation for AWS SNS service, the span does not contain any attribute that helps in uniquely identifying the topic to which a message was published.

Here is a sample span that is generated on publish, the only information it contains is that a publish operation was performed and the service is SNS

ScopeSpans #0
ScopeSpans SchemaURL:
InstrumentationScope Amazon.AWS.AWSClientInstrumentation
Span #0
Trace ID : 0230ddbaedf0649af93ad87c13291b4d
Parent ID : ea9d4fa4683e3a6b
ID : 6a9e9154557241a9
Name : SimpleNotificationService.Publish
Kind : Client
Start time : 2024-03-13 17:57:44.2185586 +0000 UTC
End time : 2024-03-13 17:57:45.182434 +0000 UTC
Status code : Unset
Status message :
Attributes:
-> aws.service: Str(SimpleNotificationService)
-> aws.operation: Str(Publish)
-> aws.region: Str(us-west-2)
-> aws.requestId: Str(8bf7d0fb-8236-5250-bc05-8e90696f9a7d)
-> http.status_code: Int(200)
-> http.response_content_length: Int(294)

Additional Context

Related contributions in Python and JS contrib repos:

open-telemetry/opentelemetry-js-contrib#1727
open-telemetry/opentelemetry-python-contrib#1995

@ssmoulik ssmoulik added the comp:instrumentation.aws Things related to OpenTelemetry.Instrumentation.AWS label Mar 13, 2024
@Kielek
Copy link
Contributor

Kielek commented Mar 13, 2024

@ppittle, FYI

@ppittle
Copy link
Member

ppittle commented Mar 13, 2024

@ssmoulik - do you know if any other language adds a SNS Topic attribute?

@ssmoulik
Copy link
Author

@ppittle @Kielek , if this feature request looks acceptable, I can work on a PR to make the changes!

@ppittle
Copy link
Member

ppittle commented Mar 18, 2024

Both the js and python code have the same comment:

# TODO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when opentelemetry-semantic-conventions 0.42b0 is released

I am looking into the semantic convention to make sure it hasn't changed or there isn't new guidance.

With that caveat, a PR would be most welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.aws Things related to OpenTelemetry.Instrumentation.AWS
Projects
None yet
Development

No branches or pull requests

3 participants