Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[exporter/azuremonitor] Unable to use APPLICATIONINSIGHTS_CONNECTION_STRING #36319

Open
audunsolemdal opened this issue Nov 12, 2024 · 3 comments
Labels
bug Something isn't working exporter/azuremonitor needs triage New item requiring triage

Comments

@audunsolemdal
Copy link

Component(s)

exporter/azuremonitor

What happened?

Description

According to the docs

Example using environment variable:

Ensure APPLICATIONINSIGHTS_CONNECTION_STRING is set in your environment, then configure the exporter without specifying a connection string or instrumentation key:

exporters:
  azuremonitor:

this should be possible according to the docs, but my otel-collector crashes when doing this.

Steps to Reproduce

Create an otel-collector with the following exporter config

exporters:
  azuremonitor:

container crashes

Expected Result

Able to use APPLICATION_INSIGHTS_CONNECTION_STRING as an environment variable on the pod sending data to the otel collector to simplify configuration overhead.

Actual Result

OTEL collector crashes if connection string is not set

Collector version

otel/opentelemetry-collector-k8s:0.111.0

Environment information

Environment

otel-collector helm chart

OpenTelemetry Collector configuration

config:
  exporters:
    debug:
      verbosity: detailed
    azuremonitor:

Log output

Error: failed to build pipelines: failed to create "azuremonitor" exporter for data type "logs": ConnectionString and InstrumentationKey cannot be empty                                                                        2024/11/12 12:41:54 collector server run finished with error: failed to build pipelines: failed to create "azuremonitor" exporter for data type "logs": ConnectionString and InstrumentationKey cannot be empty

Additional context

https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/azuremonitorexporter/README.md#configuration-options

Relates to #34188

@audunsolemdal audunsolemdal added bug Something isn't working needs triage New item requiring triage labels Nov 12, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@hgaol
Copy link
Contributor

hgaol commented Nov 25, 2024

Hi @audunsolemdal , I can't reproduce and can use APPLICATIONINSIGHTS_CONNECTION_STRING env as connection string to send data successfully. Also, here's a screenshot which indicating it can retrieve from env successfully. Can you confirm APPLICATIONINSIGHTS_CONNECTION_STRING has been set as env for collector?
image

@audunsolemdal
Copy link
Author

audunsolemdal commented Nov 26, 2024

Can you confirm APPLICATIONINSIGHTS_CONNECTION_STRING has been set as env for collector?

I was hoping it was possible to set it at the pod which is sending data to the collector, not the collector itself. I guess that was wishful thinking when reading the docs. Is there a way to send data from the OTEL collector to one or more target application insights without specifying the connection strings at the OTEL collector level?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/azuremonitor needs triage New item requiring triage
Projects
None yet
Development

No branches or pull requests

2 participants