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

Support overriding ikey, cloud role name and cloud role instance per telemetry #1630

Merged
merged 4 commits into from
Apr 21, 2021

Conversation

trask
Copy link
Member

@trask trask commented Apr 16, 2021

Support overriding ikey, cloud role name and cloud role instance.

Example 1: Overriding on the current request

RequestTelemetry telemetry = ThreadContext.getRequestTelemetryContext().getHttpRequestTelemetry();
telemetry.getContext().setInstrumentationKey("...");
telemetry.getContext().getCloud().setRole("...");
telemetry.getContext().getCloud().setRoleInstance("...");

Example 2: Overriding on custom telemetry

EventTelemetry telemetry = new EventTelemetry("...");
requestTelemetry.getContext().setInstrumentationKey("...");
requestTelemetry.getContext().getCloud().setRole("...");
requestTelemetry.getContext().getCloud().setRoleInstance("...");

Example 3: Overriding using telemetry processor

Use span attributes:

  • ai.preview.instrumentation_key
  • ai.preview.service_name
  • ai.preview.service_instance

Attaching SNAPSHOT for testing: applicationinsights-agent-3.0.4-BETA-SNAPSHOT.jar.zip

@trask trask force-pushed the trask/cloud-role-name-override branch from 9cd6e5e to 0aac0ec Compare April 16, 2021 00:40
@trask trask marked this pull request as ready for review April 16, 2021 02:29
@heyams
Copy link
Contributor

heyams commented Apr 19, 2021

how will this work with AAD? do we need to separate the telemetries per instrumentation key into diff TelemetryBuffer?
for different ikeys, do we get a different AAD token for each instrumentation key? I did the same in statsbeat supporting multiple ikeys, but wondering how that will impact AAD support.

@trask trask force-pushed the trask/cloud-role-name-override branch from 0aac0ec to 23012a0 Compare April 19, 2021 22:58
@trask
Copy link
Member Author

trask commented Apr 21, 2021

how will this work with AAD? do we need to separate the telemetries per instrumentation key into diff TelemetryBuffer?
for different ikeys, do we get a different AAD token for each instrumentation key? I did the same in statsbeat supporting multiple ikeys, but wondering how that will impact AAD support.

cc: @kryalama @MS-jgol we will need to document that this feature is not supported for AAD installations for now

@trask trask merged commit 82d5bd2 into master Apr 21, 2021
@trask trask deleted the trask/cloud-role-name-override branch April 21, 2021 02:46
@kryalama
Copy link
Contributor

how will this work with AAD? do we need to separate the telemetries per instrumentation key into diff TelemetryBuffer?
for different ikeys, do we get a different AAD token for each instrumentation key? I did the same in statsbeat supporting multiple ikeys, but wondering how that will impact AAD support.

In this use case the user is responsible for providing the proper AAD configuration(type of authentication, clientid etc) in the config if the AppInsights resource corresponding to "Overriden Ikey" has AAD enabled. @heyams I am wondering for statsbeat support do we need AAD authentication enabled on that statsbeat endpoint resource?

@heyams
Copy link
Contributor

heyams commented Apr 21, 2021

@kryalama statsbeat endpoint is breeze, which is enabled. my question is does it obtaining a different AAD token for a different ikey? I will ping you offline to have a better understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants