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

using opentelemetry.io* namespace for extracing resource and attribute labels from k8s Api #2330

Closed
wants to merge 0 commits into from

Conversation

Horiodino
Copy link
Contributor

Description:
i have added recognizeUserDefinedValues() that will recognize the pods with pentelemetry.io/ prefix
#2181

Testing: i haven't tested it yet , im not sure is it right so please tell any changes to made

@Horiodino Horiodino requested a review from a team November 9, 2023 07:45
Copy link

linux-foundation-easycla bot commented Nov 9, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

return true, err
}
if err != nil {
return false, err
Copy link
Member

Choose a reason for hiding this comment

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

It looks like this line is not reachable

Copy link
Contributor

@jaronoff97 jaronoff97 left a comment

Choose a reason for hiding this comment

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

@Horiodino looks like some import failures. Also, please sign the CLA when you get a chance :)

@Horiodino Horiodino closed this Nov 15, 2023
Horiodino added a commit to Horiodino/opentelemetry-operator that referenced this pull request Nov 15, 2023
@Horiodino Horiodino reopened this Nov 15, 2023
@@ -402,6 +402,54 @@ func chooseServiceVersion(pod corev1.Pod, index int) string {
return tag
}

// create/reserve namespace

func (i *sdkInjector) createReservedNamespace(ctx context.Context) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need to create a namespace here?

}

// recognizeUserDefinedValues recognizes user defined values assigned with opentelemetry.io/ prefix
func (i *sdkInjector) recognizeUserDefinedValues(ctx context.Context, ns corev1.Namespace, pod corev1.Pod, deployment appsv1.Deployment, index int) map[string]string {
Copy link
Contributor

@jaronoff97 jaronoff97 Jan 12, 2024

Choose a reason for hiding this comment

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

could you add some tests in? and make it so that this function is used as part of the injection process

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok 👍

@Horiodino
Copy link
Contributor Author

Horiodino commented Jan 29, 2024

@jaronoff97 @frzifus i have implemented it for mostly all resources, like pod , deply,statefulset, replicas etc..., but what i have done is i created a one main function that returns all info in map but the thing is in function arguments i need k8s client , should i separate create all functions for all resources ?
op : [pod/default = grafana-68dcc6497d-zs6f4] [deployment/default = grafana]

Copy link
Contributor

@jaronoff97 jaronoff97 left a comment

Choose a reason for hiding this comment

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

@Horiodino per my last comment (link) there is no need to reach out to the kube API for any of this. Further, you're not using the functions you wrote and they are currently untested. If you'd like, I'd be happy to pair with you on this PR and we can work through it together.

@Horiodino
Copy link
Contributor Author

@Horiodino per my last comment (link) there is no need to reach out to the kube API for any of this. Further, you're not using the functions you wrote and they are currently untested. If you'd like, I'd be happy to pair with you on this PR and we can work through it together.

sure ✨

@jaronoff97
Copy link
Contributor

feel free to reach out via the CNCF slack and we can set up some time

@jaronoff97
Copy link
Contributor

@Horiodino would you be able to fix the merge conflicts, fix the unit tests, and add a changelog? I would love to get this merged in, it's looking pretty good!

@jaronoff97
Copy link
Contributor

@Horiodino bump on this, I'd love to get this in.

@Horiodino
Copy link
Contributor Author

Horiodino commented Jun 4, 2024

sorry for taking long , tried testing but that failed due to my system (previously using 32),
i fixed it now, i have added the changes now i will bw creating a new branch and add the changes there other wise it will be mess as main has conflicts.

@Horiodino
Copy link
Contributor Author

hey @jaronoff97 #3010

jaronoff97 pushed a commit that referenced this pull request Aug 7, 2024
…notations from k8s Api #2330  (#3010)

* using opentelemetry.io* namespace for extracing resource

Signed-off-by: Horiodino <[email protected]>

* refactor ReservedNamespace to OtelAnnotationNamespace

Signed-off-by: Horiodino <[email protected]>

* added changelog

Signed-off-by: Horiodino <[email protected]>

* Updated README: using opentelemetry.io* namespace for extracting resource

Signed-off-by: Horiodino <[email protected]>

* Update README.md

Co-authored-by: Mikołaj Świątek <[email protected]>

* Update README.md

Co-authored-by: Mikołaj Świątek <[email protected]>

---------

Signed-off-by: Horiodino <[email protected]>
Co-authored-by: Mikołaj Świątek <[email protected]>
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.

3 participants