{"id":19096590,"url":"https://github.com/sapcc/promdump","last_synced_at":"2025-07-08T07:15:44.897Z","repository":{"id":126035814,"uuid":"610309290","full_name":"sapcc/promdump","owner":"sapcc","description":"Dumps prometheus queries","archived":false,"fork":false,"pushed_at":"2024-04-16T16:33:49.000Z","size":181,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-02-19T18:47:26.569Z","etag":null,"topics":["golang","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sapcc.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,"publiccode":null,"codemeta":null}},"created_at":"2023-03-06T14:14:01.000Z","updated_at":"2024-02-26T15:25:24.000Z","dependencies_parsed_at":"2023-11-30T19:29:30.988Z","dependency_job_id":"3b1633a5-b4c9-4239-a276-931922a75c67","html_url":"https://github.com/sapcc/promdump","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Fpromdump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Fpromdump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Fpromdump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Fpromdump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sapcc","download_url":"https://codeload.github.com/sapcc/promdump/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240149795,"owners_count":19755751,"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","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":["golang","prometheus"],"created_at":"2024-11-09T03:37:11.244Z","updated_at":"2025-02-22T08:56:52.204Z","avatar_url":"https://github.com/sapcc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Promdump\nDumps a prometheus query to a local file in a generic readable format for further data processing\n\n## Minimal usage\n```sh\npromdump dump -u $PROM_URL '$PROM_QUERY' \u003e query.json\n```\nOutputs the flattened query results as json to stdout that can be directly consumed by pandas via:\n```python\nimport pandas as pd\n\ndf = pd.read_json(\"query.json\", orient=\"records\")\nprint(df)\n```\n\nTo get available metrics and their labels as JSON of a prometheus run\n```sh\npromdump metrics $PROM_URL\n```\n\n## Arguments\nMultiple queries can be specified by separating them with a space.\n\n### --backend/-b $BACKEND\nSpecifies the HTTP backend. Can be `curl` or `go`.\n\n### --client-cert $CERT\nSpecifies the name of the client certificate to use.\n\n### --format/-f $FORMAT\nSpecifies the serialization format. Can be `json` or `parquet`.\n\n### --layout/-l $LAYOUT\nSpecifies the data layout.\n- `raw` directly serializes the response of prometheus.\n- `nested` creates \"rows\" of metric name, timestamp value and the label set as a nested element.\n- `flat` flattens the label set into the upper structure.\n\n### --compress/-c $COMPRESSION\nSpecifies the compression for the output. Can be `none` or `gzip`.\n\n### --start/-s $START\nSpecifies the start timestamp for the query (layout: `2006-01-02T15:04:05`). Defaults to `now - 5m`.\n\n### --end/-e $END\nSpecifies the end timestamp for the query (layout: `2006-01-02T15:04:05`). Defaults to `now`.\n\n### --step/-S $STEP\nSpecifies the sample rate for the query. Defaults to `1m`.\n\n### --url/-u $URLS\nSpecifies the prometheis to query separated by `,`\n\n## Note on MacOS with client-cert authentification\nYou need to enable that curl HTTP backend:\n```sh\nCURL_SSL_BACKEND=secure-transport promdump -b curl --client-cert $CERT_NAME dump -u $PROM_URL '$PROM_QUERY'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapcc%2Fpromdump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsapcc%2Fpromdump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapcc%2Fpromdump/lists"}