Skip to content

Conversation

@huang-julien
Copy link
Contributor

@huang-julien huang-julien commented Feb 28, 2025

Hello 👋

I'm coming from applicationinsights 2 and i like that we still have a shim in v3 while moving to OTEL.

This PR aims to improve a bit the DX by adding a setAzureMonitorOptions() static method to Configuration .
The reason is that those who upgraded from v2 to v3 may still use setup() which returns the Configuration class. In order to modify AZure Monitors options, users would have to do something like:

const configuration = setup('connection-string')
defaultClient.config.azureMonitorOpenTelemetryOptions = { /** ... **/ }
configuration.start()

this PR would allow to do this instead

setup('connection-string')
  .setAzureMonitorOptions({ /** ... **/ })
  .start()

@JacksonWeber
Copy link
Contributor

@huang-julien Just so I can understand your use-case a little better. You're adopting modifying the azureMonitorOpenTelemetryOptions directly, so I'm interested in why you're not migrating to the Azure Monitor OpenTelemetry distro. Are you just using the shim for access to the track APIs?

@huang-julien
Copy link
Contributor Author

huang-julien commented Mar 5, 2025

Yup I am. I'm actually the maintainer of nitro-applicationinsights and nuxt-applicationinsights.

The shim is very conveniant for SSR frameworks as it provide quasi-identical methods between appinsights node and appinsights web which allows for devs ( in frameworks such as Nuxt) to be able to call track* methods through a single property without having to care about server-side/client-side code.

@JacksonWeber JacksonWeber requested a review from Copilot May 23, 2025 21:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

A concise update to improve developer experience for upgrading from v2 to v3 by adding a static method to set Azure Monitor options on the global configuration.

  • Adds a static method setAzureMonitorOptions() to modify Azure Monitor OpenTelemetry options.
  • Provides chaining support to simplify configuration by returning the Configuration class.

@JacksonWeber JacksonWeber merged commit d77b686 into microsoft:main May 27, 2025
16 checks passed
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.

2 participants