-
Notifications
You must be signed in to change notification settings - Fork 235
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
[BUG] using EndPointUrl (and IngestionEndpoint) results in Telemetry sent to incorrect urls #2197
Comments
There is no need for any This is because when we parse the |
Well, it isn't in my case ;) Regardless of that, though. InstrumentationKey support is going to be deprecated and removed in the future, probably including the |
Not exactly, while "InstrumentationKey" support is going away, this is just for directly setting the
No, we will (and are planning) to keep the existing |
Thanks for your timely response, it's immensely appreciated! I will attempt your suggestions tomorrow and report back if it works. As far as I can remember, setting |
If your connection string includes the ApplicationInsights-JS/AISKU/src/AISku.ts Lines 196 to 201 in dce1e44
|
All "keys" from the parsed connection string become lowercase -- so the one you provide doesn't have to have it all in lowercase. |
I have found a solution, but it goes against your advice, therefore I'm posting this comment. The connectionstring I provided in my latest comment was:
If I understand you correctly, this means that ApplicationInsights-JS/AISKU/src/AISku.ts Lines 198 to 199 in dce1e44
I fully understand what you're saying here, and I hope we can agree on the things said above. I'm grateful for your patience. The issueHowever, as you can see in my latest comment, this is not the case because it still overrides the I looked a bit further into the ApplicationInsights-JS/shared/AppInsightsCommon/src/ConnectionStringParser.ts Lines 32 to 39 in dce1e44
The way I interpret this is that, whilst parsing the connectionstring, the ApplicationInsights-JS/AISKU/src/AISku.ts Lines 198 to 199 in dce1e44
WorkaroundI can work around this by using the following connectionstring.
When running on ApplicationInsights-JS/AISKU/src/AISku.ts Lines 198 to 199 in dce1e44
What's going on here? ExtraI do not understand how "lowercase" plays a role here, as this is the exact spelling as showcased in the Azure Portal. In fact, changing my working example (all lowercase) to this:
results in a working code sample, so I don't understand why the lowercase is required here. |
Well bother! Lets tag this issue as a bug so that we can "update" the so it would become something like const cs = parseConnectionString(_config.connectionString, _config.endpointUrl); and then in the parse this bit can use that export function parseConnectionString(connectionString?: string, userDefaultEndpointUrl?: string): ConnectionString {
...
// apply the default endpoints
result.ingestionendpoint = result.ingestionendpoint || userDefaultEndpointUrl || DEFAULT_BREEZE_ENDPOINT; |
Seems like a great fix! Perhaps it would be worth creating a new issue for this, as the current issue is kind of all over the place. Also, I'm just wondering if this needs to be applied to other App Insights SDK's as well. Couldn't a Java/Python/.NET/etc.. SDK have the same issue as well? |
The other languages are controlled differently to the JS repo, and I'm not sure if they have any instrumentation key validation or the ability to have the endpoint declared differently. So this would need an issue raised on each repo. |
For future readers: Until this bug is fixed, if you use If you have set up your |
Description/Screenshot
IMPORTANT: I created this issue with the assumption that my issues lay elsewhere. The comments ended up helping find the root cause of this issue and uncovered the bug. The title of this issue has been updated to reflect this, but the body of this issue has not.
I'm using application insights with an instrumentationkey currently. My configuration looks like this:
The
disableInstrumentationKeyValidation
is extremely important for me. I forward all app insights to my reverse proxy which then replaces the%temp%
value with the real one. This way I don't need to expose it in the client, which is far more secure❗I'm currently migrating to the new
connectionString
property with the same%TEMP
value, but there is nodisableConnectionStringValidation
property available. This causes application insights to load incorrectly...I need to be able to disable connectionstring validation to keep this process working.
I would really appreciate a fix or workaround!
Steps to Reproduce
Expected behavior
I want to be able to disable connectionstring validation.
Additional context
The text was updated successfully, but these errors were encountered: