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

The Source property seems to be the wrong one for mapping client IP to #33210

Closed
qrli opened this issue May 24, 2024 · 4 comments
Closed

The Source property seems to be the wrong one for mapping client IP to #33210

qrli opened this issue May 24, 2024 · 4 comments
Labels
bug Something isn't working closed as inactive exporter/azuremonitor needs triage New item requiring triage Stale

Comments

@qrli
Copy link

qrli commented May 24, 2024

Component(s)

exporter/azuremonitor

What happened?

Description

AzureMonitor exporter, as documented in readme, is mapping client IP to the Source property. However, it does not sound like the right mapping. The value in Source does not provide value to Application Insights's "Client Ip address", leading "Country or region", "City", etc. not correctly populated.

According to https://github.com/microsoft/ApplicationInsights-dotnet/blob/99118c924d3880f3853c0b1c9ebe67289073dbfa/BASE/src/Microsoft.ApplicationInsights/DataContracts/RequestTelemetry.cs#L261
the Source is defined as "the source for the request telemetry object. This often is a hashed instrumentation key identifying the caller." It sounds like a totally different thing than client IP.

According to https://github.com/microsoft/ApplicationInsights-dotnet/blob/99118c924d3880f3853c0b1c9ebe67289073dbfa/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/TelemetryInitializers/ClientIpHeaderTelemetryInitializer.cs#L123
client IP is set in Context.Location.Ip. It should be this one in Go: https://github.com/microsoft/ApplicationInsights-Go/blob/9194eea52d6fe5313a2b109056254baca9ab3194/appinsights/contracts/contexttags.go#L237

Steps to Reproduce

As long as the application side sends http.client_ip or net.peer.name, the Source property of Application Insights is filled.

Expected Result

Application Insights' "Client Ip address" should get the value, so that "Country or region", "City", etc. are correctly populated.

Note that by default, Application Insights's clear out "Client Ip address" after populating "Country or region", "City", etc., for privacy reason. This is also a useful feature Source does not provide.

So, what is really to be seen is that "Client Ip address" is empty or 0.0.0.0 but "Country or region", "City", "State or province" have correct value inferred from IP.

Actual Result

Application Insights does not see the client IP so "Country or region", "City", "State or province" are not correctly populated, which may be empty or some default value.

Collector version

latest

Environment information

Environment

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

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@qrli qrli added bug Something isn't working needs triage New item requiring triage labels May 24, 2024
Copy link
Contributor

Pinging code owners:

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

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

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

Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 21, 2024
@qrli
Copy link
Author

qrli commented Sep 22, 2024

It seems the azure monitor exporter is not actively maintained... well.

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

No branches or pull requests

1 participant