Skip to content

Commit

Permalink
tracing: use standardized db.system=spanner
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Aug 9, 2024
1 parent e8e876f commit 6da95a1
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion google/cloud/spanner_v1/_opentelemetry_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def trace_call(name, session, extra_attributes=None):

# Set base attributes that we know for every trace created
attributes = {
DB_SYSTEM: "google.cloud.spanner",
DB_SYSTEM: "spanner",
DB_CONNECTION_STRING: SpannerClient.DEFAULT_ENDPOINT,
DB_NAME: session._database.name,
NET_HOST_NAME: SpannerClient.DEFAULT_ENDPOINT,
Expand Down
2 changes: 1 addition & 1 deletion tests/system/test_session_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def assert_span_attributes(

def _make_attributes(db_instance, **kwargs):
attributes = {
ot_helpers.DB_SYSTEM: "google.cloud.spanner",
ot_helpers.DB_SYSTEM: "spanner",
ot_helpers.DB_CONNECTION_STRING: "spanner.googleapis.com",
ot_helpers.DB_NAME: db_instance,
ot_helpers.NET_HOST_NAME: "spanner.googleapis.com",
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test__opentelemetry_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_trace_call(self):
}

expected_attributes = {
DB_SYSTEM: "google.cloud.spanner",
DB_SYSTEM: "spanner",
DB_CONNECTION_STRING: "spanner.googleapis.com",
NET_HOST_NAME: "spanner.googleapis.com",
}
Expand All @@ -88,7 +88,7 @@ def test_trace_error(self):
extra_attributes = {DB_NAME: "database_name"}

expected_attributes = {
DB_SYSTEM: "google.cloud.spanner",
DB_SYSTEM: "spanner",
DB_CONNECTION_STRING: "spanner.googleapis.com",
NET_HOST_NAME: "spanner.googleapis.com",
}
Expand All @@ -115,7 +115,7 @@ def test_trace_grpc_error(self):
extra_attributes = {DB_NAME: "database_name"}

expected_attributes = {
DB_SYSTEM: "google.cloud.spanner",
DB_SYSTEM: "spanner",
DB_CONNECTION_STRING: "spanner.googleapis.com",
NET_HOST_NAME: "spanner.googleapis.com",
}
Expand All @@ -139,7 +139,7 @@ def test_trace_codeless_error(self):
extra_attributes = {DB_NAME: "database_name"}

expected_attributes = {
DB_SYSTEM: "google.cloud.spanner",
DB_SYSTEM: "spanner",
DB_CONNECTION_STRING: "spanner.googleapis.com",
NET_HOST_NAME: "spanner.googleapis.com",
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
["[email protected]", "Bharney", "Rhubble", 31],
]
BASE_ATTRIBUTES = {
DB_SYSTEM: "google.cloud.spanner",
DB_SYSTEM: "spanner",
DB_CONNECTION_STRING: "spanner.googleapis.com",
DB_NAME: "testing",
NET_HOST_NAME: "spanner.googleapis.com",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TestSession(OpenTelemetryBase):
SESSION_NAME = DATABASE_NAME + "/sessions/" + SESSION_ID
DATABASE_ROLE = "dummy-role"
BASE_ATTRIBUTES = {
DB_SYSTEM: "google.cloud.spanner",
DB_SYSTEM: "spanner",
DB_CONNECTION_STRING: "spanner.googleapis.com",
DB_NAME: DATABASE_NAME,
NET_HOST_NAME: "spanner.googleapis.com",
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
SECONDS = 3
MICROS = 123456
BASE_ATTRIBUTES = {
DB_SYSTEM: "google.cloud.spanner",
DB_SYSTEM: "spanner",
DB_CONNECTION_STRING: "spanner.googleapis.com",
DB_NAME: "testing",
NET_HOST_NAME: "spanner.googleapis.com",
Expand Down Expand Up @@ -537,7 +537,7 @@ def test_iteration_w_multiple_span_creation(self):
self.assertEqual(
dict(span.attributes),
{
DB_SYSTEM: "google.cloud.spanner",
DB_SYSTEM: "spanner",
DB_CONNECTION_STRING: "spanner.googleapis.com",
DB_NAME: "testing",
NET_HOST_NAME: "spanner.googleapis.com",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_spanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class TestTransaction(OpenTelemetryBase):
TRANSACTION_TAG = "transaction-tag"

BASE_ATTRIBUTES = {
DB_SYSTEM: "google.cloud.spanner",
DB_SYSTEM: "spanner",
DB_CONNECTION_STRING: "spanner.googleapis.com",
DB_NAME: "testing",
NET_HOST_NAME: "spanner.googleapis.com",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class TestTransaction(OpenTelemetryBase):
TRANSACTION_TAG = "transaction-tag"

BASE_ATTRIBUTES = {
DB_SYSTEM: "google.cloud.spanner",
DB_SYSTEM: "spanner",
DB_CONNECTION_STRING: "spanner.googleapis.com",
DB_NAME: "testing",
NET_HOST_NAME: "spanner.googleapis.com",
Expand Down

0 comments on commit 6da95a1

Please sign in to comment.