-
Notifications
You must be signed in to change notification settings - Fork 447
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
OpenTelemetry support #9985
OpenTelemetry support #9985
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Customer config approach for preview looks good to me. Primary areas of concern are:
- Some telemetry semantics.
- Conditioning the resource detector / azure-specific stuff to only when actually hosted by functions serverless model.
- Performance impact of the telemetry processors in this PR. Lets do our best to avoid allocations as much as possible in these as they are hot-paths.
- OTel code may have examples
src/WebJobs.Script/Diagnostics/OpenTelemetry/TraceFilterProcessor.cs
Outdated
Show resolved
Hide resolved
test/WebJobs.Script.Tests/Configuration/ApplicationInsightsConfigurationTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Jacob Viau <javia@microsoft.com>
src/WebJobs.Script/Diagnostics/OpenTelemetry/ActivitySanitizingProcessor.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script/Diagnostics/OpenTelemetry/FunctionsResourceDetector.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script/Diagnostics/OpenTelemetry/FunctionsResourceDetector.cs
Show resolved
Hide resolved
src/WebJobs.Script/Diagnostics/OpenTelemetry/ResourceSemanticConventions.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we not providing an environment variable way of enabling OTel? Or relying on default env variable config mapping?
* Do not assign permissions when file does not exist * Fix unit tests * Fix unit tests
…yService (#9984) * Fixing bug where non http invocation responses were going through IHttpProxyService.EnsureSuccessfulForwardingAsync * Test cleanup * Release notes and patch version bump.
* Including symbols from dotnet-worker * Fix indentation.
* Special case EventGrid sourced blob triggers for grouping * Expand blob group unit test * Update patch version * extract consts
Minor code cleanup in FunctionsSyncManager
* Update Node.js Worker to 3.10.0 * Add PR reference
* Update WebHost.deps.json * Update deps test * NugetAudit: false
This reverts commit 8fd637a.
Adding support for OpenTelemetry --------- Co-authored-by: Jacob Viau <javia@microsoft.com> Co-authored-by: Shyju Krishnankutty <connectshyju@gmail.com> Co-authored-by: Daniel Castro <castro.daniel@microsoft.com>
* OpenTelemetry support (#9985) Adding support for OpenTelemetry --------- Co-authored-by: Jacob Viau <javia@microsoft.com> Co-authored-by: Shyju Krishnankutty <connectshyju@gmail.com> Co-authored-by: Daniel Castro <castro.daniel@microsoft.com> * Updating Otel nuget packages. (#10014) * Updating Otel nuget packages. * Update Azure.Identity to 1.11.2 (#10037) * Update Microsoft.Identity.Client to 4.60.3 * Update Azure.Identity to 1.11.2 * Remove Microsoft.Identity.Client * Update WebJobs package in test projects (#10061) * Update PowerShell workers to latest (#10016) * Update Python Worker Version to 4.28.0 (#10009) Co-authored-by: AzureFunctionsPython <funcdisc@microsoft.com> * Update Node.js Worker to 3.10.0 (#9999) * Update Node.js Worker to 3.10.0 * Add PR reference * Update Python Worker Version to 4.28.1 (#10028) Co-authored-by: AzureFunctionsPython <funcdisc@microsoft.com> --------- Co-authored-by: Jacob Viau <javia@microsoft.com> Co-authored-by: andystaples <77818326+andystaples@users.noreply.github.com> Co-authored-by: gavin-aguiar <80794152+gavin-aguiar@users.noreply.github.com> Co-authored-by: AzureFunctionsPython <funcdisc@microsoft.com> Co-authored-by: Daniel Castro <castro.daniel@microsoft.com>
Where is this documented exactly? Is this PR the only place where there are setup instructions? They feel incredibly barebones to me. Additionally, does this only support environment variable-based configuration? All of the OpenTelemetry libraries work with the The description on the PR seems to indicate our setup would not work, which is why I'd like for someone here to link to a more thorough documentation of OpenTelemetry + Azure Functions. EDIT: |
* OpenTelemetry support (#9985) Adding support for OpenTelemetry --------- Co-authored-by: Jacob Viau <javia@microsoft.com> Co-authored-by: Shyju Krishnankutty <connectshyju@gmail.com> Co-authored-by: Daniel Castro <castro.daniel@microsoft.com> * Updating Otel nuget packages. (#10014) * Updating Otel nuget packages. * Update Azure.Identity to 1.11.2 (#10037) * Update Microsoft.Identity.Client to 4.60.3 * Update Azure.Identity to 1.11.2 * Remove Microsoft.Identity.Client * Update WebJobs package in test projects (#10061) * Update PowerShell workers to latest (#10016) * Update Python Worker Version to 4.28.0 (#10009) Co-authored-by: AzureFunctionsPython <funcdisc@microsoft.com> * Update Node.js Worker to 3.10.0 (#9999) * Update Node.js Worker to 3.10.0 * Add PR reference * Update Python Worker Version to 4.28.1 (#10028) Co-authored-by: AzureFunctionsPython <funcdisc@microsoft.com> --------- Co-authored-by: Jacob Viau <javia@microsoft.com> Co-authored-by: andystaples <77818326+andystaples@users.noreply.github.com> Co-authored-by: gavin-aguiar <80794152+gavin-aguiar@users.noreply.github.com> Co-authored-by: AzureFunctionsPython <funcdisc@microsoft.com> Co-authored-by: Daniel Castro <castro.daniel@microsoft.com>
Introducing OpenTelemetry support for the Host enables users to adopt a method supported by OpenTelemetry for exporting telemetry data. This addition accommodates both existing AI SDK and new OpenTelemetry instrumentations, offering users the option to activate OpenTelemetry by adjusting the telemetry mode.
Telemetry Mode Configuration:
By default, the Host process is integrated with Application Insights through the AI SDK, emitting telemetry for requests, metrics, and logs. While logs are produced using Illoger, traces and metrics do not utilize OpenTelemetry's recommended APIs, such as ActivitySource and Meter.
To shift to a mode where the Host outputs telemetry in alignment with OpenTelemetry's standards and APIs, users can modify the telemetry mode within the host.json file or through an environmental variable override as follows:
Export Options:
Azure Monitor Exporter: Users can export telemetry to Application Insights by adding the APPLICATIONINSIGHTS_CONNECTION_STRING, enabling the Azure Monitor exporters and LiveMetrics.
OTLP Exporter: Facilitates telemetry export to any OTLP-compatible endpoint. Configuration is possible by setting the OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADERS for OTLP endpoints.
This implementation is compatible with all standard OpenTelemetry environment variables, allowing for the configuration of log and trace providers. As the OpenTelemetry Configuration specification becomes stable, there are plans to support more detailed configuration options, enabling users to fine-tune their telemetry behavior.
Issue describing the changes in this PR
resolves #9273
Dependencies changes
Microsoft.Azure.WebJobs.Script.Tests.DependencyTests.Verify_DepsJsonChanges
Source: DependencyTests.cs line 53
Duration: 605 ms
Message:
IMPORTANT: The dependencies in WebHost have changed and MUST be reviewed before proceeding. Please follow up with brettsam, fabiocav or mathewc for approval.
Previous file: C:\Users\Rohit Ranjan\Source\Repos\azure-functions-host\test\WebJobs.Script.Tests\bin\Debug\net8.0\Microsoft.Azure.WebJobs.Script.WebHost.deps.json
New file: C:\Users\Rohit Ranjan\Source\Repos\azure-functions-host\src\WebJobs.Script.WebHost\bin\debug\net8.0\Microsoft.Azure.WebJobs.Script.WebHost.deps.json
Changed:
- Azure.Core.dll: 1.35.0.0/1.3500.23.45706 -> 1.38.0.0/1.3800.24.12602
Removed:
Added:
- Azure.Monitor.OpenTelemetry.AspNetCore.dll: 1.2.0.0/1.200.24.16203
- Azure.Monitor.OpenTelemetry.Exporter.dll: 1.3.0.0/1.300.24.10803
- Azure.Monitor.OpenTelemetry.LiveMetrics.dll: 1.0.0.0/1.0.24.15803
- OpenTelemetry.Api.dll: 1.0.0.0/1.8.0.1229
- OpenTelemetry.Api.ProviderBuilderExtensions.dll: 1.0.0.0/1.8.0.1229
- OpenTelemetry.dll: 1.0.0.0/1.8.0.1229
- OpenTelemetry.Exporter.Console.dll: 1.0.0.0/1.6.0.1006
- OpenTelemetry.Exporter.OpenTelemetryProtocol.dll: 1.0.0.0/1.8.0.1229
- OpenTelemetry.Extensions.Hosting.dll: 1.0.0.0/1.8.0.1229
- OpenTelemetry.Instrumentation.AspNetCore.dll: 1.0.0.0/1.7.0.1114
- OpenTelemetry.Instrumentation.Http.dll: 1.0.0.0/1.7.0.1114
- OpenTelemetry.PersistentStorage.Abstractions.dll: 1.0.0.0/1.0.0.0
- OpenTelemetry.PersistentStorage.FileSystem.dll: 1.0.0.0/1.0.0.0
- System.ClientModel.dll: 1.0.0.0/1.0.24.5302
Expected: True
Actual: False
Stack Trace:
DependencyTests.Verify_DepsJsonChanges() line 125
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
I will update the documentation later.
Pull request checklist
release_notes.md