{"id":19308681,"url":"https://github.com/mtulio/prometheus-backfill","last_synced_at":"2026-05-30T16:31:24.412Z","repository":{"id":48845159,"uuid":"349286406","full_name":"mtulio/prometheus-backfill","owner":"mtulio","description":"Backfill historical data to Prometheus","archived":false,"fork":false,"pushed_at":"2021-07-08T20:34:01.000Z","size":104,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-24T03:17:42.502Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtulio.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}},"created_at":"2021-03-19T03:15:47.000Z","updated_at":"2025-02-03T16:16:23.000Z","dependencies_parsed_at":"2022-08-31T13:02:21.343Z","dependency_job_id":null,"html_url":"https://github.com/mtulio/prometheus-backfill","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mtulio/prometheus-backfill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtulio%2Fprometheus-backfill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtulio%2Fprometheus-backfill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtulio%2Fprometheus-backfill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtulio%2Fprometheus-backfill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtulio","download_url":"https://codeload.github.com/mtulio/prometheus-backfill/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtulio%2Fprometheus-backfill/sbom","scorecard":{"id":666879,"data":{"date":"2025-08-11","repo":{"name":"github.com/mtulio/prometheus-backfill","commit":"6b4a898919732f963bba2d3ffdd8c6b5fd5ab6c2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go-basic.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-basic.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/mtulio/prometheus-backfill/go-basic.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-basic.yaml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/mtulio/prometheus-backfill/go-basic.yaml/main?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:2","Warn: containerImage not pinned by hash: Dockerfile:15: pin your Docker image by updating alpine:3.13 to alpine:3.13@sha256:469b6e04ee185740477efa44ed5bdd64a07bbdd6c7e5f5d169e540889597b911","Warn: goCommand not pinned by hash: .github/workflows/go-basic.yaml:39","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 containerImage dependencies pinned","Info:   1 out of   2 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T18:21:55.734Z","repository_id":48845159,"created_at":"2025-08-21T18:21:55.739Z","updated_at":"2025-08-21T18:21:55.739Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33700863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"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":[],"created_at":"2024-11-10T00:16:02.321Z","updated_at":"2026-05-30T16:31:24.385Z","avatar_url":"https://github.com/mtulio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prometheus-backfill\n\n`prometheus-backfill` is yet another tool to backfill historical data points to Prometheus. =)\n\nAt this moment there are hard ways to take it on Prometheus, so the promisse here is to expose the interfaces to import old data from any disered input to [supported remote storage integration](https://prometheus.io/docs/operating/integrations/#remote-endpoints-and-storage) and continue using Prometheus as Querier.\n\nThe basic import tool reading from Prometheu's API data as json[.gz] files is provided in [prometheus-backfill](./cmd/prometheus-backfill)\n\nNotes:\n- A proposal to fill old data filling the tsdb blocks is under development by Prometheus team using [promtool](https://github.com/prometheus/prometheus/tree/main/cmd/promtool), ATM still in development and do not expose the implementation to be used as external tools.\n- The project was inspired by [knyar/prometheus-remote-backfill project](https://github.com/knyar/prometheus-remote-backfill/blob/master/promremotewrite/promremotewrite.go), and needing but we need more flexibility to manipulate the input/output data generated by [must-gather monitoring collector](https://github.com/mtulio/must-gather-monitoring/tree/master/must-gather).\n\nThe IO support are the following (TODO is not in development ATM):\n\nSupported **input**:\n- compressed json file from Prometheus' API\n- JSON file*\n- CSV*\n\nSupported **output**:\n- InfluxDB\n- Prometheus remote storage* (using native implementation)\n- Prometheus TSDB*\n- Elasticsearch*\n\n'* TODO, not developed yet.\n\n## Install\n\nBinary:\n\n~~~\nmake build\ncp ./bin/prometheus-backfill ~/bin/\n~~~\n\nDocker (image available on [Github Registry](https://github.com/mtulio/prometheus-backfill/packages/688087)):\n\n~~~\nmake container-build\ndocker pull docker.pkg.github.com/mtulio/prometheus-backfill/prometheus-backfill:latest\n~~~\n\n## Use Cases\n\n- [must-gather: monitoring collector](https://github.com/mtulio/must-gather-monitoring/tree/master/must-gather)\n- [must-gather-monitoring stack](https://github.com/mtulio/must-gather-monitoring)\n\n## Usage\n\n### tool `prometheus-backfill`\n\n`./bin/prometheus-backfill -h`\n\nGenerate the samples from Prometheus:\n\n~~~bash\nPROM_ADDR=localhost:9090\nMETRIC_PATH=\"/path/to/metrics/metric-up.json.gz\"\n$ curl -sq \\\n    -H \"Accept-encoding: gzip\" \\\n    --data-urlencode \"start=$(date -d '1 day ago' +%s)\" \\\n    --data-urlencode \"end=$(date -d 'now' +%s)\" \\\n    --data-urlencode \"step=1m\" \\\n    --data-urlencode \"query=up\" \\\n    \"${PROM_ADDR}/api/v1/query_range\" \u003e \"${METRIC_PATH}\"\n~~~\n\nRunning from binary:\n\n~~~bash\n/usr/bin/time -v \\\n    ./bin/prometheus-backfill \\\n    -e json.gz \\\n    -i \"${METRIC_PATH}\" \\\n    -o \"influxdb=http://localhost:8086=prometheus=admin=Super$ecret\"\n~~~\n\nRnuning from Docker\n\n~~~bash\npodman run --rm \\\n    -v ${METRIC_PATH}:/data/metric.json.gz\n    -it docker.pkg.github.com/mtulio/prometheus-backfill/prometheus-backfill:latest \\\n    /prometheus-backfill \\\n    -e json.gz \\\n    -i /data/metric.json.gz \\\n    -o \"influxdb=http://localhost:8086=prometheus=admin=Super$ecret\"\n~~~\n\n### Packages\n\nYou can customize a input parser/processor and the output storage, or use the default. Just see the package [backfill](./backfill/).\n\nJust a few ideas to use a custom package:\n- Customize from a custom metric format to write to Proemtheus Storage\n- Create a pipeline processing input metrics to a Prometheus Storage\n- ...\n\n## Roadmap / How to Contribute\n\nJust open a PR or issue if it may help you and you want to contribute.\n\nSee the following ideas of this project:\n\n- Develop tests, and tests, and tests... =)\n- Improve the documentation\n- Improve the parser to consume less memory and parallel processing files/metrics/points.\n- Support [Remote Storage package from Prometheus](https://github.com/prometheus/prometheus/tree/main/storage/remote)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtulio%2Fprometheus-backfill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtulio%2Fprometheus-backfill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtulio%2Fprometheus-backfill/lists"}