-
Notifications
You must be signed in to change notification settings - Fork 200
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
Add possibility to use multiple custom destinations(instrumentation keys) #1674
Comments
hey @dma1979! this should work in recent versions if you set the instrumentation key on the telemetry record itself, e.g.
|
hi @trask , thank you for your piece of advice. But it still doesn't work by setting intrumentation key on the record itslef: private EventTelemetry createEventTelemetry(String name) {
final var event = new EventTelemetry(name);
Optional.ofNullable(instrumentationKey)
.ifPresent(key -> event.getContext().setInstrumentationKey(key));
return event;
} Regarding versions: |
oh, sorry, you will need 3.0.4 or later for that to work |
Thank you @trask for your quick response.
|
@dma1979 I am guessing the application insights endpoint is redirecting with 308 response when telemetry is sent to eastus2-3. And as of today the agent donot support redirects. Could you please confirm if you see any redirects through debugger tool like Fiddler. |
@dma1979 we are adding support to redirects in the following PR #1809 |
this should work now in 3.2.0-BETA.2 |
When custom client is configured with own instrumentation key it is ignored and handled by Agent client:
Agent configuration:
The destination(instrumentation key) from custom client should be used, not configured globally in the agent.
Alternatives
We were trying to tune the client, but then we have realized that BytecodeUtilImpl.java#L220 configures agent client in the global scope.
Additional context
The client is set globally in the source code below https://github.com/microsoft/ApplicationInsights-Java/blob/3.0.2/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/instrumentation/sdk/BytecodeUtilImpl.java#L220
The text was updated successfully, but these errors were encountered: