open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.02k stars 2.33k forks source link

azuremonitorexporter Logs missing CustomDementions #16557

Closed im-aIex closed 1 year ago

im-aIex commented 1 year ago

Component(s)

exporter/azuremonitor

What happened?

Description

When mapping Logs to App Insights traces, it is not mapping Attributes to CustomDementions like it does for spans. This loses data when using formatted logging.

Steps to Reproduce

Log data using formatted logs.

logger.LogInformation("Info {data}", 123);

Expected Result

Attributes (log args) display as CustomDimensions.

Actual Result

CustomDimensions is empty. image

Collector version

0.66.0

Environment information

Environment

OS: Windows 10

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols:
      grpc:
      http:

processors:
  # batch:

exporters:
  logging:
    verbosity: detailed
  azuremonitor:
    instrumentation_key: 00000000-0000-0000-0000-000000000000
    spaneventsenabled: true

extensions:
  health_check:
  pprof:
  zpages:

service:
  extensions: [health_check, pprof, zpages]
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [logging, azuremonitor]
    logs:
      receivers: [otlp]
      exporters: [logging, azuremonitor]

Log output

LogRecord #0
ObservedTimestamp: 1970-01-01 00:00:00 +0000 UTC
Timestamp: 2022-11-30 21:44:38.6123544 +0000 UTC
SeverityText: Information
SeverityNumber: Info(9)
Body: Str(Info {data})
Attributes:
     -> dotnet.ilogger.category: Str(getting_started.Worker)
     -> data: Int(123)

Additional context

No response

im-aIex commented 1 year ago

/label exporter/azuremonitor

akakarikos commented 1 year ago

Is there any progress on this? It seems that it's also missing additional properties like cloud_RoleName. At the custom dimensions we are also expecting the service.name.

eedorenko commented 1 year ago

/assign @eedorenko