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

monitoring: T4315: Add telegraf output plugin prometheus-client #1310

Merged
merged 1 commit into from
May 3, 2022

Conversation

sever-sever
Copy link
Member

@sever-sever sever-sever commented May 2, 2022

Change Summary

Add output Plugin "prometheus-client" for telegraf:

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

monitoring, telegraf

Proposed changes

How to test

Minimal configuration:

set service monitoring telegraf prometheus-client

Check data from browser or curl:

vyos@tstrtr2# sudo curl http://localhost:9273/metrics | egrep -v "#" | head -10
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0conntrack_ip_conntrack_count{host="tstrtr2"} 5
conntrack_ip_conntrack_max{host="tstrtr2"} 262144
cpu_usage_guest{cpu="cpu-total",host="tstrtr2"} 0
cpu_usage_guest{cpu="cpu0",host="tstrtr2"} 0
cpu_usage_guest_nice{cpu="cpu-total",host="tstrtr2"} 0
cpu_usage_guest_nice{cpu="cpu0",host="tstrtr2"} 0
cpu_usage_idle{cpu="cpu-total",host="tstrtr2"} 97.22543352601456
cpu_usage_idle{cpu="cpu0",host="tstrtr2"} 97.22543352601456
cpu_usage_iowait{cpu="cpu-total",host="tstrtr2"} 0.3468208092485097
cpu_usage_iowait{cpu="cpu0",host="tstrtr2"} 0.3468208092485097
100 16190    0 16190    0     0   585k      0 --:--:-- --:--:-- --:--:--  585k
curl: (23) Failure writing output to destination
[edit]
vyos@tstrtr2# 

Possible options:

set service monitoring telegraf prometheus-client allow-from '192.0.2.0/24'
set service monitoring telegraf prometheus-client authentication username 'vyos'
set service monitoring telegraf prometheus-client authentication password 'vyospass'
set service monitoring telegraf prometheus-client listen-address '192.0.2.1'
set service monitoring telegraf prometheus-client metric-version '2'

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

<help>HTTP basic authentication parameters</help>
</properties>
<children>
<leafNode name="login">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would renaming it to username make sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Add output Plugin "prometheus-client" for telegraf:
  set service monitoring telegraf prometheus-client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants