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

Clean Up Shim #1260

Closed
wants to merge 5 commits into from
Closed

Clean Up Shim #1260

wants to merge 5 commits into from

Conversation

JacksonWeber
Copy link
Contributor

Cleaning the shim of options no longer supported by the distro API after being updated.

Including

  • OTLP exporter configurations for traces/metrics/logs
  • Extended metrics
  • Log Instrumentation Options (will be merged into the instrumentation options object)
  • Enabling auto collection of external loggers
  • Native metrics
  • MaxBatchIntervalMs
  • Enabling auto collection of performance counters

Resolves bug where if enableAutoCollectDependencies/enableAutoCollectRequests was set to false, all other instrumentation options would be false.

Cleans up the unused configHelper class.

| webInstrumentationConfig | Not currently supported by the shim, but is in Azure Monitor OpenTelemetry as `browserSdkLoaderConfig`. |
| webInstrumentationConfig | Not currently supported by the shim, or Azure Monitor OpenTelemetry. |
| enableAutoCollectPerformance | Not supported in the shim. |
| enableAutoCollectConsole | Not supported in the shim. |
Copy link
Member

Choose a reason for hiding this comment

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

Should be supported in shim

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, performance counters appear to be supported in the shim code, although not via the distro's API any longer.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah but this shim readme not distro

| webInstrumentationConfig | Not currently supported by the shim, or Azure Monitor OpenTelemetry. |
| enableAutoCollectPerformance | Not supported in the shim. |
| enableAutoCollectConsole | Not supported in the shim. |
| enableAutoCollectExternalLoggers | Not supported in the shim. |
Copy link
Member

Choose a reason for hiding this comment

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

Should be supported in shim

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see performance counters will be, and Console + Winston are not supported in OTel yet, so I'll keep those instrumentations here. But I believe we need to kill webInstrumentationConfig since configuring the browser SDK loader is no longer supported in the distro.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I didn't say anything about webInstrumentationConfig, we should deprecate that one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's in the highlighted bit in the UI on Github on my side, sorry for the confusion!

| enableAutoCollectPerformance | Not supported in the shim. |
| enableAutoCollectConsole | Not supported in the shim. |
| enableAutoCollectExternalLoggers | Not supported in the shim. |
| enableAutoCollectExceptions | Not supported in the shim. |
Copy link
Member

Choose a reason for hiding this comment

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

Do you have a task to follow up on this?, it would be good to check if we can support this

winston: { enabled: true },
bunyan: { enabled: true }
},
otlpTraceExporterConfig: {},
Copy link
Member

Choose a reason for hiding this comment

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

Why removing OTLP configurations here? is it being initialized somewhere else not sure I follow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, this was a reaction to the API change in the distro, looks like I can modify the internal config of the distro from within main.ts so I'll just transition what used to be configurations passed to the distro via its API to modifying the internal config.

@@ -160,23 +149,13 @@ class Config implements IConfig {
if (this.aadTokenCredential) {
options.azureMonitorExporterOptions.credential = this.aadTokenCredential;
}
if (typeof (this.enableAutoCollectConsole) === "boolean") {
const setting: boolean = this.enableAutoCollectConsole;
options.logInstrumentationOptions = {
Copy link
Member

Choose a reason for hiding this comment

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

Console OTel instrumentation still doesn't exist, so we cannot remove this

if (typeof (this.enableAutoCollectExternalLoggers) === "boolean") {
options.logInstrumentationOptions = {
...options.logInstrumentationOptions,
winston: { enabled: this.enableAutoCollectExternalLoggers },
Copy link
Member

Choose a reason for hiding this comment

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

Same here winston still not collecting logs in OpenTelemetry instrumentation

@@ -245,47 +210,6 @@ class Config implements IConfig {
process.env["APPLICATION_INSIGHTS_NO_STANDARD_METRICS"] = "disable";
}
}
// NATIVE METRICS
if (typeof (this.enableAutoCollectExtendedMetrics) === "boolean") {
Copy link
Member

Choose a reason for hiding this comment

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

If you are removing native metrics please remove any related code, including all types, only updating the config is not enough

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