-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[cmd/telemetrygen] Add Support for specifying Log Severity #30990
[cmd/telemetrygen] Add Support for specifying Log Severity #30990
Conversation
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
73ee303
to
9fbb318
Compare
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
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.
Apologies for the delay, I was out last week. This looks better, but I think we need to return errors when things are invalid, not use defaults
@@ -82,3 +86,42 @@ func Run(c *Config, exp exporter, logger *zap.Logger) error { | |||
wg.Wait() | |||
return nil | |||
} | |||
|
|||
func parseSeverity(severityText string, severityNumber int32) (string, plog.SeverityNumber) { |
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.
Instead of using the default when invalid data is present, we should return an error.
For example, if severityNumber
is outside of the valid range, we should return an error that says that the valid range is [1,24].
We may need to take care of the default case separately, but otherwise we shouldn't ignore what the user set, we should instead tell them that it is invalid.
…Severity' into _Add_Support_for_specifying_Log_Severity
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
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 bearing with me, LGTM! 🚀
resolve #26498