-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Support IPVS metrics #4757
Comments
Sounds good. I don't have any experience with IPVS, so I have a couple questions:
|
The terminology is different depending on where you look. The golang libraries call them "Services" and "Destinations" , however the IPVS terminology is "Virtual Server" and "Real Server". A virtual server is configured to be backed by one or more real servers (that can actually handle the traffic). The virtual server is just a load balancer (the "VS" part of IPVS). The virtual server can be configured to load balance connections based on proto/addr/port/fwmark (addr+port being commonly used). These metrics are exposed via the kernel over a netlink interface. There is a pure-go library to deal with netlink sockets and parsing these messages here - http://github.com/mqliang/libipvs however I've forked it to add a |
I'll switch to using |
Looks like libipvs uses github.com/hkwi/nlgo for netlink. I know we have some other netlink work in progress, @fntlnz is this the same library your work is using? In phase 2 the sum of the values for the real servers would be equal to the value for the virtual server? Or perhaps only approximately due to network issues or unavailability? |
While there are other libraries that are available for manipulating Another promising one is github.com/google/seesaw/ipvs - but that uses a go interface to netlink that goes via the |
Yes, from my experimentation that seems to be the case but I wouldnt be surprised if it wasn't . They are being reported separately from the kernel. |
Yes, from what I can tell - |
I would use the same tags on the real_server as with virtual_server: protocol, address, port, fwmark. You could vary the measurement name to make it easier to aggregate across only real_servers or virtual_servers.
Or another way to do the same would be using tags:
We are starting to standardize on using the |
Updated the Feature Request comment to reflect the updated proposal (naming scheme of the metrics). |
Here is a similar name scheme, but first some background... Typically a single
Here, the first line (with the prefix TCP) indicates that this is a section for a virtual server, and the lines that follow are its real servers. Now, a virtual server is defined by one of
So in the above pasted output we can tell that the virtual server is using
... or ...
In the example above, we see that When we're tracking the virtual_server metrics, we're really tracking the metrics for only the first line (in each of the above examples). So, with this as background , a virtual servers metrics (when using
Or when using
Since these 2 schemes are mutually exclusive, this plugin will emit one of the above. We can discuss the So for the case of virtual_servers, does the above proposal resonate? |
Sounds good, in line protocol it would look something like:
I see now that we need the additional tags to tie the real server to the virtual server, I would probably split out the tags though:
On the netlink side, @fntlnz let me know he is using github.com/vishvananda/netlink. Ideally, we would share underlying libraries between plugins so we don't need multiple dependencies. I also don't see much activity on the github.com/hkwi/nlgo side. |
Yes, I think we're in agreement on the line protocol format.
Let me poke around and see how easy it is to get IPVS support using that ( On a related note, I docs to be lacking on the following topics:
|
IPVS is becoming popular for use with kube proxy, so adding k8s tag. |
I'll update the docs with answers to your questions, but the short answer is you should use a struct tag for each field instead of relying on the default camelcase conversion:
For errors fatal to the gather attempt return an error out of Gather, if the gather should continue use:
You can use |
@danielnelson can we take on the lib change as a "Phase 3" item? I'd like to proceed using the existing library (which is pure-go, so not a burning issue, imo) . Later we can switch to using the |
PR #4792 |
The items under phase 1 above are completed for 1.9.0. |
Closing, all items completed. |
@danielnelson are there specific tests to run for this plugin during the RC phase of |
If you could just double check everything is working on a system with IPVS when the RC is release that is probably all that is needed. |
Feature Request
I'd like to implement an input plugin for reporting IPVS metrics (for "virtual_server" and "real_server").
Proposal:
Proposal is to add this in phases.
Phase 1
Add metrics to track "virtual_services". They are namespaced under "virtual_server" so that we can disinguish between them and the "real_server" metrics (see phase 2).
These are the readily available metrics:
virtual_server.connections
)virtual_server.pkts_in
)virtual_server.pkts_out
)virtual_server.bytes_in
)virtual_server.bytes_out
)virtual_server.cps
)virtual_server.pps_in
)virtual_server.pps_out
)virtual_server.bps_in
)virtual_server.bps_out
)Each metric has the following tags:
address
protocol
port
fwmark
(if it is non zero)Phase 2
Add metrics to track each of the above metrics, except this time for each "real_server" that backs each of the above "virtual_server"
Each "destination"s metrics will need to contain an additional tag that indicates which "service" it was backing. For this we add
service
: concat(protocol
,address
,port
,fwmark
) with some separator (-
)Use case: [Why is this important (helps with prioritizing requests)]
Help monitoring linux virtual servers.
The text was updated successfully, but these errors were encountered: