Skip to content

Commit cd682f4

Browse files
estolfotrentm
andauthored
Refine span.name and specify span.action for SNS (#478)
Co-authored-by: Trent Mick <[email protected]>
1 parent 4559163 commit cd682f4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

specs/agents/tracing-instrumentation-aws.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ SQS has a documented limit of ten message attributes per message. Agents _shoul
3333
### SNS (AWS Simple Notification Service)
3434

3535
The AWS Simple Notification Service can be instrumented using the [messaging spec](tracing-instrumentation-messaging.md),
36-
but the only action that is instrumented is `PUBLISH`. These specifications supersede those of the messaging spec:
36+
but the only action that is instrumented is [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html). These specifications supersede those of the messaging spec:
3737

38-
- `span.name`: The span name should follow this pattern: `SNS PUBLISH <TOPIC-NAME>`. For example,
39-
`SNS PUBLISH MyTopic`.
38+
- `span.name`:
39+
- For a publish action including a `TopicArn`, the span name MUST be `SNS PUBLISH to <topic-name>`. For example, for a TopicArn of `arn:aws:sns:us-east-2:123456789012:My-Topic` the topic-name is `My-Topic`. (Implementation note: this can extracted with the equivalent of this Python expression: `topicArn.split(':').pop()`.)
40+
- For a publish action including a `TargetArn` (an endpoint ARN created via [CreatePlatformEndpoint](https://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformEndpoint.html)), the span name MUST be `SNS PUBLISH to <application-name>`. For example, for a TargetArn of `arn:aws:sns:us-west-2:123456789012:endpoint/GCM/gcmpushapp/5e3e9847-3183-3f18-a7e8-671c3a57d4b3` the application-name is `endpoint/GCM/gcmpushapp`. The endpoint UUID represents a device and mobile app. For manageable cardinality, the UUID must be excluded from the span name. (Implementation note: this can be extracted with the equivalent of this Python expression: `targetArn.split(':').pop().rsplit('/', 1)[0]`)
41+
- For a publish action including a `PhoneNumber`, the span name MUST be `SNS PUBLISH to [PHONENUMBER]`. The actual phone number MUST NOT be included because it is [PII](https://en.wikipedia.org/wiki/Personal_data) and cardinality is too high.
42+
- `span.action`: 'publish'
4043

4144
- **`context.destination.cloud.region`**: mandatory. The AWS region where the topic is.
4245

0 commit comments

Comments
 (0)