Silvan 698f46fe6a
chore: update dependencies (#5401)
* chore(backend): update dependencies

* chore(pipeline): update golangci-lint
2023-04-06 06:29:55 +00:00

23 lines
555 B
Go

package otel
import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
"github.com/zitadel/zitadel/cmd/build"
)
func ResourceWithService() (*resource.Resource, error) {
attributes := []attribute.KeyValue{
semconv.ServiceNameKey.String("ZITADEL"),
}
if build.Version() != "" {
attributes = append(attributes, semconv.ServiceVersionKey.String(build.Version()))
}
return resource.Merge(
resource.Default(),
resource.NewWithAttributes("", attributes...),
)
}