-
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
Expose the IPVS firewall mark as a label #764
Conversation
It would be good to have a working example in the fixtures. |
Agree, in general this looks useful. Thanks! But yeah some fixtures would be great! |
I've added the new fixtures to include a use case with fw marks support. Let me know if there's anything else required. |
After reading over the IPVS procfs code, and trying to understand the IPVS documentation a bit, I'm not sure this is what we need to do to handle this. |
@SuperQ what do you mean exactly? The changes to collector/fixtures/proc/net/ip_vs are based on what was added in https://github.com/prometheus/procfs/pull/48/files and also on a real example I got from our infrastructure ipvsadm output
proc output
The node_exporter built from this branch
Am I missing anything? |
What I'm thinking is that it doesn't seem like the local marks have any association with a local address. Maybe it would be easier to simply map the mark label into the address label? |
The way I understand it is that those are two different things. In TCP/UDP you have a local address which maps to an IP:PORT combo (or just a single IP). When defining a fwmark service, the concept of local address doesn't exist, you just configure an integer to identify which fwmark to use. It might seem a bit a weird to re-use the local_address field for something entirely different. |
Yes, it's tricky. One option is we make these a new metric with different labeling. For sure, one thing we need to fix is to map the |
I agree with fixing the As for the new metric, I'm not entirely sure it would make sense to have a new metric, it is in fact the same metric :), perhaps renaming the label from |
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.
Since it's still tracked as active connection, using the same metric is fine IMO. I also think it's okay to have localDress be empty for these cases, I'd say this isn't that uncommon.
Fixing the in procfs would be nice but IMO no need to block this merge.
Thanks @discordianfish! I'm glad we can get this merged. |
@SuperQ You're okay with merging this now? |
🙏 I'd like to have this merged |
@SuperQ We should decide what to do here. I'm happy to leave this final say in this to you but we should decide something :) |
Yes, sorry, I've been distracted. This PR still needs to fix the |
node_ipvs_backend_connections_active{local_address="192.168.0.57",local_mark="",local_port="3306",proto="TCP",remote_address="192.168.50.21",remote_port="3306"} 1498 | ||
node_ipvs_backend_connections_active{local_address="192.168.0.57",local_mark="",local_port="3306",proto="TCP",remote_address="192.168.82.21",remote_port="3306"} 1499 | ||
node_ipvs_backend_connections_active{local_address="192.168.0.57",local_mark="",local_port="3306",proto="TCP",remote_address="192.168.84.22",remote_port="3306"} 0 | ||
node_ipvs_backend_connections_active{local_address="<nil>",local_mark="10001000",local_port="0",proto="FWM",remote_address="192.168.49.32",remote_port="3306"} 321 |
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.
This needs to be local_address=""
, not <nil>
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 willing to address this issue, but I believe procfs
returns net.IP
instance, and this package is invoking .String()
method which returns <nil>
. If it's okay I can do another PR that will mitigate this issue in current package? Thanks!
@dsolsona Can you fix this? I think then we can merge this. |
Yes, I think we just need to fix up the labeling issue, and it'll be fine. |
I'm going to close this for now due to lack of activity. Feel free to re-open again once y ou revive this. |
When using IVPS with firewall marks it is interesting to know to which virtual service a backend belongs.
This PR exposes the firewall mark as a label. I've tested this in my local prometheus setup and works as expected. I haven't tested this in a non fwmark setup but the tests cover that use case.
@SuperQ @discordianfish