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

[Question] Too much traces /track being sent #1339

Open
lapa182 opened this issue Jun 3, 2024 · 3 comments
Open

[Question] Too much traces /track being sent #1339

lapa182 opened this issue Jun 3, 2024 · 3 comments

Comments

@lapa182
Copy link

lapa182 commented Jun 3, 2024

Hello! We recently noticed a spike in our Next.js application of traces coming from /track. I was googling about it and saw this Github issue in another SDK (microsoft/ApplicationInsights-Python#317).

Do you know how I could achieve the same in the Node SDK?

@JacksonWeber
Copy link
Contributor

@lapa182 Can you provide some further details here? Are you seeing duplicated traces? Or do you just want to see fewer traces in general based on some kind of criteria? Also, what version of the SDK are you using/did you recently upgrade before seeing this spike?

@lapa182
Copy link
Author

lapa182 commented Jun 6, 2024

Hi @JacksonWeber, sorry for the delay was trying to get some information as we had to disable AppInsights in our instance because our logging was ramping up our costs.

I got a screenshot of the "issue":

8594110e-84b2-48a3-a687-758546481593

This is a dev instance and you can see that every minute (sometimes less than a minute) we had one track event from v2/track endpoint.

For context, we are using Next.js 14 and we are loading the instrumentation with this code:

	appInsights
		.setup(connectionString)
		.setAutoCollectRequests(true)
		.setAutoCollectPerformance(true, true)
		.setAutoCollectExceptions(true)
		.setAutoCollectDependencies(true)
		.setAutoCollectConsole(true, true)
		.setAutoCollectPreAggregatedMetrics(true)
		.setSendLiveMetrics(false)
		.setInternalLogging(false, true)
		.enableWebInstrumentation(false)
		.start();

We were using this implementation before https://github.com/CMeeg/nextjs-aca/blob/main/src/lib/instrumentation/azure-monitor.ts, which was still in beta and when the SDK came out of beta we decided to update the code (we are on 3.1.0 now). Is there a way to disable capturing v2/track or do you have any other suggestions we could do?

Not sure if it's related as well, but we are using Log Analytics in App Insights.

@hectorhdzg
Copy link
Member

@lapa182 I tried to reproduce with no success using Next.js, are you calling setup and start in Application Insights multiple times in your Node.js process?, what you are experiencing is not a common thing, you can always explicitly remove these extra dependencies using HTTP OpenTelemetry Instrumentation that is being used internally to generate the telemetry configuring [ignoreOutgoingRequestHook]
(https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http#http-instrumentation-options), you should be able to add this configuration in 'instrumentationOptions' 'http' configuration if using @azure/monitor-opentelemetry directly.

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

3 participants