-
Notifications
You must be signed in to change notification settings - Fork 773
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
Add support for OTEL_SERVICE_NAME environmental variable #2209
Conversation
/// Adds resource attributes parsed from an environment variable to a | ||
/// <see cref="ResourceBuilder"/> following the <a | ||
/// Adds resource attributes parsed from OTEL_RESOURCE_ATTRIBUTES, OTEL_SERVICE_NAME environment variables | ||
/// to a <see cref="ResourceBuilder"/> following the <a | ||
/// href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#specifying-resource-information-via-an-environment-variable">Resource | ||
/// SDK</a>. | ||
/// </summary> | ||
/// <param name="resourceBuilder"><see cref="ResourceBuilder"/>.</param> | ||
/// <returns>Returns <see cref="ResourceBuilder"/> for chaining.</returns> | ||
public static ResourceBuilder AddEnvironmentVariableDetector(this ResourceBuilder resourceBuilder) |
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.
Couldn't this detector be out-of-the-box? This is what other languages do.
For sure something for a separate PR and maybe even needs some GH Issue for discussion.
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.
+1 on making this out-of-the-box
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 will make a separate PR to address it
Codecov Report
@@ Coverage Diff @@
## main #2209 +/- ##
==========================================
- Coverage 80.17% 80.14% -0.03%
==========================================
Files 226 227 +1
Lines 7161 7173 +12
==========================================
+ Hits 5741 5749 +8
- Misses 1420 1424 +4
|
* [Instrumentation](#instrumentation) | ||
* [Processor](#processor) | ||
* [Resource](#resource) | ||
* [Sampler](#sampler) | ||
* [Advanced topics](#advanced-topics) | ||
* [Propagators](#propagators) | ||
* [Troubleshooting](#troubleshooting) | ||
* [Configuration Parameters](#configuration-parameters) | ||
* [Remarks](#remarks) |
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.
Both Configuration Parameters
and Remarks
seem to be too detailed and generic for the ToC. Perhaps we want to remove the H3 (e.g. replace ### Remarks
with **Remarks:**
).
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.
@open-telemetry/dotnet-maintainers WDYT - should I change it?
BTW I think that the Propagators
section should be under Tracing configuration
- and not under Advanced topics
.
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 will make a separate PR for it as I did not get feedback on what is the preference
Co-authored-by: Reiley Yang <reyang@microsoft.com>
Flaky test:
|
Co-authored-by: Paulo Janotti <pjanotti@splunk.com>
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.
LGTM
Any idea why EasyCLA is not being triggered? |
no! same issue with another PR also |
46ac66f
to
e0a9aa4
Compare
@cijothomas EasyCLA is working |
@open-telemetry/dotnet-maintainers PTAL |
Partially addresses #1453.
This feature is important so that we can reuse the SDK in https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation.
Changes
ResourceBuilder.AddEnvironmentVariableDetector
handlesOTEL_SERVICE_NAME
environmental variable.
TODO