plug-sdk/pkg/telemetry/otlp.go
SoXX 0ab2d12c39 feat(telemetry): added base functions
added base function for OTEL Setup
2024-08-26 13:00:51 +02:00

20 lines
406 B
Go

package telemetry
import (
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
func newResource(serviceName string) (*resource.Resource, error) {
otelResource, err := resource.Merge(resource.Default(),
resource.NewWithAttributes(semconv.SchemaURL,
semconv.ServiceName(serviceName),
))
if err != nil {
return nil, err
}
return otelResource, nil
}