Skip to content

Commit 01b71b5

Browse files
chargomeclaude
andcommitted
ref(server-utils): Import messaging.destination_kind from conventions
`@sentry/conventions` ships `MESSAGING_DESTINATION_KIND` since 0.19.0, so the local key constant is no longer needed. The `topic` value stays local, since conventions only covers attribute keys. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 6d84503 commit 01b71b5

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

‎packages/server-utils/src/integrations/aws-sdk/constants.ts‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/**
22
* AWS-specific span constants used by the aws-sdk channel integration that are NOT covered by
33
* `@sentry/conventions/attributes` (attribute names that exist there are imported from there
4-
* directly). These are either Sentry-specific (the span origin), attribute *values* (not keys), or
5-
* obsolete OTel conventions with no `@sentry/conventions` export.
4+
* directly). These are either Sentry-specific (the span origin) or attribute *values* (not keys).
65
*/
76

87
/** The span origin every aws-sdk channel span carries. */
@@ -11,10 +10,7 @@ export const AWS_SDK_ORIGIN = 'auto.aws.aws_sdk';
1110
/** DynamoDB `db.system.name` value (an attribute value, not a key, so not covered by conventions). */
1211
export const DB_SYSTEM_VALUE_DYNAMODB = 'dynamodb';
1312

14-
// Messaging (obsolete OTel convention with no `@sentry/conventions` export, kept for parity)
15-
// TODO(v11): import from `@sentry/conventions` once a release including it ships (added in
16-
// getsentry/sentry-conventions#509), and drop this local constant.
17-
export const ATTR_MESSAGING_DESTINATION_KIND = 'messaging.destination_kind';
13+
/** SNS `messaging.destination_kind` value (an attribute value, not a key, so not covered by conventions). */
1814
export const MESSAGING_DESTINATION_KIND_VALUE_TOPIC = 'topic';
1915

2016
// Bedrock (gen_ai) attribute values (not keys, so not covered by conventions)

‎packages/server-utils/src/integrations/aws-sdk/services/sns.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ import { getClient, getTraceData, hasSpanStreamingEnabled } from '@sentry/core';
33
import {
44
AWS_SNS_TOPIC_ARN as ATTR_AWS_SNS_TOPIC_ARN,
55
MESSAGING_DESTINATION as ATTR_MESSAGING_DESTINATION,
6+
MESSAGING_DESTINATION_KIND as ATTR_MESSAGING_DESTINATION_KIND,
67
MESSAGING_DESTINATION_NAME,
78
MESSAGING_OPERATION_TYPE,
89
MESSAGING_SYSTEM,
910
SENTRY_KIND,
1011
} from '@sentry/conventions/attributes';
1112
import { QUEUE_PUBLISH } from '@sentry/conventions/op';
12-
import { ATTR_MESSAGING_DESTINATION_KIND, MESSAGING_DESTINATION_KIND_VALUE_TOPIC } from '../constants';
13+
import { MESSAGING_DESTINATION_KIND_VALUE_TOPIC } from '../constants';
1314
import type { NormalizedRequest, NormalizedResponse } from '../types';
1415
import { injectPropagationContext } from './MessageAttributes';
1516
import type { RequestMetadata, ServiceExtension } from './ServiceExtension';
@@ -43,6 +44,7 @@ export class SnsServiceExtension implements ServiceExtension {
4344
spanOp = QUEUE_PUBLISH;
4445
spanAttributes[SENTRY_KIND] = 'producer';
4546

47+
// oxlint-disable-next-line typescript/no-deprecated -- old-semconv messaging.destination_kind, matched to the OTel aws-sdk integration
4648
spanAttributes[ATTR_MESSAGING_DESTINATION_KIND] = MESSAGING_DESTINATION_KIND_VALUE_TOPIC;
4749
const { TopicArn, TargetArn, PhoneNumber } = request.commandInput;
4850
const destinationName = extractDestinationName(TopicArn, TargetArn, PhoneNumber);

0 commit comments

Comments
 (0)