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

Auto dependency tracking not working after upgrade to v3.4.0 #1402

Open
BenJohnCarson opened this issue Nov 14, 2024 · 1 comment
Open

Auto dependency tracking not working after upgrade to v3.4.0 #1402

BenJohnCarson opened this issue Nov 14, 2024 · 1 comment
Assignees

Comments

@BenJohnCarson
Copy link

Hi,
We're looking into upgrading node applicationinsights package from v3.4.0 from v2.9.5.

I've spent some time today experimenting with v3 and I can not get auto dependency tracking to work. The initial request itself is tracked and showing in AI, but none of the following dependencies are. The dependencies were logged fine in v2.

I've followed the upgrade migration guide.

The exact same code that works when using v2.9.5 is not working when using v3.4.0 :

// telemetry.ts
import * as appInsights from 'applicationinsights';

export { appInsights };

export const startTelemetry = () =>
  appInsights.setup().setAutoCollectPerformance(false, false).start();

// functions/index.ts
import { startTelemetry } from 'telemetry.ts';
import { app } from '@azure/functions';

app.hook.appStart(async () => {
    startTelemetry();
    ...
});

app.http('some-handler', {
    methods: ['GET'],
    ...

It might be relevant that we're using the node-fetch package for our fetch requests (not native fetch as this was not supported in v2). We are using node version 18.20.

Any help would be appreciated, cheers!

@JacksonWeber JacksonWeber self-assigned this Nov 15, 2024
@JacksonWeber
Copy link
Contributor

@BenJohnCarson If you're having trouble seeing dependency tracking using node-fetch I'd suggest adding the OpenTelemetry fetch instrumentation via the method described as part of the Azure Monitor OpenTelemetry distro (which v3.x of this SDK is based on) https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/monitor-opentelemetry#instrumentation-libraries. The relevant instrumentation can be found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants