mirror of
https://github.com/traefik/traefik.git
synced 2025-08-07 15:17:09 +02:00
Add missing resource attributes detectors
This commit is contained in:
parent
9862cd6780
commit
91331415ce
@ -209,7 +209,11 @@ func newOpenTelemetryMeterProvider(ctx context.Context, config *types.OTLP) (*sd
|
|||||||
res, err := resource.New(ctx,
|
res, err := resource.New(ctx,
|
||||||
resource.WithAttributes(semconv.ServiceNameKey.String(config.ServiceName)),
|
resource.WithAttributes(semconv.ServiceNameKey.String(config.ServiceName)),
|
||||||
resource.WithAttributes(semconv.ServiceVersionKey.String(version.Version)),
|
resource.WithAttributes(semconv.ServiceVersionKey.String(version.Version)),
|
||||||
|
resource.WithContainer(),
|
||||||
resource.WithFromEnv(),
|
resource.WithFromEnv(),
|
||||||
|
resource.WithHost(),
|
||||||
|
resource.WithOS(),
|
||||||
|
resource.WithProcess(),
|
||||||
resource.WithTelemetrySDK(),
|
resource.WithTelemetrySDK(),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -189,10 +189,12 @@ func (o *OTelLog) NewLoggerProvider() (*otelsdk.LoggerProvider, error) {
|
|||||||
|
|
||||||
res, err := resource.New(context.Background(),
|
res, err := resource.New(context.Background(),
|
||||||
resource.WithAttributes(attr...),
|
resource.WithAttributes(attr...),
|
||||||
|
resource.WithContainer(),
|
||||||
resource.WithFromEnv(),
|
resource.WithFromEnv(),
|
||||||
|
resource.WithHost(),
|
||||||
|
resource.WithOS(),
|
||||||
|
resource.WithProcess(),
|
||||||
resource.WithTelemetrySDK(),
|
resource.WithTelemetrySDK(),
|
||||||
resource.WithOSType(),
|
|
||||||
resource.WithProcessCommandArgs(),
|
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("building resource: %w", err)
|
return nil, fmt.Errorf("building resource: %w", err)
|
||||||
|
@ -61,10 +61,12 @@ func (c *OTelTracing) Setup(serviceName string, sampleRate float64, resourceAttr
|
|||||||
|
|
||||||
res, err := resource.New(context.Background(),
|
res, err := resource.New(context.Background(),
|
||||||
resource.WithAttributes(attr...),
|
resource.WithAttributes(attr...),
|
||||||
|
resource.WithContainer(),
|
||||||
resource.WithFromEnv(),
|
resource.WithFromEnv(),
|
||||||
|
resource.WithHost(),
|
||||||
|
resource.WithOS(),
|
||||||
|
resource.WithProcess(),
|
||||||
resource.WithTelemetrySDK(),
|
resource.WithTelemetrySDK(),
|
||||||
resource.WithOSType(),
|
|
||||||
resource.WithProcessCommandArgs(),
|
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, fmt.Errorf("building resource: %w", err)
|
return nil, nil, fmt.Errorf("building resource: %w", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user