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

Migrate from Application Insights instrumentation keys to connection strings #3710

Closed
cbismuth opened this issue Mar 23, 2023 · 3 comments · Fixed by #3715
Closed

Migrate from Application Insights instrumentation keys to connection strings #3710

cbismuth opened this issue Mar 23, 2023 · 3 comments · Fixed by #3715
Labels
enhancement A general enhancement registry: azure monitor An Azure Monitor Registry related issue release notes Noteworthy change to call out in the release notes
Milestone

Comments

@cbismuth
Copy link
Contributor

On 31 March 2025, technical support for instrumentation key–based global ingestion in the Application Insights feature of Azure Monitor will end.

How can we use connection strings with Micrometer?

default String instrumentationKey() {
return getSecret(this, "instrumentationKey").get();
}

https://azure.microsoft.com/en-us/updates/technical-support-for-instrumentation-key-based-global-ingestion-in-application-insights-will-end-on-31-march-2025/

Thanks,
Christophe

@jonatan-ivanov
Copy link
Member

Connected issue: #3420

Right now you need to override the AzureMonitorMeterRegistry but since the connection string is available in the Azure SDK (2.x), I think adding this should not be too complicated.
I think we can add a new config method for connectionString, if its value present, we can set it as-is; if its value is not present, we can create a connection string from the instrumentationKey (no endpoint override in that case). What do you think?
Would you be interested in creating a PR?

@jonatan-ivanov jonatan-ivanov added enhancement A general enhancement and removed waiting-for-triage labels Mar 23, 2023
@jonatan-ivanov jonatan-ivanov added this to the 1.next milestone Mar 23, 2023
@cbismuth
Copy link
Contributor Author

Yes @jonatan-ivanov, I'll have a look and let you know, thank you.

@shakuzen shakuzen added the registry: azure monitor An Azure Monitor Registry related issue label Mar 24, 2023
@cbismuth
Copy link
Contributor Author

cbismuth commented Mar 24, 2023

Hi, here is a first PR draft below, feel free to comment, thanks!

Fixed by #3715.

shakuzen pushed a commit that referenced this issue Mar 28, 2023
Adds a new configuration method to AzureMonitorConfig for connectionString configuration, which is meant to supersede instrumentationKey config. `instrumentationKey` is marked as deprecated and only used by default when connectionString is not set. Users should set the instrumentationKey as part of the connectionString going forward.

See https://learn.microsoft.com/en-us/azure/azure-monitor/app/sdk-connection-string
Resolves gh-3710
@shakuzen shakuzen modified the milestones: 1.next, 1.11.0-RC1 Mar 28, 2023
@shakuzen shakuzen added spring-boot change Change is needed in Spring Boot for this issue release notes Noteworthy change to call out in the release notes labels Mar 28, 2023
@shakuzen shakuzen removed the spring-boot change Change is needed in Spring Boot for this issue label Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A general enhancement registry: azure monitor An Azure Monitor Registry related issue release notes Noteworthy change to call out in the release notes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants