-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix(outputs.nebius_cloud_monitoring): replace reserved label names #13597
Conversation
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.
Hi!
Thanks for the quick fix. Can you also please add a section to the plugin README called "Reserved Labels" and explain that tags with the key "name" are renamed.
One question inline as well about what this ultimately looks like in Nebius.
plugins/outputs/nebius_cloud_monitoring/nebius_cloud_monitoring.go
Outdated
Show resolved
Hide resolved
plugins/outputs/nebius_cloud_monitoring/nebius_cloud_monitoring.go
Outdated
Show resolved
Hide resolved
plugins/outputs/nebius_cloud_monitoring/nebius_cloud_monitoring.go
Outdated
Show resolved
Hide resolved
plugins/outputs/nebius_cloud_monitoring/nebius_cloud_monitoring_test.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
plugins/outputs/nebius_cloud_monitoring/nebius_cloud_monitoring_test.go
Outdated
Show resolved
Hide resolved
require.NoError(t, err) | ||
require.Len(t, message.Metrics, 1) | ||
require.Equal(t, "cluster_value", message.Metrics[0].Name) | ||
require.Equal(t, "accounts-daemon.service", message.Metrics[0].Labels["_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.
Shouldn't the check better be if _name
label exists?
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.
That's what is done, isn't it?
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.
No, as it now will panic or error out if message.Metrics[0].Labels
doesn't have an item called _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.
Yeah, that's right. We need panic if input has name label, but there is no _name in tt.got. Am I correct?
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.
No we don't want that, we want the test to fail, not to crash.
So the test should include something like:
require.Contains(t, message.Metrics[0].Labels, "_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.
@abrekhov thanks for the fix! I do have some minor comments...
plugins/outputs/nebius_cloud_monitoring/nebius_cloud_monitoring_test.go
Outdated
Show resolved
Hide resolved
plugins/outputs/nebius_cloud_monitoring/nebius_cloud_monitoring_test.go
Outdated
Show resolved
Hide resolved
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
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.
Looks good to me. Thanks for the fix @abrekhov!
Required for all PRs
resolves #13596