ApplicationInsights-node.js icon indicating copy to clipboard operation
ApplicationInsights-node.js copied to clipboard

Upgrade 2.x to 3.0.1 startup warnings

Open skhilliard opened this issue 1 year ago • 8 comments

Upgrading from 2.x to 3.0.1 I am seeing some warnings logged that look a little worrysome...

@azure/opentelemetry-instrumentation-azure-sdk [
  'Module @azure/core-tracing has been loaded before @azure/opentelemetry-instrumentation-azure-sdk so it might not work, please initialize it before requiring @azure/core-tracing'
]```

and 

Accessing resource attributes before async attributes settled []


...are these of concern?  If so, how can they be fixed?

skhilliard avatar May 03 '24 22:05 skhilliard

Regarding the first warning: https://github.com/microsoft/ApplicationInsights-node.js/issues/1316. Looking into resolving this with the Azure SDK libraries throwing the warning.

The async attributes settled warning is thrown by OpenTelemetry and occurs because we populate resource attributes asynchronously when trying to determine if the application is running in a VM environment. We are also looking into ways to mitigate this warning as well.

JacksonWeber avatar May 03 '24 23:05 JacksonWeber

@JacksonWeber Any updates for this? Thanks!

skhilliard avatar May 24 '24 21:05 skhilliard

I have the same issue.

ghost avatar May 25 '24 22:05 ghost

@skhilliard @rassiju06 As of 3.1.0 the warnings surrounding performance counter metrics are resolved, however the warnings surrounding package loading and resource attributes are not. Please refer to https://github.com/microsoft/ApplicationInsights-node.js/issues/1107 if you're looking to suppress these warnings.

JacksonWeber avatar May 31 '24 22:05 JacksonWeber

Set environment variable:

APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL

to value:

NONE

Without setting logging to NONE, this value is returned by my console app and breaks the client parsing.

8exgh avatar Jul 04 '24 20:07 8exgh

@8exgh sorry to hear this is breaking something on your side, we were expecting this to only be noisier only, we will prioritize accordingly, this is not a simple change as we use @azure/core-tracing, same package @azure/opentelemetry-instrumentation-azure-sdk is trying to patch using OpenTelemetry

hectorhdzg avatar Jul 05 '24 17:07 hectorhdzg

@hectorhdzg from my perspective setting APPLICATION_INSIGHTS_INSTRUMENTATION_LOGGING_LEVEL environment variable to NONE does the trick (valid work around so applicationinsights node_module logs nothing to standard out). But even setting ERROR log level for example, applicationinsights still indirectly logs a message with an empty array as part of the message (the warning excluded from the array), which was surprising to me. So yeah re-iterating, using NONE log level avoids standard output from that node_modules applicationinsights library.

Use case is some custom code in a Dockerfile:

CMD echo "Getting shard number from endpoint" &&
SHARD_NUMBER=$(node getShardHelper.js) && \

which returns an integer to shell script client, which is used to invoke playwright with sharding.

But by default the applicationinsights node_module indirectly writes to standard output for logging, which would result in:

SHARD_NUMBER=SOMELOGTEXT9, which will break the playwright --shard=$SHARD_NUMBER/$TOTAL_SHARDS

8exgh avatar Jul 05 '24 20:07 8exgh

This Issue will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.

github-actions[bot] avatar May 02 '25 07:05 github-actions[bot]

@skhilliard These startup logs have been resolved as of 3.9.0 release.

JacksonWeber avatar Aug 06 '25 18:08 JacksonWeber