Use ResourceAttributes instead of GlobalAttributes

This commit is contained in:
Bruno de Queiroz 2025-02-06 11:24:04 +01:00 committed by GitHub
parent da2278b29a
commit b74767bfa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 6 deletions

View file

@ -36,7 +36,7 @@ func (c *OTelTracing) SetDefaults() {
}
// Setup sets up the tracer.
func (c *OTelTracing) Setup(serviceName string, sampleRate float64, globalAttributes map[string]string) (trace.Tracer, io.Closer, error) {
func (c *OTelTracing) Setup(serviceName string, sampleRate float64, resourceAttributes map[string]string) (trace.Tracer, io.Closer, error) {
var (
err error
exporter *otlptrace.Exporter
@ -55,7 +55,7 @@ func (c *OTelTracing) Setup(serviceName string, sampleRate float64, globalAttrib
semconv.ServiceVersionKey.String(version.Version),
}
for k, v := range globalAttributes {
for k, v := range resourceAttributes {
attr = append(attr, attribute.String(k, v))
}