Open DanDanN00dle opened 2 years ago
I think this issue is caused by setting a new ResourceBuilder instead of modifying the existing one:
builder.SetResourceBuilder(ResourceBuilder
.CreateEmpty()
.AddTelemetrySdk()
.AddAttributes(AWSLambdaResourceDetector.Detect()));
We can bypass by adding this line after .AddAWSLambdaConfigurations()
, though I'm unsure whether there's other side effects from the original Sdk builder (it's a TracerProviderServiceCollectionBuilder instead of a plain ResourceBuilder, for starters):
.ConfigureResource((resource) => resource.AddEnvironmentVariableDetector())
Should AddAWSLambdaConfigurations
ConfigureResource as well?
I think this issue is why I originally created https://github.com/open-telemetry/opentelemetry-dotnet/issues/2909 PRs to switch the instrumentation to use this are welcome (an OTel upgrade might be necessary)
Issue with OpenTelemetry.Contrib.Instrumentation.AWSLambda
Using:
On runtime net6.0
Is this a feature request or a bug?
What is the expected behavior?
When setting the environment variable
OTEL_RESOURCE_ATTRIBUTES
for the lambda I expect to be able to add additional resource attributes to my lambda (per the specificaton).What is the actual behavior?
The resource does not have the additional attributes specified in the environment variable.
See test case.