You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proposal: structured properties in Azure Functions Node.js logging #477
context.error('External service request failed',{service: 'example-api',operation: 'fetchData',statusCode: 503,retryable: true,});
With structured logging enabled, these properties should appear as separate Application Insights customDimensions, so a failure can be filtered by customDimensions.statusCode without parsing the message.
Log a readable message together with application context, such as service, operation, status code and retry information, through existing context.log/error calls.
Keep that context as separate Application Insights fields so developers can filter failures, group related events, build alerts and display diagnostic information in their applications without parsing message text.
Make this available through the Functions logging API, preserving its familiar usage and invocation correlation instead of requiring application code to use a separate telemetry API for every structured log.
Thank you for the proposal and the linked PRs. We reviewed the approach and confirmed that structured properties require coordinated changes across the library, worker, and OpenTelemetry integration. The proposed exporter changes also alter default log-forwarding behavior for existing applications, raising backward-compatibility concerns.
Given those concerns, we are not taking on this work at this time and are moving this item to the backlog for future consideration. We will revisit whether and how this capability should be addressed while preserving existing behavior.
For now, we recommend the previously suggested workaround from #227: use the Application Insights SDK directly to emit telemetry with custom properties.
Possible approach that would preserve backward compatibility with legacy applications and keep changes to interfaces to a minimum:
The function context contains traceContext, which contains an attributes object of type Record<string, string>.
That's described as "Holds additional properties being sent as part of request telemetry".
Could a function invocation add to or modify those attributes in order to have additional custom properties propagate to OpenTelemetry spans for logs / Application Insights?
Note that the current, Record<string, string> signature does seem to be more limiting that the specs for custom properties for OpenTelemetry. Broadening that to string | number | boolean would probably make sense.
For now, we recommend the previously suggested workaround from #227: use the Application Insights SDK directly to emit telemetry with custom properties.
Yeah, but doesn't it require special activity function, when performed in orchestrator? RIght now I can just type: context.log('Whatever');
in orchestrator and it works. Using AI SDK would require special activity call.
Activity
Azure#477 - Preserve structured properties from logging arguments
Azure#477 - Restrict structured options to log hook registration
swapnil-nagar commentedon Oct 20, 2026
Thank you for raising this issue, we will review and prioritize by end of Week Oct 23
swapnil-nagar commentedon Oct 20, 2026
Thank you for the proposal and the linked PRs. We reviewed the approach and confirmed that structured properties require coordinated changes across the library, worker, and OpenTelemetry integration. The proposed exporter changes also alter default log-forwarding behavior for existing applications, raising backward-compatibility concerns.
Given those concerns, we are not taking on this work at this time and are moving this item to the backlog for future consideration. We will revisit whether and how this capability should be addressed while preserving existing behavior.
For now, we recommend the previously suggested workaround from #227: use the Application Insights SDK directly to emit telemetry with custom properties.
timtucker-dte commentedon Oct 21, 2026
Possible approach that would preserve backward compatibility with legacy applications and keep changes to interfaces to a minimum:
The function context contains traceContext, which contains an attributes object of type Record<string, string>.
That's described as "Holds additional properties being sent as part of request telemetry".
Could a function invocation add to or modify those attributes in order to have additional custom properties propagate to OpenTelemetry spans for logs / Application Insights?
Example:
Note that the current, Record<string, string> signature does seem to be more limiting that the specs for custom properties for OpenTelemetry. Broadening that to string | number | boolean would probably make sense.
rmaziarka commentedon Nov 3, 2026
Swapnil Nagar (@swapnil-nagar)
Yeah, but doesn't it require special activity function, when performed in orchestrator? RIght now I can just type:
context.log('Whatever');in orchestrator and it works. Using AI SDK would require special activity call.