Hi Dave,
could you find a solution for this issue?
Best regards,
Gürcan
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
We have been using the App Insights V2 TelemetryClient to create custom events in our Spring Boot Java app. We are trying to migrate to V3. Although the following web site says "There are typically no code changes when upgrading to 3.x.", in our case, the existing code gets a compile error, because the TelemetryConfiguration
class no longer exists in V3.
https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-upgrade-from-2x
TelemetryConfiguration.getActive().instrumentationKey = metricPublisherRequestDTO.ikey
val telemetryClient = TelemetryClient()
telemetryClient.trackEvent(
metricPublisherRequestDTO.name,
metricPublisherRequestDTO.properties,
metricPublisherRequestDTO.metrics
)
We need to be able to programmatically set the instrumentation key / connection string, because this is a generic service that we use to talk to any App Insights instance. We can find no way to do that. I tried the following, but it doesn't work:
val telemetryClient = TelemetryClient()
val telemetryContext = telemetryClient.context
telemetryContext.connectionString = metricPublisherRequestDTO.ikey
Does anyone have any idea what we need to do this?
Hi Dave,
could you find a solution for this issue?
Best regards,
Gürcan