Skip to content

Commit

Permalink
feat(trace): add service name attribute
Browse files Browse the repository at this point in the history
kristofferwanglund committed Jan 28, 2025
1 parent 11e084d commit 5def959
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cloudotel/resource.go
Original file line number Diff line number Diff line change
@@ -25,6 +25,9 @@ func NewResource(ctx context.Context) (*resource.Resource, error) {
if e, ok := cloudruntime.TaskIndex(); ok {
opts = append(opts, resource.WithAttributes(semconv.FaaSInstanceKey.String(strconv.Itoa(e))))
}
if e, ok := cloudruntime.Service(); ok {
opts = append(opts, resource.WithAttributes(semconv.ServiceName(e)))
}
result, err := resource.New(ctx, opts...)
if err != nil {
return nil, fmt.Errorf("init telemetry resource: %w", err)

0 comments on commit 5def959

Please sign in to comment.