Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Breaking changes

- `opentelemetry-instrumentation-botocore` Use `cloud.region` instead of `aws.region` span attribute as per semantic conventions.
([#3474](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3474))


## Version 1.33.0/0.54b0 (2025-05-09)

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ def response_hook(span, service_name, operation_name, result):
)
from opentelemetry.metrics import Instrument, Meter, get_meter
from opentelemetry.propagators.aws.aws_xray_propagator import AwsXRayPropagator
from opentelemetry.semconv._incubating.attributes.cloud_attributes import (
CLOUD_REGION,
)
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import get_tracer
from opentelemetry.trace.span import Span
Expand Down Expand Up @@ -276,8 +279,7 @@ def _patched_api_call(self, original_func, instance, args, kwargs):
SpanAttributes.RPC_SYSTEM: "aws-api",
SpanAttributes.RPC_SERVICE: call_context.service_id,
SpanAttributes.RPC_METHOD: call_context.operation,
# TODO: update when semantic conventions exist
"aws.region": call_context.region,
CLOUD_REGION: call_context.region,
**get_server_attributes(call_context.endpoint_url),
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
)
from opentelemetry.propagate import get_global_textmap, set_global_textmap
from opentelemetry.propagators.aws.aws_xray_propagator import TRACE_HEADER_KEY
from opentelemetry.semconv._incubating.attributes.cloud_attributes import (
CLOUD_REGION,
)
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.test.mock_textmap import MockTextMapPropagator
from opentelemetry.test.test_base import TestBase
Expand Down Expand Up @@ -61,7 +64,7 @@ def _default_span_attributes(self, service: str, operation: str):
SpanAttributes.RPC_SYSTEM: "aws-api",
SpanAttributes.RPC_SERVICE: service,
SpanAttributes.RPC_METHOD: operation,
"aws.region": self.region,
CLOUD_REGION: self.region,
"retry_attempts": 0,
SpanAttributes.HTTP_STATUS_CODE: 200,
# Some services like IAM or STS have a global endpoint and exclude specified region.
Expand Down Expand Up @@ -527,7 +530,7 @@ def test_server_attributes(self):
attributes={
SpanAttributes.SERVER_ADDRESS: "iam.amazonaws.com",
SpanAttributes.SERVER_PORT: 443,
"aws.region": "aws-global",
CLOUD_REGION: "aws-global",
},
)

Expand Down