-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add encode implementations for SocketAddr and IpAddr #87
base: master
Are you sure you want to change the base?
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.
In general I am not opposed to this change. Though I would guess that in most cases, this is not what one wants. In case the number of unique IP addresses is large, this can easily lead to a cardinality explosion.
https://www.robustperception.io/cardinality-is-key/
What do you think of adding a warning doc comment to the implementations to make sure users are aware of what they are doing?
Also would you mind resolving the merge conflicts?
Friendly ping @rnijveld. |
c8d94d6
to
cbd2ba2
Compare
cbd2ba2
to
f8caf41
Compare
@mxinden Sorry about the slow response, life got in the way a little. I definitely agree with not wanting to use this for high cardinality situations. Although of course such cases could happen just as easily with other label types, I do agree that IP addresses might more quickly result in a cardinality explosion when not used correctly. I've added a little warning text to each of the implementations, I hope that resolves your concerns, let me know if there's anything else I can do! |
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.
Sorry for the delay here.
Thanks for adding the warning. One confusion on my end.
/// distinct values is low (i.e. low cardinality). In all other cases you should | ||
/// combine your metrics into a single metric instead. Especially bad examples |
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.
In all other cases you should combine your metrics into a single metric instead.
I don't understand this. How is combining multiple metrics into one solving the issue of a cardinality explosion?
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.
Ah, as in dropping the label?
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.
Friendly ping @rnijveld. I would like to get this merged into master
.
/// distinct values is low (i.e. low cardinality). In all other cases you should | ||
/// combine your metrics into a single metric instead. Especially bad examples |
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.
Ah, as in dropping the label?
It is effectively never appropriate to use an address as a label, for reasons of cardinality already discussed. |
I don't think "never" is correct. One use-case I can come up with is exposing ones listening address as an info metric. See e.g. kubernetes/kube-state-metrics#498 as an example on how far one can push cardinality in Prometheus with info metrics. |
Something I encounter quite often is having metrics based on connection information, so I frequently find myself wanting to use either a
SocketAddr
orIpAddr
in a label.