microsoft / ApplicationInsights-node.js

Microsoft Application Insights SDK for Node.js
MIT License
324 stars 141 forks source link

Why disable azure sdk http dependency collect? #1127

Closed emmansun closed 1 year ago

emmansun commented 1 year ago

Hi @markwolff ,

ApplicationInsights-node.js/AutoCollection/HttpDependencies.ts

                // Azure SDK special handling
                if ((<any>options).headers) {
                    userAgentHeader = (<any>options).headers["User-Agent"] || (<any>options).headers["user-agent"];
                    if (userAgentHeader && userAgentHeader.toString().indexOf("azsdk-js") !== -1) {
                        shouldCollect = false;
                    }
                }

Is this assumption still true? https://github.com/microsoft/ApplicationInsights-node.js/pull/562/files#diff-d24e7dccf7f1a331c6b4ef4b32f9e4cd2b243cf90a1a9ee94bb57e62d1e579bc

We used @azure/identity / @azure/keyvault-certificates/ @azure/keyvault-keys, how can we collect those dependencies in our own workspace?

hectorhdzg commented 1 year ago

@emmansun you can generate telemetry for Azure SDKs turning on enableAutoCollectDependencies during initialization, more info here. I recommend you to try latest version of applicationinsights as we recently fixed an issue that was causing missing telemetry for Azure SDKs.

emmansun commented 1 year ago

Thx @hectorhdzg , we used v2.4.1, v2.5.0, both have no Azure SDK dependency auto collect, let me upgrade it to v2.5.1 to check it.

emmansun commented 1 year ago

v2.5.1 returns normal, thx!