Skip to content

Commit

Permalink
using semconv.ServiceNameKey
Browse files Browse the repository at this point in the history
  • Loading branch information
thugrock7 committed Oct 28, 2024
1 parent 1370f99 commit 75c5106
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions instrumentation/opentelemetry/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,9 @@ func resourceAttrsWithServiceName(resourceMap map[string]string, serviceName str
if resourceMap == nil {
resourceMap = make(map[string]string)
}
if _, ok := resourceMap["service.name"]; !ok && (len(serviceName) > 0) {
resourceMap["service.name"] = serviceName
serviceNameKey := string(semconv.ServiceNameKey)
if _, ok := resourceMap[serviceNameKey]; !ok && (len(serviceName) > 0) {
resourceMap[serviceNameKey] = serviceName
}

return resourceMap
Expand Down

0 comments on commit 75c5106

Please sign in to comment.