ApplicationInsights-Go
ApplicationInsights-Go copied to clipboard
Connection strings support
https://docs.microsoft.com/en-us/azure/azure-monitor/app/sdk-connection-string?tabs=net#overview https://docs.microsoft.com/en-us/azure/azure-monitor/app/custom-endpoints?tabs=net#regions-that-require-endpoint-modification
Connection strings are the new preferred method of setting custom endpoints within Application Insights. Request to share info on if this is supported already. If not could we raise a request for the same?
It might be possible to accept either an Ikey or a connection string in both NewTelemetryClient and NewTelemetryConfiguration. If you need to use a custom endpoint, then do this as a workaround:
cfg := appinsights.NewTelemetryConfiguration(ikey)
cfg.EndpointUrl = "https://dc.applicationinsights.azure.cn/v2/track" // Data collector endpoint URL
client := appinsights.NewTelemetryClientFromConfig(cfg)