{"id":13607698,"url":"https://github.com/go-pluto/styx","last_synced_at":"2025-08-27T08:04:34.681Z","repository":{"id":54729795,"uuid":"100534706","full_name":"go-pluto/styx","owner":"go-pluto","description":"Export Data from Prometheus to csv, gnuplot \u0026 matplotlib","archived":false,"fork":false,"pushed_at":"2024-02-03T12:34:48.000Z","size":1241,"stargazers_count":99,"open_issues_count":6,"forks_count":24,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T14:36:32.807Z","etag":null,"topics":["csv","gnuplot","go","grafana","matplotlib","prometheus"],"latest_commit_sha":null,"homepage":"https://speakerdeck.com/metalmatze/prometheus-styx","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-pluto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-08-16T21:36:01.000Z","updated_at":"2025-03-24T13:15:48.000Z","dependencies_parsed_at":"2024-02-24T07:43:32.060Z","dependency_job_id":null,"html_url":"https://github.com/go-pluto/styx","commit_stats":{"total_commits":22,"total_committers":5,"mean_commits":4.4,"dds":"0.31818181818181823","last_synced_commit":"b8de3c98da42be8d997d2f5f0817119afef9e08e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/go-pluto/styx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pluto%2Fstyx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pluto%2Fstyx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pluto%2Fstyx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pluto%2Fstyx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-pluto","download_url":"https://codeload.github.com/go-pluto/styx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pluto%2Fstyx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272307550,"owners_count":24911075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","gnuplot","go","grafana","matplotlib","prometheus"],"created_at":"2024-08-01T19:01:20.812Z","updated_at":"2025-08-27T08:04:34.609Z","avatar_url":"https://github.com/go-pluto.png","language":"Go","readme":"# styx\n\nExport Prometheus data as CSV or directly plot with gnuplot \u0026 matplotlib.\n\n## Installation\n\n```bash\ngo install github.com/go-pluto/styx@latest\n```\n\nIf you want to simply export data from Prometheus as CSV then you don't need to install any thing else.\n\n### Optional Dependencies\n\nIf you want to plot directly with gnuplot, you need to install gnuplot first.\n\n#### gnuplot\n\n```bash\nbrew install gnuplot # macOS\napt-get install gnuplot # Debian / Ubuntu\npacman -S gnuplot # ArchLinux\n```\n\n#### matplotlib\n\n```bash\npip install matplotlib\npip2 install matplotlib # macOS\n```\n\n## Usage\n\nOnce you've [installed](#Installation) styx you can export data.\nMy recommendation is to actually build the queries in the Prometheus UI\nonly if you've played with the data there and you know which query is best,\ncopy the query and use it to export the data with styx.\n\n#### CSV\n\n```bash\n# export the data for the last hour from http://localhost:9090 \nstyx 'go_goroutines'\nstyx 'sum(go_goroutines)'\nstyx 'go_goroutines{job=\"prometheus\"}'\nstyx 'go_goroutines \u003e 100'\n# export the data for the last 6 hours from http://localhost:9090\nstyx --duration 6h 'sum(go_goroutines)' \n# export the data from a specific prometheus for the last hour.\nstyx --prometheus http://prom.example.com 'sum(go_goroutines)' \n```\n\n#### gnuplot\n\n```bash\n# plot the data for the last hour from http://localhost:9090\nstyx gnuplot 'sum(go_goroutines)' \u003e goroutines.gnuplot\n# plot the data for the last 6 hours from http://localhost:9090\nstyx gnuplot --duration 6h 'sum(go_goroutines)' \u003e goroutines.gnuplot \n# plot the data from a specific prometheus for the last hour.\nstyx gnuplot --prometheus http://prom.example.com 'sum(go_goroutines)' \u003e goroutines.gnuplot\n```\n\nOnce you have written the generated content into a file you can use this to\nedit and plot the graph:\n\n```bash\ngnuplot -p \u003c test.gnuplot\n```\n\n#### matplotlib\n\n```bash\n# plot the data for the last hour from http://localhost:9090\nstyx matplotlib 'sum(go_goroutines)' \u003e goroutines.py\n# plot the data for the last 6 hours from http://localhost:9090\nstyx matplotlib --duration 6h 'sum(go_goroutines)' \u003e goroutines.py \n# plot the data from a specific prometheus for the last hour.\nstyx matplotlib --prometheus http://prom.example.com 'sum(go_goroutines)' \u003e goroutines.py\n```\n\nOnce you have written the generated content into a file you can use this to\nedit and plot the graph:\n\n```bash\npython goroutines.py\n```\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-pluto%2Fstyx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-pluto%2Fstyx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-pluto%2Fstyx/lists"}