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/azuremonitorexporter] Regression issue, property endpoint is ignored when using instrumentation_key #33971

Open
michaelkira opened this issue Jul 9, 2024 · 9 comments
Labels
bug Something isn't working exporter/azuremonitor

Comments

@michaelkira
Copy link

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

connectionVars.IngestionURL = getIngestionURL(DefaultIngestionEndpoint)

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

@michaelkira michaelkira added bug Something isn't working needs triage New item requiring triage labels Jul 9, 2024
Copy link
Contributor

github-actions bot commented Jul 9, 2024

Pinging code owners:

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

@michaelkira
Copy link
Author

Any feedback?

@hgaol
Copy link
Contributor

hgaol commented Aug 3, 2024

Hi @michaelkira , looks it's quite straightforward and I've created PR to fix it.

@hgaol
Copy link
Contributor

hgaol commented Aug 3, 2024

BTW, I also found it has been hard coded to replace the path of url with /v2.1/track. indicated below,

ingestionURL.Path = path.Join(ingestionURL.Path, "/v2.1/track")

Is it what you expected? @michaelkira

Hi @pcwiese , is there any reason for this? If not, I thought it's more flexible to let user specify the value. What do you think of it?

@michaelkira
Copy link
Author

BTW, I also found it has been hard coded to replace the path of url with /v2.1/track. indicated below,

ingestionURL.Path = path.Join(ingestionURL.Path, "/v2.1/track")

Is it what you expected? @michaelkira

Hi @pcwiese , is there any reason for this? If not, I thought it's more flexible to let user specify the value. What do you think of it?
Hi @hgaol I am not familiar with the version difference here. The current version works good for global endpoint, so I assume its expected.
Btw, is the fixed merged? Which version should I ref to?

@hgaol
Copy link
Contributor

hgaol commented Sep 2, 2024

BTW, I also found it has been hard coded to replace the path of url with /v2.1/track. indicated below,

ingestionURL.Path = path.Join(ingestionURL.Path, "/v2.1/track")

Is it what you expected? @michaelkira
Hi @pcwiese , is there any reason for this? If not, I thought it's more flexible to let user specify the value. What do you think of it?
Hi @hgaol I am not familiar with the version difference here. The current version works good for global endpoint, so I assume its expected.
Btw, is the fixed merged? Which version should I ref to?

Hi @michaelkira , I've created a PR to fix it. But it needs the component owner @pcwiese to help to review before merge.

@michaelkira
Copy link
Author

BTW, I also found it has been hard coded to replace the path of url with /v2.1/track. indicated below,

ingestionURL.Path = path.Join(ingestionURL.Path, "/v2.1/track")

Is it what you expected? @michaelkira
Hi @pcwiese , is there any reason for this? If not, I thought it's more flexible to let user specify the value. What do you think of it?
Hi @hgaol I am not familiar with the version difference here. The current version works good for global endpoint, so I assume its expected.
Btw, is the fixed merged? Which version should I ref to?

Hi @michaelkira , I've created a PR to fix it. But it needs the component owner @pcwiese to help to review before merge.

Hi @hgaol Thanks for the fix, I see the pr already approved, can you merge the pr can let us know how can we get test image to verify?

@hgaol
Copy link
Contributor

hgaol commented Sep 9, 2024

Hi @michaelkira , I have no permission to merge and I guess only maintainer and approver can do it. Since both owner and maintainer has approved it and all tests have passed, I think they'll merge it once at convenience. Or you can ping them in the PR if it's urgent for you.

mx-psi pushed a commit that referenced this issue Sep 11, 2024
)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->

Fixing a bug

**Link to tracking Issue:**  #33971 

**Testing:** It's just one line and simple, so I just tested locally. If
test cases needed, I can provide in this PR.

**Documentation:** if no connection string and endpoint is provided,
then use it instead of the default one.

---------

Co-authored-by: David Ashpole <[email protected]>
jriguera pushed a commit to springernature/opentelemetry-collector-contrib that referenced this issue Oct 4, 2024
…n-telemetry#34399)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->

Fixing a bug

**Link to tracking Issue:**  open-telemetry#33971 

**Testing:** It's just one line and simple, so I just tested locally. If
test cases needed, I can provide in this PR.

**Documentation:** if no connection string and endpoint is provided,
then use it instead of the default one.

---------

Co-authored-by: David Ashpole <[email protected]>
@atoulme atoulme removed the needs triage New item requiring triage label Oct 12, 2024
@atoulme
Copy link
Contributor

atoulme commented Oct 12, 2024

It looks like this issue was resolved, please close the issue if this is confirmed.

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
Projects
None yet
Development

No branches or pull requests

3 participants