-
Notifications
You must be signed in to change notification settings - Fork 292
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
Removing automatic service name from Lambda instrumentation #1080
Merged
Kielek
merged 14 commits into
open-telemetry:main
from
ehornby:awsLambdaWrapper_addServiceNameOverride
Mar 22, 2023
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
bb7b7a0
adding override to instrumentation options
ehornby f87fec2
Merge branch 'main' into awsLambdaWrapper_addServiceNameOverride
ehornby 08301e6
Merge branch 'main' into awsLambdaWrapper_addServiceNameOverride
ehornby e8cd93a
Merge branch 'main' into awsLambdaWrapper_addServiceNameOverride
ehornby 2766f02
Merge branch 'main' into awsLambdaWrapper_addServiceNameOverride
ehornby 44c9ad6
rolling back initial changes
ehornby 8efc1e4
Merge branch 'awsLambdaWrapper_addServiceNameOverride' of https://git…
ehornby 489ab0e
Merge branch 'main' into awsLambdaWrapper_addServiceNameOverride
ehornby 0a8dd4d
updating changelog
ehornby 6a6e23c
Merge branch 'awsLambdaWrapper_addServiceNameOverride' of https://git…
ehornby b099a75
Update src/OpenTelemetry.Instrumentation.AWSLambda/CHANGELOG.md
ehornby 8ca03ca
remove trailing space
ehornby ad6af5e
remove trailing space
ehornby 2df4446
Merge branch 'main' into awsLambdaWrapper_addServiceNameOverride
ehornby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think this is necessary or even very useful: Using the new
ConfigureResource
API introduced in open-telemetry/opentelemetry-dotnet#2909 + open-telemetry/opentelemetry-dotnet#3307, one can override the service more easily already.But: It would be good if this call here could also be changed to use
ConfigureResource
instead ofSetResourceBuilder
, so it does not reset any other resources set before it. This is only tangentially related though and not a prerequisite for overriding the service afterwards.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.
@Oberon00 Completely agree - there are fine existing ways to override the service name as is, I'm currently using the
ConfigureResource
API in existing implementations.Where I saw value here was in the lack of clarity that such an override is necessary in the first place, if one required their service name to differ from the Lambda function name. Documentation indicates that setting the
OTEL_SERVICE_NAME
environment variable (or injecting attributes viaOTEL_RESOURCE_ATTRIBUTES
) should set theservice.name
attribute as desired, but that didn't seem to be what happened in practice.I didn't find it immediately clear anywhere that behavior is different with Lambdas using this package, so this change wasn't intended to add functionality so much as just clarity.
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.
This is currently still in beta, so we may break things if we find we need to. I think that this overrides an explicitly set OTEL_SERVICE_NAME is a bug. IMHO, it would be good to completely remove setting the service name here, and we can maybe later add it back under a dedicated off-by-default option (or even just provide an API that returns the function name for users to set as service name themselves)
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 certainly seems more like a bug than intended behaviour, for sure.
I'm happy to repurpose this PR to remove the functionality that sets the service name, if you'd like?
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 that would be a better solution for the problem you describe. Thank you!