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

Passing instrumentation library name and version information to exporters starting .NET7.0 #3445

Closed
vishweshbankwar opened this issue Jul 13, 2022 · 7 comments
Labels
enhancement New feature or request Stale Issues and pull requests which have been flagged for closing due to inactivity

Comments

@vishweshbankwar
Copy link
Member

vishweshbankwar commented Jul 13, 2022

Starting .NET7.0 ASP.NET Core and HttpClient libraries will create activities using ActivitySource. However, utilizing this feature will result in loss of information about the instrumentation library and version on the ActivitySource of exported activities as that is currently being done in instrumentation library ASP.NET Core and HttpClient. We will need a mechanism to send the instrumentation library and version information to exporter.

Opening this issue for discussing alternatives/solutions.

@CodeBlanch
Copy link
Member

@vishweshbankwar I'm not totally following.

.NET7 Activity (AspNetCore) should be started through a source:

https://github.com/dotnet/aspnetcore/blob/bf3352f2422bf16fa3ca49021f0e31961ce525eb/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs#L327-L342

What will happen in that case is Activity.Source will be set automatically:

https://github.com/dotnet/runtime/blob/28c56feae2f80231a30e4942f339b5b2f1c20062/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs#L1078

So these spans should always have Source.Name available but may be missing Source.Version. Is that what you meant?

@vishweshbankwar
Copy link
Member Author

@CodeBlanch - Currently, we attach ActivitySource to the activity in instrumentation library. The name and version on ActivitySource matches the name and version of instrumentation library as per spec. However, in .NET7.0 onwards we will not continue to do so and the ActivitySource information on activities updated by instrumentation library will not have any information about them.

@alanwest also brought up a point about schema_url which we will need to think about on how we will handle that in .NET.

Have updated the issue to clarify further.

@cijothomas
Copy link
Member

Since HttpClient creates the activity, their name will appear as the name and version.
OTel instrumentation library "enriches" it.
Users can further enrich it..
Collector can enrich more...

@alanwest
Copy link
Member

Since HttpClient creates the activity, their name will appear as the name and version.
OTel instrumentation library "enriches" it.

I'd characterize the OTel instrumentation as more than just "enriching" it. It's the component that conforms the activity with the HTTP semantic conventions. From this standpoint, it's the name, version, and ultimately schema url provided by the instrumentation library that is more interesting. Albeit maybe not very interesting yet today.

In the long run, my understanding is that the schema url will enable backends to translate between different schema versions. Of course, without a stable schema this issue is not exactly pressing today.

The reason I think we should keep this issue open is that we should consider how we plan to support schema url if it will always be the instrumentation libraries from this repo that control the schema used.

@cijothomas
Copy link
Member

Yea I agree this is an issue. If a user changes some of the tags themselves, then the "schema_url" could no longer be valid. So anyone modifying a span, should be allowed to update the schema_url/name/version ?

Copy link
Contributor

This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label Sep 25, 2024
Copy link
Contributor

github-actions bot commented Oct 3, 2024

Closed as inactive. Feel free to reopen if this issue is still a concern.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale Issues and pull requests which have been flagged for closing due to inactivity
Projects
None yet
Development

No branches or pull requests

4 participants