-
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
Latest version of OpenTelemetry (1.4) is unusable due to dependency on System.Diagnostics.DiagnosticSource 7.0 #8938
Comments
@markrendle We are investigating this issue and let you know the findings soon. |
@markrendle thanks for reporting this, I've noted this as well. I'm a maintainer of the OpenTelemetry .NET project. @ramya894 The underlying incompatibility is actually System.Diagnostics.DiagnosticSource version 7.0.0 which OpenTelemetry .NET depends on. I have a simple repro here https://github.com/alanwest/azure-function-diagnostic-source. My repro only depends on System.Diagnostics.DiagnosticSource and not OpenTelemetry .NET. |
Hey @markrendle , thanks for opening this and apologies for the delayed response. This is indeed a limitation of the in-proc model, where particularly for .NET shared assemblies/assemblies containing types exchanged with the user context, unification is required and must match the major version of the hosting environment. For situations like this, Isolated is the recommendation, so I'd love to better understand what issues you have found there to make sure those are being tracked. In some cases, we have the ability to update the host dependency across major versions after performing compatibility analysis. We'll take a closer look at System.Diagnostics.DiagnosticSource and see if that is a viable option here, but we can't make a commitment, as any breaking change has a potential impact on the in-proc model. |
@fabiocav Just to reiterate that this issue is not just about OpenTelemetry users. Any app with DS 7.0 will face this. For example, if a library uses DS 7.0 to instrument (for metrics/traces), will face this issue irrespective of OpenTelemetry is enabled or not. I can totally understand the limitation of the infra preventing this. Could you make this limitation documented so we can easily point people to the issue and the workaround/fix (move away from in-proc )? (We have seen customers facing this issue when they use Microsoft.Extensions.Logging version 7.0 as well) |
The issue is with the
|
@fabiocav , I also meet the same issue with Azure function after migrating OTel to 1.4.0-rc.3, may I have the update or plan of fix from Azure function? |
Hi @hejingkan2005, While this is an issue with .Net InProc, I would recommend .Net Isolated. As the worker in .Net Isolated is running in its own process, there is no dependency on Functions runtime. |
I have successfully used |
Hi @fabiocav, just saw you've moved this to In-progress in Azure Functions - Host last week. Does that mean there are team working on it now? Thanks. |
Thanks @alanwest for that workaround! For the app I'm working on, I had to do: <ItemGroup>
<!-- Allow the functions host to use newer versions. -->
<FunctionsPreservedDependencies Include="System.Diagnostics.DiagnosticSource.dll" />
<FunctionsPreservedDependencies Include="System.Text.Json.dll" />
<FunctionsPreservedDependencies Include="System.Text.Encodings.Web.dll" /> Our tests are passing. Is there anything to be wary of? |
Workaround with FunctionsPreservedDependencies helps to run and start app but in my case not all activity traces (like http calls) are shown. |
From my experience, since the host and the function are on different versions of DiagnosticSource, the two operations do not get chained correctly. |
I am running into possibly a related issue... I am trying to deploy .NET 6.0 azure functions
My csproj only references 6.0.0 version! |
@alanwest @cijothomas any updates on this?
|
I work in OpenTelemetry, so cannot comment on any updates from Azure Functions. |
We will eventually bump-up DiagnosticSource when we move to .Net 8 for InProc. No ETA as of now. |
I don't fully follow what the correct workaround would now be.
The project is Azure Functions using net6 as target framework. What exactly is the recommended (temporary) fix? |
@Krumelur, what version of the OpenTelemetry library are you using? As far as I am aware, 1.3.2 is the latest that works with the Azure Function Host on .NET 6. Honestly, the easiest way to work around this is to transition your project to an isolated process Azure Function and then you can use whatever version of Otel that you want. |
yeah, you will not run into any of these issues with isolated. We just announced the support of .Net 8 in isolated. |
Worked for me in in-proc mode thanks man. @alanwest |
We have released .NET 8 support for InProc, which should help address some of the concerns - https://azure.microsoft.com/en-us/updates/v2/azure-functions-supports-net8-using-in-process-model. Recommendation is still to migrate to isolated model. |
When using the latest version of the OpenTelemetry NuGet package (currently 1.4.0-beta3) an in-process function fails to start because OTel has taken a dependency on System.Diagnostics.DiagnosticSource 7.0.0, and I'm guessing the Host runtime is on 6.0.0 and won't let the package assemblies overwrite its own assemblies?
Investigative information
Please provide the following:
Repro steps
Provide the steps required to reproduce the problem:
func
or deploy to AzurePackages:
Service setup:
Expected behavior
Function App should start.
Actual behavior
Function app fails to start.
Error alert in Portal:
Exception when running locally:
Known workarounds
Using
Isolated
works OK, but that's a sub-optimal solution.Related information
The current version of Azure.Monitor.OpenTelemetry.Exporter has a dependency on OpenTelemetry 1.4.0.
I appreciate that all the OTel 1.4 stuff is RC or beta right now, but it should go final soon and it would be good if Azure Functions supported it when it does.
The text was updated successfully, but these errors were encountered: