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

Concerns of FunctionsPreservedDependencies #9161

Closed
SuyliuMS opened this issue Mar 17, 2023 · 3 comments
Closed

Concerns of FunctionsPreservedDependencies #9161

SuyliuMS opened this issue Mar 17, 2023 · 3 comments

Comments

@SuyliuMS
Copy link

Is your question related to a specific version? If so, please specify:

No

What language does your question apply to? (e.g. C#, JavaScript, Java, All)

C#

Question

We are going to use OpenTelemetry 1.4.0 in our function, but OpenTelemetry has a dependency to System.Diagnostics.DiagnosticSource and it will throw a exception when trigger functions:
FileLoadException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=7.0.0.0

However we can add FunctionsPreservedDependencies element to .csproj file to fix this error:

  <ItemGroup>
    <FunctionsPreservedDependencies Include="System.Diagnostics.DiagnosticSource.dll" />
  </ItemGroup>

Will System.Diagnostics.DiagnosticSource.dll in FunctionsPreservedDependencies affect function behaviors?

We are basically wondering what would be the impact for preserving our own dependency version for dlls also used by the function host and if it’s ok to preserve the System.Diagnostics.DiagnosticSource. We are on dedicated plan and we don’t use AppInsight – all of our instrumentations are Geneva based.

@ghost ghost assigned kshyju Mar 17, 2023
@RohitRanjanMS
Copy link
Member

Tagging @brettsam and @fabiocav

@fabiocav
Copy link
Member

@SuyliuMS that specific dependency is unified as types defined there flow from the host and the Function (there's type exchange between the two contexts), with the most important one being Activity.

You have the ability to load your own version using the configuration above, but that would be scoped to your Function only. This is useful in a set of scenarios (and why the configuration exists), but will cause problems if you're relying on the instances of those types flowing from the host.

@ghost
Copy link

ghost commented Mar 24, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

If you are not the original author (SuyliuMS) and believe this issue is not stale, please comment with /bot not-stale and I will not close it.

@ghost ghost closed this as completed Mar 27, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 26, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants