-
Notifications
You must be signed in to change notification settings - Fork 775
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
Auto Resource Implementation in dotnet similar to Java #2752
Comments
I can work on the feature as well |
@swetharavichandrancisco sounds good! The specification has a few words about resource detectors that my prove useful https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#detecting-resource-information-from-the-environment You might also take a look at the implementation for the resource detector for the |
@swetharavichandrancisco Yes, your contributions would be welcome! I think it would be great to additional resource detectors for things like Docker. I think the title of that section of the spec is misleading... it is not just about detection via environment variables, but more generally the environment the application is running in like Docker or a cloud vendor. It provides some guidance that you'll like need to take into account.
So, just as Java has separated out their resource detectors into a package, we'll likely need to do the same. If you're proposing to build both additional resource detectors and also an auto resource configuration mechanism like Java, I think it would be best to split up these efforts. |
Exposing this as public is likely all that we need :
|
Closing as this is completed in #2897 |
Purpose of the Feature Request:
Creation of Automatic Resource Attributes, especially looking to add container.id to resource metadata
Corresponding JAVA PR posted below,
Current Behavior in Java:
In Java, We have ResourceProvider Interface that are implemented in the below classes
All these Providers are read OOTB in OpenTelemetryResourceAutoConfiguration
and it is configured in the below file,
Current Behavior in DotNet:
In DotNet, We have ResourceBuilderExtensions class that adds Semantic Attributes with Dedicated Environment Variable/SDK-provided Default Value like service, opentelemetry SDK
From the customer application, we still have to call the respective api's for the resources to be added.
Below is the sample code,
var tracerProvider = Sdk.CreateTracerProviderBuilder() .SetResourceBuilder(ResourceBuilder.CreateEmpty().AddService("test")) .AddSource("Sample.DistributedTracing") .AddConsoleExporter() .Build()
Currently, there is no way to add Resources automatically.
Expected/Proposed Solution:
Can we have something similar to Java? Implement ResourceProviders in DotNet and ResourceBuilder class can pick all the ResourceProviders. We should also provide a way to configure ResourceProviders.
Thanks.
The text was updated successfully, but these errors were encountered: