From 4c1dc4851529d3d2de62bc0d251f5d4f2741ff0f Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Thu, 14 Sep 2023 03:39:25 +0100 Subject: [PATCH] Map cluster name to DB insance (#150) Co-authored-by: Andrew Wilkins --- input/otlp/traces.go | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/input/otlp/traces.go b/input/otlp/traces.go index 6a3e1a44..15cf9f05 100644 --- a/input/otlp/traces.go +++ b/input/otlp/traces.go @@ -64,18 +64,19 @@ const ( outcomeFailure = "failure" outcomeUnknown = "unknown" - attributeNetworkConnectionType = "net.host.connection.type" - attributeNetworkConnectionSubtype = "net.host.connection.subtype" - attributeNetworkMCC = "net.host.carrier.mcc" - attributeNetworkMNC = "net.host.carrier.mnc" - attributeNetworkCarrierName = "net.host.carrier.name" - attributeNetworkICC = "net.host.carrier.icc" - attributeHttpRequestMethod = "http.request.method" - attributeHttpResponseStatusCode = "http.response.status_code" - attributeServerAddress = "server.address" - attributeServerPort = "server.port" - attributeUrlFull = "url.full" - attributeUserAgentOriginal = "user_agent.original" + attributeNetworkConnectionType = "net.host.connection.type" + attributeNetworkConnectionSubtype = "net.host.connection.subtype" + attributeNetworkMCC = "net.host.carrier.mcc" + attributeNetworkMNC = "net.host.carrier.mnc" + attributeNetworkCarrierName = "net.host.carrier.name" + attributeNetworkICC = "net.host.carrier.icc" + attributeHttpRequestMethod = "http.request.method" + attributeHttpResponseStatusCode = "http.response.status_code" + attributeServerAddress = "server.address" + attributeServerPort = "server.port" + attributeUrlFull = "url.full" + attributeUserAgentOriginal = "user_agent.original" + attributeDbElasticsearchClusterName = "db.elasticsearch.cluster.name" ) // ConsumeTraces consumes OpenTelemetry trace data, @@ -588,7 +589,7 @@ func TranslateSpan(spanKind ptrace.SpanKind, attributes pcommon.Map, event *mode // Statement should not be truncated, use original string value. db.Statement = v.Str() isDatabase = true - case semconv.AttributeDBName, "db.instance": + case semconv.AttributeDBName, "db.instance", attributeDbElasticsearchClusterName: db.Instance = stringval isDatabase = true case semconv.AttributeDBSystem, "db.type":