Drop service.name from span-metric datapoint attributes; emit calls with {call} unit - #861
Drop service.name from span-metric datapoint attributes; emit calls with {call} unit#861srprash wants to merge 2 commits into
Conversation
service.name: the metrics are recorded into the host SDK's MeterProvider, whose
resource already carries service.name, so duplicating it on every datapoint adds
a redundant dimension with no extra information. Consumers read it from the
metric resource. This intentionally diverges from the collector spanmetrics
connector, which flattens service.name into datapoint attributes because
collector-side consumers may drop the resource; here the resource is preserved.
calls unit: {call} (UCUM annotation) instead of the connector's unset unit,
matching OTel semantic-convention counter conventions (cf. {request},
{operation}) - an empty unit carries no information.
Contract tests assert the metric resource carries the configured service.name
value (key presence alone can never fail: the SDK defaults service.name
unconditionally) and the {call} unit end-to-end.
|
Claude finished @srprash's task in 1m 13s —— View job Claude PR Review
SummaryBoth changes look correct and cleanly scoped.
Docs
FindingsNo substantive issues. Nothing to block. Minor observations (not blocking, do not need to be addressed):
|
|
Claude finished @srprash's task in 53s —— View job Claude PR Review (sync)
SummaryNo new findings on this synchronize event. The only commit added since the prior review (2026-08-20) is the merge from Nothing to add. • Branch: |
Description
Two changes to the span-metrics schema emitted by the CloudWatch plugin:
service.nameis no longer a datapoint attribute. The metrics are recorded into the host SDK'sMeterProvider, whose resource already carriesservice.name, so duplicating it on every datapoint adds a redundant dimension with no extra information. Consumers read it from the metric resource. This intentionally diverges from the collector spanmetrics connector, which flattensservice.nameinto datapoint attributes because collector-side consumers may drop the resource; here the resource is preserved end to end.traces.span.metrics.callsnow uses the{call}unit (UCUM annotation) instead of an unset unit, matching OTel semantic-convention counter conventions (cf.{request},{operation}).Testing
service.nameis never emitted as a datapoint attribute (including when the span's resource carries it), that the metric resource carriesservice.name, and that the calls counter uses the literal{call}unit. 83 tests pass against both the oldest and latest supported OpenTelemetry requirement sets.service.nameis absent from datapoints, present on the metric resource with the configured value (key presence alone can never fail — the SDK defaultsservice.nameunconditionally), and the{call}unit. All 6 span-metrics contract tests (auto / manual / global instrumentation) pass locally against the built wheel and images.CHANGELOG and README updated accordingly.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.