open-telemetry / opentelemetry-collector-contrib

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

[exporter/azuremonitorexporter] Regression issue, property endpoint is ignored when using instrumentation_key #33971

Open michaelkira opened 3 weeks ago

michaelkira commented 3 weeks ago

Component(s)

exporter/azuremonitor

What happened?

Description

When we upgrade collector version from 0.56.0 to 0.96.0, we find we no longer export trace info when using endpoint: https://dc.applicationinsights.azure.cn/v2/track

Checking the code, it seems when connectionString is null, the collector will take the DefaultIngestionEndpoint and ignored passed in endpoint. This cause we not able to drop data to mooncake application insights https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/6575f8a29c4990c09e5bde606c9129616c1c8307/exporter/azuremonitorexporter/connection_string_parser.go#L47

Steps to Reproduce

Use 0.96.0 Pass in endpoint: https://dc.applicationinsights.azure.cn/v2/track instrumentation_key: your key

Expected Result

The trace data ingested into mooncake app insights

Actual Result

No data ingested

Collector version

0.96.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04") Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

apiVersion: v1
data:
  otel-collector-config: |
    receivers:
      zipkin:
        endpoint: 0.0.0.0:9411
    extensions:
      health_check:
      pprof:
        endpoint: :1888
      zpages:
        endpoint: :55679
    exporters:
      logging:
        loglevel: debug
      azuremonitor:
        endpoint:
https://dc.applicationinsights.azure.cn/v2/track
        instrumentation_key: your key
        maxbatchsize: 100
        maxbatchinterval: 5s
    service:
      extensions: [pprof, zpages, health_check]
      pipelines:
        traces:
          receivers: [zipkin]
          exporters: [azuremonitor,logging]
kind: ConfigMap

Log output

No error log

Additional context

No response

github-actions[bot] commented 3 weeks ago

Pinging code owners:

michaelkira commented 1 week ago

Any feedback?