Skip to content

Commit

Permalink
Map cluster name to DB insance (#150)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Wilkins <axw@elastic.co>
  • Loading branch information
stevejgordon and axw authored Sep 14, 2023
1 parent da63720 commit 4c1dc48
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions input/otlp/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit 4c1dc48

Please sign in to comment.