-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Prometheus output #58
Comments
@danhanks in DNS-OARC/dsc#204 you said that you were writing a script to run in cron that would convert the data to a format that Prometheus can use. Did you end up implementing that? I haven't looked too far into it but I guess using https://github.com/prometheus/influxdb_exporter could be an option as well. It exposes an InfluxDB-like web API and converts all metrics to Prometheus format. |
Hey @Daniel15, since Dan hasn't responded, are you going ahead with the development of this? |
@danhanks Great to hear, hope you can share. I would be very nice if this then can be turned into an output module for |
I can't recall all the reasons why, but I ended up writing it as a standalone daemon/exporter that watches (via inotify) for json datafiles generated by dsc. It parses those files, and generates a bunch of metrics that can then be scraped regularly by Prometheus. I imagine some of this code could also be re-purposed into an output module for dsc-datatool, but I need to do more reading about dsc-datatool to see how that would work. |
@danhanks Just put it anywhere really, or do a gist. Will look at reworking it into a plugin once I'm back from holidays. |
@danhanks Back from holidays, did you put the code somewhere? |
@jelu Thanks for the reminder. Here you go: https://gist.github.com/danhanks/9c59734f380ac56a8c1bdb7bec54bdb4 Let me know if you have any questions. |
Thanks @danhanks. By the looks of it it's not something I can add as crontrib right away, nor make into a The script seems to be very specific for your needs and your setup. It assumes a lot of things that might not be what others want/have. Someone would need to work a bit on it to make it more suitable for anyone, like command line options for most stuff and maybe use dnspython to get DNS numbers to text conversion rather then hardcoded lists. An output module could be made but it would likely solely depend on Do any of you (@danhanks @Daniel15) have time/want to take on any of this? |
Hi All! |
@jguidini Are you able to use Prometheus |
@jelu Yes. |
@jguidini Please try this branch with the node_exporter. You'll need to use the new output This generates output as:
|
@jguidini if you run into problem or need help setting it up maybe it's easier if we talk on OARC's Mattermost, find me here: https://chat.dns-oarc.net/community/channels/oarc-software. |
@jelu I'm had installed a prometheus and configure a node_exporter to an DNS server in our site. I'd installed dsc-datatool and generated a file in Prometheus style. On grafana added your dashboards, but now I'm working on how to node_exporter read the file generated by dsc-datatools (like --collector.textfile.directory /opt/prometheus/data) to prometheus collect them. |
@jelu I found the error, from debug log on node_exporter: Jan 18 16:39:15 bee10 node_exporter[4794]: ts=2022-01-18T19:39:15.328Z caller=textfile.go:219 level=error collector=textfile msg="failed to collect textfile data" file=datatool.prom err="failed to parse textfile data from \"/opt/prometheus/data/datatool.prom\": text format parsing error in line 120: invalid escape sequence '\\='" From file (datatool.prom):
To test I removed \= on all file (old friend sed), then from node_exporter log: Jan 18 16:45:15 bee10 node_exporter[5934]: ts=2022-01-18T19:45:15.368Z caller=textfile.go:219 level=error collector=textfile msg="failed to collect textfile data" file=datatool.prom err="failed to parse textfile data from \"/opt/prometheus/data/datatool.prom\": text format parsing error in line 4054: invalid escape sequence '\\ '" Again sed on some entries.. and another error: Jan 18 16:50:01 bee10 node_exporter[6873]: ts=2022-01-18T19:50:01.268Z caller=textfile.go:219 level=error collector=textfile msg="failed to collect textfile data" file=datatool.prom err="textfile \"/opt/prometheus/data/datatool.prom\" contains unsupported client-side timestamps, skipping entire file" Now i'm not know how to solve this. |
@jguidini I've fixed the quoting, you can I've also removed timestamps because while the format supports it, I found I see that you've joined our Mattermost, so lets continue discussions there 🙂 |
- Fix DNS-OARC#58: Add Prometheus output - InfluxDB: fix timestamp option - Update Copyright year
- Fix DNS-OARC#58: Add Prometheus output - InfluxDB: fix timestamp option - Update Copyright year
Is there anyone here that is up for writing a guide how to set this up?
|
Move here from DNS-OARC/dsc#204
The text was updated successfully, but these errors were encountered: