-
Notifications
You must be signed in to change notification settings - Fork 358
Implement AWS Lambda detector #3411
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
base: main
Are you sure you want to change the base?
Implement AWS Lambda detector #3411
Conversation
d2715a0 to
9954d3c
Compare
Signed-off-by: AzharH <azhar.hosenbocus@outlook.com>
9954d3c to
a00874c
Compare
test/OpenTelemetry.Instrumentation.AWSLambda.Tests/AWSLambdaResourceBuilderExtensionsTests.cs
Outdated
Show resolved
Hide resolved
# Conflicts: # src/OpenTelemetry.Instrumentation.AWSLambda/CHANGELOG.md
|
hey @martincostello |
| /// <param name="builder">The <see cref="ResourceBuilder"/> being configured.</param> | ||
| /// <param name="configure">Optional callback action for configuring <see cref="AWSLambdaInstrumentationOptions"/>.</param> | ||
| /// <returns>The instance of <see cref="ResourceBuilder"/> being configured.</returns> | ||
| public static ResourceBuilder AddAWSLambdaDetector(this ResourceBuilder builder, Action<AWSLambdaInstrumentationOptions>? configure = null) |
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.
What happens if this is called when also adding the resource detector implicitly via the instrumentation (
Line 46 in 55aa86e
| builder.ConfigureResource(x => x.AddDetector(new AWSLambdaResourceDetector(awsSemanticConventions))); |
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.
Its a valid point.
However just enhancing TracerProviderBuilderExtensions.AddAWSLambdaConfigurations to add only resource detection will not work in that case because the extension is exposed on TracerProviderBuilder. Resource detectors should be allowed to be added for logs and metrics too (similar to the other resource detectors) and be exposed on ResourceBuilder instead.
I enhanced the XML docs to make it easier to understand how the 2 extensions are expected to be used, should make it clearer to avoid double resource detection.
Let me know what you think.
|
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
|
@normj, @lukeina2z , @Oberon00, @rypdal |
src/OpenTelemetry.Instrumentation.AWSLambda/TracerProviderBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
| /// <param name="builder">The <see cref="ResourceBuilder"/> being configured.</param> | ||
| /// <param name="configure">Optional callback action for configuring <see cref="AWSLambdaInstrumentationOptions"/>.</param> | ||
| /// <returns>The instance of <see cref="ResourceBuilder"/> being configured.</returns> | ||
| public static ResourceBuilder AddAWSLambdaDetector(this ResourceBuilder builder, Action<AWSLambdaInstrumentationOptions>? configure = null) |
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.
Does it make sense to accept AWSLambdaInstrumentationOptions here? The detector is not an instrumentation, and indeed it seems like all options except SemanticConventionVersion are ignored.
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.
Was mostly trying to keep it close to the other detectors extensions. but its a valid point - removed the AWSLambdaInstrumentationOptions to use the default semantic convention version
Would appreciate another review please
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.
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.
Why not accept (just) the semantic convention version as parameter?
…derExtensions.cs Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
…b.com/AzharH/opentelemetry-dotnet-contrib into feature/implement-aws-lambda-detector
Oberon00
left a comment
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.
It seems OK to me and I definitely see the use case, but I can't really review conformance to usual OTel best practices, would appreciate it if someone else could also take a look at the API.
Implement AWS Lambda detector
Discussion issue
Changes
Exposed the
AWSLambdaResourceDetector.Detectover theResourceBuilderto allow enriching logs/traces/metrics with AWS Lambda specific attributesMerge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes