-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[receiver/k8seventsreceiver] Add more types to severity map #43402
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?
[receiver/k8seventsreceiver] Add more types to severity map #43402
Conversation
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better! |
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.
Thanks for the contribution!
Please read the contribution guide and follow the changelog instructions, there is a test that will fail.
Also, a couple of observations and questions
var severityMap = map[string]plog.SeverityNumber{ | ||
"normal": plog.SeverityNumberInfo, | ||
"warning": plog.SeverityNumberWarn, | ||
"error": plog.SeverityNumberError, |
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.
Is there any reason you're not just adding the new types here? I do agree that this implementation is preserving some more info but I'm not sure it s needed.
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.
Please elaborate on this. Are referring to adding other types https://github.com/open-telemetry/opentelemetry-collector/blob/main/pdata/plog/severity_number.go#L14-L38
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 was a bad use of words on my part. I meant just adding them there, without the rest of the logic (which is the state of the PR now)
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better! |
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.
just a small indentation issue
also please look into filling the changelog and change the issue title to include the component name.
lgtm otherwise
Please fill all the fields of the changelog file |
|
I am not able to build locally. Getting connection reset errors frequently. Would it be possible to run tests via github actions? make otelcontribcol
|
Please suggest next steps, would like to see this merged, so that we don't have to fork this repo for our customers. Thanks |
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'm fine with this addition. Could you add a unit test for these added levels?
Please review again, updated the unit tests. |
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 change looks good to me, however since these types are not officially supported by K8s I would like other code-owners to also approve this. My thought is that by mapping already error
and critical
is not that arbitrary even if that's not what K8s officially exposes.
@bogdan-st please review this again. Thanks |
@ChrsMark could you please approve GitHub actions workflow, would like to see all the required statuses are good. Thanks |
@dmitryax please see if you can review this. |
Description
Add more types to severity map.
k8s event api suggest more types can be added
https://github.com/kubernetes/api/blob/release-1.34/events/v1/types_swagger_doc_generated.go#L42
To support additional types, set the event type as is and if it is a known type set the SeverityNumber other wise set SeverityNumberUnspecified
Link to tracking issue
Fixes #43401
Testing
Documentation
Created change log with the following subtext:
k8seventsreceiver allows event types Error and Critical in addition to current Normal and Warning event types.