diff --git a/exporter/collector/integrationtest/testdata/fixtures/traces/traces_basic_expected.json b/exporter/collector/integrationtest/testdata/fixtures/traces/traces_basic_expected.json index 8de6295bf..018e35f76 100644 --- a/exporter/collector/integrationtest/testdata/fixtures/traces/traces_basic_expected.json +++ b/exporter/collector/integrationtest/testdata/fixtures/traces/traces_basic_expected.json @@ -47,11 +47,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -162,6 +157,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -226,11 +226,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -341,6 +336,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -405,11 +405,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -520,6 +515,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -584,11 +584,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -699,6 +694,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -748,11 +748,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -824,6 +819,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -873,11 +873,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -949,6 +944,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -998,11 +998,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1074,6 +1069,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1123,11 +1123,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1199,6 +1194,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1234,11 +1234,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1295,6 +1290,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1330,11 +1330,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1391,6 +1386,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1426,11 +1426,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1487,6 +1482,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1522,11 +1522,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1583,6 +1578,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1647,11 +1647,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1762,6 +1757,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1826,11 +1826,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1941,6 +1936,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -2005,11 +2005,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -2120,6 +2115,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -2169,11 +2169,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -2250,6 +2245,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -2299,11 +2299,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -2380,6 +2375,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -2429,11 +2429,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -2510,6 +2505,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -2559,11 +2559,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -2640,6 +2635,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -2675,11 +2675,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -2736,6 +2731,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" diff --git a/exporter/collector/integrationtest/testdata/fixtures/traces/traces_user_agent_expected.json b/exporter/collector/integrationtest/testdata/fixtures/traces/traces_user_agent_expected.json index ec07759b1..9d8f9cadb 100644 --- a/exporter/collector/integrationtest/testdata/fixtures/traces/traces_user_agent_expected.json +++ b/exporter/collector/integrationtest/testdata/fixtures/traces/traces_user_agent_expected.json @@ -47,11 +47,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -162,6 +157,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -226,11 +226,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -341,6 +336,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -405,11 +405,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -520,6 +515,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -584,11 +584,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -699,6 +694,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -748,11 +748,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -824,6 +819,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -873,11 +873,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -949,6 +944,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -998,11 +998,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1074,6 +1069,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1123,11 +1123,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1199,6 +1194,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1234,11 +1234,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1295,6 +1290,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1330,11 +1330,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1391,6 +1386,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1426,11 +1426,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1487,6 +1482,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1522,11 +1522,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1583,6 +1578,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1647,11 +1647,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1762,6 +1757,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -1826,11 +1826,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -1941,6 +1936,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -2005,11 +2005,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-server" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -2120,6 +2115,11 @@ "value": "foo" } }, + "service.name": { + "stringValue": { + "value": "demo-server" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -2169,11 +2169,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -2250,6 +2245,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -2299,11 +2299,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -2380,6 +2375,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -2429,11 +2429,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -2510,6 +2505,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -2559,11 +2559,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -2640,6 +2635,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" @@ -2675,11 +2675,6 @@ "value": "opentelemetry-go 1.18.0; google-cloud-trace-exporter 1.19.1" } }, - "g.co/gae/app/module": { - "stringValue": { - "value": "demo-client" - } - }, "g.co/r/generic_node/location": { "stringValue": { "value": "global" @@ -2736,6 +2731,11 @@ "value": "go1.19-pre4 cl/455575533 +12f49fe0ed" } }, + "service.name": { + "stringValue": { + "value": "demo-client" + } + }, "telemetry.sdk.language": { "stringValue": { "value": "go" diff --git a/exporter/collector/traces_test.go b/exporter/collector/traces_test.go index 008d99528..a339b5a14 100644 --- a/exporter/collector/traces_test.go +++ b/exporter/collector/traces_test.go @@ -64,10 +64,10 @@ func TestGoogleCloudTraceExport(t *testing.T) { }, }, }, - expectedServiceKey: "g.co/gae/app/module", + expectedServiceKey: "service.name", }, { - name: "With Empty Mapping", + name: "With Custom Mapping", cfg: Config{ ProjectID: "idk", TraceConfig: TraceConfig{ @@ -75,10 +75,15 @@ func TestGoogleCloudTraceExport(t *testing.T) { Endpoint: "127.0.0.1:8080", UseInsecure: true, }, - AttributeMappings: []AttributeMapping{}, + AttributeMappings: []AttributeMapping{ + { + Key: "service.name", + Replacement: "g.co/gae/app/module", + }, + }, }, }, - expectedServiceKey: "service.name", + expectedServiceKey: "g.co/gae/app/module", }, } diff --git a/exporter/trace/trace_proto.go b/exporter/trace/trace_proto.go index 27e95e5b7..24e235a8d 100644 --- a/exporter/trace/trace_proto.go +++ b/exporter/trace/trace_proto.go @@ -61,9 +61,6 @@ const ( labelHTTPStatusCode = `/http/status_code` labelHTTPPath = `/http/path` labelHTTPUserAgent = `/http/user_agent` - // This is prefixed for google app engine, but translates to the service - // in the trace UI. - labelService = `g.co/gae/app/module` instrumentationScopeNameAttribute = "otel.scope.name" instrumentationScopeVersionAttribute = "otel.scope.version" @@ -306,8 +303,6 @@ func defaultAttributeMapping(k attribute.Key) attribute.Key { return labelHTTPUserAgent case statusCodeAttribute: return labelHTTPStatusCode - case serviceAttribute: - return labelService } return k }