-
Notifications
You must be signed in to change notification settings - Fork 790
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
Default Resource should have service.name attribute #1744
Changes from 8 commits
4517454
493a855
e5a5c91
7144e11
aa9cfb6
86f9ffa
6cef7fd
bc22109
c0866b1
ebad31c
589499a
f76f9a1
667f3dc
eb72c99
dc5f09b
58f9e09
f985843
12225c1
429a031
7e0be45
d8d0d53
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,12 @@ public static class ResourceBuilderExtensions | |
{ | ||
private static readonly Version Version = typeof(Resource).Assembly.GetName().Version; | ||
|
||
private static Resource DefaultResource { get; } = new Resource(new Dictionary<string, object> | ||
{ | ||
[ResourceSemanticConventions.AttributeServiceName] = "unknown_service:" | ||
+ (string.IsNullOrWhiteSpace(System.Diagnostics.Process.GetCurrentProcess().ProcessName) ? System.Diagnostics.Process.GetCurrentProcess().ProcessName : string.Empty), | ||
}); | ||
|
||
private static Resource TelemetryResource { get; } = new Resource(new Dictionary<string, object> | ||
{ | ||
[ResourceSemanticConventions.AttributeTelemetrySdkName] = "opentelemetry", | ||
|
@@ -89,7 +95,20 @@ public static ResourceBuilder AddService( | |
/// <summary> | ||
/// Adds service information to a <see cref="ResourceBuilder"/> | ||
/// following <a | ||
/// href="https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/resource/semantic_conventions#telemetry-sdk">semantic | ||
/// href="https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions#service">semantic | ||
/// conventions</a>. | ||
/// </summary> | ||
/// <param name="resourceBuilder"><see cref="ResourceBuilder"/>.</param> | ||
/// <returns>Returns <see cref="ResourceBuilder"/> for chaining.</returns> | ||
public static ResourceBuilder AddDefault(this ResourceBuilder resourceBuilder) | ||
Austin-Tan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
return resourceBuilder.AddResource(DefaultResource); | ||
} | ||
|
||
/// <summary> | ||
/// Adds service information to a <see cref="ResourceBuilder"/> | ||
/// following <a | ||
/// href="https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions#telemetry-sdk">semantic | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this change is incorrect. the branch was named to "main" last week. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed this, but when I use .../master/... the link doesn't properly direct to the right part of the page. /main/ will show the warning but also direct to the right section of the page. |
||
/// conventions</a>. | ||
/// </summary> | ||
/// <param name="resourceBuilder"><see cref="ResourceBuilder"/>.</param> | ||
|
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.
I think a simple one liner like this is sufficient for changelog: Default resource will now contain service.name instead of telemetrysdk.
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.
Fixed. Also the line above it, issue #1501 redirects to PR #1655. is this intended?