mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-17 05:18:04 +00:00
9b6dad18cb
* feat: provide metrics endpoint * config * enable otel metrics by default Co-authored-by: Florian Forster <florian@caos.ch>
26 lines
580 B
Go
26 lines
580 B
Go
package otel
|
|
|
|
import (
|
|
"go.opentelemetry.io/otel/attribute"
|
|
"go.opentelemetry.io/otel/sdk/resource"
|
|
semconv "go.opentelemetry.io/otel/semconv/v1.7.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(
|
|
semconv.SchemaURL,
|
|
attributes...,
|
|
),
|
|
)
|
|
}
|