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

Switch CPU from field to tag in Interrupts input plugin #4999

Closed
bitcharmer opened this issue Nov 16, 2018 · 7 comments
Closed

Switch CPU from field to tag in Interrupts input plugin #4999

bitcharmer opened this issue Nov 16, 2018 · 7 comments

Comments

@bitcharmer
Copy link
Contributor

Currently the inputs.interrupts plugin uses fields to store interrupt counters. This prevents users from grouping, filtering, discriminating and otherwise manipulating data that tags are normally used for.
For example in Grafana you won't be able to filter by chosen CPUs simply because they are fields not tags.

I propose changing CPU from field to a tag and introducing COUNT field.
The required change here is very simple and I have a PR ready if you're interested.

@danielnelson
Copy link
Contributor

Can you show an example of the new layout in line protocol: telegraf --input-filter=interrupts --test

@bitcharmer
Copy link
Contributor Author

Sure, here you go:

interrupts,cpu=0,device=524288-edge\ nvidia,host=qdlt-laptop,irq=126,type=IR-PCI-MSI count=0i 1542402916000000000
interrupts,cpu=1,device=524288-edge\ nvidia,host=qdlt-laptop,irq=126,type=IR-PCI-MSI count=40i 1542402916000000000
interrupts,cpu=2,device=524288-edge\ nvidia,host=qdlt-laptop,irq=126,type=IR-PCI-MSI count=39i 1542402916000000000
interrupts,cpu=3,device=524288-edge\ nvidia,host=qdlt-laptop,irq=126,type=IR-PCI-MSI count=99i 1542402916000000000
interrupts,cpu=4,device=524288-edge\ nvidia,host=qdlt-laptop,irq=126,type=IR-PCI-MSI count=17675i 1542402916000000000
interrupts,cpu=5,device=524288-edge\ nvidia,host=qdlt-laptop,irq=126,type=IR-PCI-MSI count=0i 1542402916000000000
interrupts,cpu=6,device=524288-edge\ nvidia,host=qdlt-laptop,irq=126,type=IR-PCI-MSI count=457i 1542402916000000000
interrupts,cpu=7,device=524288-edge\ nvidia,host=qdlt-laptop,irq=126,type=IR-PCI-MSI count=0i 1542402916000000000
interrupts,cpu=0,device=32768-edge\ i915,host=qdlt-laptop,irq=127,type=IR-PCI-MSI count=0i 1542402916000000000
interrupts,cpu=1,device=32768-edge\ i915,host=qdlt-laptop,irq=127,type=IR-PCI-MSI count=0i 1542402916000000000
interrupts,cpu=2,device=32768-edge\ i915,host=qdlt-laptop,irq=127,type=IR-PCI-MSI count=0i 1542402916000000000
interrupts,cpu=3,device=32768-edge\ i915,host=qdlt-laptop,irq=127,type=IR-PCI-MSI count=1564i 1542402916000000000
interrupts,cpu=4,device=32768-edge\ i915,host=qdlt-laptop,irq=127,type=IR-PCI-MSI count=0i 1542402916000000000
interrupts,cpu=5,device=32768-edge\ i915,host=qdlt-laptop,irq=127,type=IR-PCI-MSI count=5475448i 1542402916000000000
interrupts,cpu=6,device=32768-edge\ i915,host=qdlt-laptop,irq=127,type=IR-PCI-MSI count=21585i 1542402916000000000
interrupts,cpu=7,device=32768-edge\ i915,host=qdlt-laptop,irq=127,type=IR-PCI-MSI count=0i 1542402916000000000

soft_interrupts,cpu=0,host=qdlt-laptop,irq=TIMER count=600935i 1542402916000000000
soft_interrupts,cpu=1,host=qdlt-laptop,irq=TIMER count=543820i 1542402916000000000
soft_interrupts,cpu=2,host=qdlt-laptop,irq=TIMER count=531710i 1542402916000000000
soft_interrupts,cpu=3,host=qdlt-laptop,irq=TIMER count=508307i 1542402916000000000
soft_interrupts,cpu=4,host=qdlt-laptop,irq=TIMER count=515643i 1542402916000000000
soft_interrupts,cpu=5,host=qdlt-laptop,irq=TIMER count=1834599i 1542402916000000000
soft_interrupts,cpu=6,host=qdlt-laptop,irq=TIMER count=537914i 1542402916000000000
soft_interrupts,cpu=7,host=qdlt-laptop,irq=TIMER count=547727i 1542402916000000000
soft_interrupts,cpu=0,host=qdlt-laptop,irq=NET_TX count=17i 1542402916000000000
soft_interrupts,cpu=1,host=qdlt-laptop,irq=NET_TX count=9i 1542402916000000000
soft_interrupts,cpu=2,host=qdlt-laptop,irq=NET_TX count=7i 1542402916000000000
soft_interrupts,cpu=3,host=qdlt-laptop,irq=NET_TX count=20i 1542402916000000000
soft_interrupts,cpu=4,host=qdlt-laptop,irq=NET_TX count=14i 1542402916000000000
soft_interrupts,cpu=5,host=qdlt-laptop,irq=NET_TX count=4i 1542402916000000000
soft_interrupts,cpu=6,host=qdlt-laptop,irq=NET_TX count=6i 1542402916000000000
soft_interrupts,cpu=7,host=qdlt-laptop,irq=NET_TX count=8i 1542402916000000000

@danielnelson
Copy link
Contributor

@phemmer @calerogers This seems like an improvement to me, do you agree?

@phemmer
Copy link
Contributor

phemmer commented Nov 16, 2018

I suppose it depends on your objective. If you're interested in per-interrupt metrics, you now have to sum all the series together.
But off hand, I can't think of anything that this layout would make impossible to do.

The only change I would encourage is to prefix the cpu names with cpu. E.G. cpu0, cpu1, ... This is for consistency with the cpu input, which tags CPUs this way.

@bitcharmer
Copy link
Contributor Author

bitcharmer commented Nov 16, 2018

@phemmer agreed on preserving consistency, can change that. As you noted, per-irq metrics are still available through aggregation on the data store or visualization level.
The premise for this was the need for filtering individual CPU dynamics and/or grouping IRQ activity by NUMA node (or other relevant cpu group) which current plugin doesn't really allow.
We had to use a python script and input.exec instead. Thought this would be nicer.
And it's high time to contribute back! :)

@bitcharmer
Copy link
Contributor Author

@danielnelson PR submitted. What's the workflow from here? Sorry, I'm not familiar with telegraf's SDLC.

@danielnelson
Copy link
Contributor

Just leave this issue open and I replied over on the PR.

bitcharmer added a commit to bitcharmer/telegraf that referenced this issue Nov 30, 2018
bitcharmer added a commit to bitcharmer/telegraf that referenced this issue Nov 30, 2018
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