Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions google/cloud/spanner_v1/_opentelemetry_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ def trace_call(name, session=None, extra_attributes=None, observability_options=
"net.host.name": SpannerClient.DEFAULT_ENDPOINT,
OTEL_SCOPE_NAME: TRACER_NAME,
OTEL_SCOPE_VERSION: TRACER_VERSION,
# Standard GCP attributes for OTel, attributes are used for internal purpose and are subjected to change
"gcp.client.service": "spanner",
"gcp.client.version": TRACER_VERSION,
"gcp.client.repo": "googleapis/python-spanner",
}

if extra_attributes:
Expand Down
3 changes: 3 additions & 0 deletions tests/system/test_session_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ def _make_attributes(db_instance, **kwargs):
"db.url": "spanner.googleapis.com",
"net.host.name": "spanner.googleapis.com",
"db.instance": db_instance,
"gcp.client.service": "spanner",
"gcp.client.version": ot_helpers.LIB_VERSION,
"gcp.client.repo": "googleapis/python-spanner",
}
ot_helpers.enrich_with_otel_scope(attributes)

Expand Down
Loading