Skip to content
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

[GEN-1738] Add service name to instrumentation config #1830

Open
wants to merge 233 commits into
base: main
Choose a base branch
from

Conversation

alonkeyval
Copy link
Collaborator

This pull request introduces changes to support the identification and management of service names in telemetry data. The most important changes include the addition of the serviceName attribute in various configurations and the implementation of logic to resolve and update service names based on workload annotations.

Enhancements to Telemetry Data Management:

Updates to Controllers:

Testing Updates:

New Workload Reconciler:

Copy link

… github.com:alonkeyval/odigos into gen-1738-add-service-name-to-instrumentation-config
Comment on lines +193 to +201
func ExtractServiceNameFromAnnotations(annotations map[string]string, defaultName string) string {
if annotations == nil {
return defaultName
}
if reportedName, exists := annotations[consts.OdigosReportedNameAnnotation]; exists && reportedName != "" {
return reportedName
}
return defaultName
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember @blumamir had a code for generating the service name based on the container name as well - to avoid conflicting service names. Do we need to handle this here?

return defaultName
}
if reportedName, exists := annotations[consts.OdigosReportedNameAnnotation]; exists && reportedName != "" {
return reportedName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to perform some validation on this user-provided value?

Also, the fallbacks defined by OTel: https://opentelemetry.io/docs/specs/semconv/resource/#service

We can say that we'll handle this in the lower layers reading the service name from the config - I'm not sure what it the best approach.

k8sutils/pkg/workload/workload.go Outdated Show resolved Hide resolved

}

func createOrUpdateInstrumentationConfig(ctx context.Context, k8sClient client.Client, instConfigName, namespace string, serviceName string) (reconcile.Result, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no create only update

Copy link
Collaborator

@blumamir blumamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@alonkeyval alonkeyval enabled auto-merge (squash) November 26, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants