Skip to content
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 addresses for interfaces #415

Open
JJinMaine opened this issue Oct 7, 2019 · 9 comments · May be fixed by #1635
Open

Expose addresses for interfaces #415

JJinMaine opened this issue Oct 7, 2019 · 9 comments · May be fixed by #1635

Comments

@JJinMaine
Copy link

Hello,

I can't quite figure out how to get the list of currently assigned ipv4 IP addresses to be available at the /metrics endpoint. I can see the NIC name and all the NIC stats but there's no ipv4 addresses listed. Am I doing it wrong? Is there a non-default option I need to enable to get it working? My plan is to show a table of assigned IP addresses along with same stats and I'm hoping this is an easy fix. Thanks!

Jim

@JJinMaine JJinMaine changed the title How do get the currently assigned IPv4 addresses? How do I get the currently assigned IPv4 addresses? Oct 7, 2019
@carlpett
Copy link
Collaborator

carlpett commented Oct 7, 2019

Hi @JJinMaine,
I do not think we have a good way of exposing that information right now. In general, there could be any number of IP addresses per interface, which also will make it a bit more complicated to query with.
We would need to do something like wmi_net_adress{nic="Ethernet",address="10.0.0.1"} 1 etc for each nic/address pair, I think, and then you'd need to write queries something like wmi_net_bytes_total * on(nic) wmi_net_address{address="10.0.0.1"} etc. Which works okay for nics with single IPs, but less obvious with multiple addresses.

@JJinMaine
Copy link
Author

Hi @carlpett,
That's unfortunate, but it is what it is. Do you think it would be worthwhile submitting a feature request for something like this or has it been addressed previously and already on a backlog for the future? I didn't see anything as I was searching around but I don't want to create any duplicate work.

Thanks!

Jim

@carlpett carlpett changed the title How do I get the currently assigned IPv4 addresses? Expose addresses for interfaces Oct 7, 2019
@carlpett
Copy link
Collaborator

carlpett commented Oct 7, 2019

Let's turn this into a feature request instead :) As I mentioned, I'm not completely sure how this would best be implemented, but perhaps someone in the community has an idea

@EccentricVamp
Copy link

EccentricVamp commented Jun 27, 2022

Just came across this issue while looking for the same info as Jim.

IPv4 is just a 32-bit integer. We traditionally express it in dot-decimal notation, but it can also be rendered and stored as a normal decimal. Because it's only 32 bits, it can fit inside of a single Prometheus time series value (which are 64-bit floats).

So I think something like wmi_net_address{nic="Ethernet"} 167772161 would work for IPv4.

IPv6 is a bit trickier since it's 128-bit. I'm still not sure how best to store that.

@carlpett and @JJinMaine, what are your thoughts?

@danpoltawski
Copy link

It'd be nice to have some stuff like we have on the node_exporter with node_network_route_info

node_network_route_info{dest="10.1.1.0/24", device="eth0", priority="0", proto="kernel", src="10.1.1.71"} 1

Copy link

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Nov 25, 2023
@danpoltawski
Copy link

Still seems like a worthwhile feature, please don't close.

@fellipedemoraes
Copy link

Up

@jkroepke jkroepke self-assigned this Sep 21, 2024
@jkroepke jkroepke linked a pull request Sep 21, 2024 that will close this issue
@jkroepke
Copy link
Member

jkroepke commented Sep 21, 2024

Is someone here interest into testing a snapshot build which containers interface addresses? #1635

DL: https://github.com/prometheus-community/windows_exporter/actions/runs/10976149441/artifacts/1962226583

@fellipedemoraes @danpoltawski @EccentricVamp @JJinMaine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants