Skip to content

Commit

Permalink
split global attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss committed Aug 8, 2023
1 parent 615241b commit 5e993bf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nodebuilder/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,12 @@ func initializeMetrics(
sdk.WithReader(sdk.NewPeriodicReader(exp, sdk.WithTimeout(2*time.Second))),
sdk.WithResource(resource.NewWithAttributes(
semconv.SchemaURL,
semconv.ServiceNamespaceKey.String(nodeType.String()),
semconv.ServiceNameKey.String(fmt.Sprintf("%s/%s", network.String(), peerID.String())))))
// ServiceNamespaceKey and ServiceNameKey will be concatenated into single attribute with key: "job" and value: %service.namespace%/%service.name%
semconv.ServiceNamespaceKey.String(network.String()),
semconv.ServiceNameKey.String(nodeType.String()),
// ServiceInstanceIDKey will be exported with key: "instance"
semconv.ServiceInstanceIDKey.String(peerID.String()),
)))
lc.Append(fx.Hook{
OnStop: func(ctx context.Context) error {
return provider.Shutdown(ctx)
Expand Down

0 comments on commit 5e993bf

Please sign in to comment.