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

[FR] Add interface "name" to labels? #3

Open
emiljoensson opened this issue Jan 25, 2022 · 2 comments
Open

[FR] Add interface "name" to labels? #3

emiljoensson opened this issue Jan 25, 2022 · 2 comments

Comments

@emiljoensson
Copy link

Is it possible to have labels, such as ovs_interface_tx_packets, to also include the "name" and not just "uuid"?

Reason is that uuid may change at any time (e.g KVM VM is edited/redefined), but the name can be used as unique and persistent identifier.

Just to be clear, with name I mean this field:
ovs-vsctl -- --columns=name,_uuid list Interface

Thank you!!

@greenpau
Copy link
Owner

Is it possible to have labels, such as ovs_interface_tx_packets, to also include the "name" and not just "uuid"?

@emiljoensson , yes. It is done in this fashion.

https://github.com/greenpau/ovsdb/blob/c930a97327ebc4d887a94c58822da0baab57b734/transact_test.go#L36-L43

It uses Transact() function:

https://github.com/greenpau/ovsdb/blob/c930a97327ebc4d887a94c58822da0baab57b734/transact.go#L58-L88

pawelos99 pushed a commit to pawelos99/ovs_exporter that referenced this issue Feb 5, 2023
Added interface name label to each metric related to the interface
pawelos99 pushed a commit to pawelos99/ovs_exporter that referenced this issue Feb 5, 2023
Added interface name label to each metric related to the interface
@pawelos99
Copy link

Hi, I was using this exporter quite successfully, so thanks for your work!
Because of the way I was using it, I was also missing a feature where I can query statistics by interface name directly. Of course you can work it around in prometheus by using joins but direct access it much easier. I have added simple PR that is adding interface name label to each metric related to interface statistics.
Thanks

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

No branches or pull requests

3 participants