-
Notifications
You must be signed in to change notification settings - Fork 438
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 Ability to Override Service Names #939
base: main
Are you sure you want to change the base?
Add Ability to Override Service Names #939
Conversation
Signed-off-by: blakeromano-il <[email protected]>
|
I think some documentation update would help to make this annotation visible to the community :) |
Signed-off-by: blakeromano-il <[email protected]>
I just added some documentation in the readme about this 👍 @mat-rumian |
Is there anything else that is needed to get this approved? @mat-rumian |
I think @pavolloffay is the right person to ask :) |
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.
The feature makes sens, but I would like to see a e2e test for this capability
@pavolloffay I made the changes you suggested. I am not super familiar with kuttl but if you feel like e2e tests are needed for this I can do my best to write one up. |
pkg/instrumentation/sdk.go
Outdated
@@ -208,6 +208,10 @@ func (i *sdkInjector) injectCommonSDKConfig(ctx context.Context, otelinst v1alph | |||
} | |||
|
|||
func chooseServiceName(pod corev1.Pod, resources map[string]string, index int) string { | |||
serviceNames := strings.Split(pod.Annotations["instrumentation.opentelemetry.io/service-name"], ",") |
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.
extract the annotation to a constant
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 is it doing the split?
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 did the split in the case of people with multiple containers. for you to be able to override the different container names
kuttl is super easy. This functionality deserves e2e tests. Let me know if you have any question about the e2e tests, I can help. |
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, just one comment on a corner case that I didn't catch before.
metadata: | ||
name: java | ||
spec: | ||
env: |
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.
somebody can define OTEL_SERVICE_NAME here. What is the precedence order of setting the service name? We should document this in the readme and have a test.
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 honestly am not crazy sure on these answers. If you don't mind helping me fill the gaps @pavolloffay
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.
@blakeromano, I'm going to check what is missing to help you out.
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.
@yuriolisa I apologize been busy I was wondering if you had time to help me out 😸
@blakeromano i think this is going to be superseded by #2330 are you interested in continuing this work? |
Resolves #938