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

ApplicationInsights:Failed to propagate context in Azure Functions [ #51

Closed
paulsmithkc opened this issue Jan 17, 2023 · 2 comments
Closed
Labels
bug Something isn't working external
Milestone

Comments

@paulsmithkc
Copy link

paulsmithkc commented Jan 17, 2023

Investigative information

Please provide the following:

  • Timestamp: Between 16 Jan, 12:14 PM CST (2023-01-16T20:14:00Z) and 17 Jan 12:57 CST (2023-01-17T20:57:00Z)
  • Invocation ID: 32fd51cf-df2e-4920-8eca-25b7abf15ad4
  • Region: West US 2

Repro steps

Provide the steps required to reproduce the problem:

  1. Create and deploy a function app
  2. In an http trigger attempt to log a JSON object as the message:
const healthTrigger: AzureFunction = async function(context: Context) {
  context.log.info('{"method":"healthTrigger","message":"triggered"}');
  context.res = { body: 'OK', status: 200 };
};

Expected behavior

Message is logged to AI and no errors are generated.

Actual behavior

The following error is written to the console:

ApplicationInsights:Failed to propagate context in Azure Functions [
  at AzureFunctionsHook.<anonymous> (D:\home\site\wwwroot\node_modules\[redacted]\node_modules\applicationinsights\out\AutoCollection\AzureFunctionsHook.js:95:38)
  at AzureFunctionsHook._propagateContext (D:\home\site\wwwroot\node_modules\[redacted]\node_modules\applicationinsights\out\AutoCollection\AzureFunctionsHook.js:87:16)
  at AzureFunctionsHook._propagateContext (D:\home\site\wwwroot\node_modules\[redacted]\node_modules\applicationinsights\out\AutoCollection\AzureFunctionsHook.js:87:16)
  at step (D:\home\site\wwwroot\node_modules\[redacted]\node_modules\applicationinsights\out\AutoCollection\AzureFunctionsHook.js:33:23)
  at Object.next (D:\home\site\wwwroot\node_modules\[redacted]\node_modules\applicationinsights\out\AutoCollection\AzureFunctionsHook.js:14:53)
  at new Promise (<anonymous>)
  at __awaiter (D:\home\site\wwwroot\node_modules\[redacted]\node_modules\applicationinsights\out\AutoCollection\AzureFunctionsHook.js:4:12)
  at t.InvocationModel.<anonymous> (D:\Program Files (x86)\SiteExtensions\Functions\4.14.0\workers\node\dist\src\worker-bundle.js:2:51947)
  at new Promise (<anonymous>)
  at y.<anonymous> (D:\Program Files (x86)\SiteExtensions\Functions\4.14.0\workers\node\dist\src\worker-bundle.js:2:34778)
]

Related information

Provide any related information

  • Programming language used: Typescript
@ejizba
Copy link
Contributor

ejizba commented Jan 17, 2023

Hi @paulsmithkc this is actually a bug in the applicationinsights npm module introduced in v2.4.0. I recommend you downgrade the npm package to v2.3.6 as a workaround and track microsoft/ApplicationInsights-node.js#1063 for further updates

@ejizba
Copy link
Contributor

ejizba commented Jan 28, 2023

Closing as the applicationinsights package released v2.4.1 a few days ago to address this bug

@ejizba ejizba closed this as completed Jan 28, 2023
@ejizba ejizba added this to the Tracking milestone Jan 28, 2023
@ejizba ejizba added bug Something isn't working external labels Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external
Projects
None yet
Development

No branches or pull requests

2 participants