{"id":18532191,"url":"https://github.com/weibeld/file-exporter","last_synced_at":"2026-07-16T02:32:39.280Z","repository":{"id":80554518,"uuid":"442303529","full_name":"weibeld/file-exporter","owner":"weibeld","description":"Generic Prometheus file exporter","archived":false,"fork":false,"pushed_at":"2021-12-29T17:08:48.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-17T22:37:19.090Z","etag":null,"topics":["docker-image","prometheus-exporter"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/weibeld/file-exporter","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weibeld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2021-12-28T00:10:26.000Z","updated_at":"2025-04-07T12:50:09.000Z","dependencies_parsed_at":"2023-03-13T20:09:30.725Z","dependency_job_id":null,"html_url":"https://github.com/weibeld/file-exporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/weibeld/file-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weibeld%2Ffile-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weibeld%2Ffile-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weibeld%2Ffile-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weibeld%2Ffile-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weibeld","download_url":"https://codeload.github.com/weibeld/file-exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weibeld%2Ffile-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35528482,"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-07-16T02:00:06.687Z","response_time":83,"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":["docker-image","prometheus-exporter"],"created_at":"2024-11-06T19:04:56.879Z","updated_at":"2026-07-16T02:32:39.276Z","avatar_url":"https://github.com/weibeld.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# File Exporter\n\nDead simple Prometheus exporter that serves metrics stored in local files over HTTP.\n\n[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/weibeld/file-exporter?color=blue\u0026label=docker%20hub\u0026logo=docker\u0026logoColor=white\u0026sort=semver)](https://hub.docker.com/r/weibeld/file-exporter)\n[![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/weibeld/file-exporter?color=blue\u0026label=image%20size\u0026logo=docker\u0026logoColor=white\u0026sort=semver)](https://hub.docker.com/r/weibeld/file-exporter)\n\n## Description\n\nThis exporter combines the content of one or more files in a directory ([configurable](#configuration)) and serves it on a specific port ([configurable](#configuration)) over HTTP.\n\nThe basic idea is as follows: to export metrics from any process, just write them in the [Prometheus metrics format](https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format) to one or more files in the configured directory, and the exporter will take care of exposing them over HTTP for Prometheus to scrape.\n\n\u003e **Note:** the exporter does neither check nor enforce the Prometheus metrics format in the files it serves. That means, any inconsistencies will only be reported by Prometheus at scrape time. However, it also means that the exporter can also be used for other data than metrics, as it's in fact just a very simple HTTP server.\n\nThe exposed metrics can be scraped on any HTTP path, including `/metrics` which is used by default by Prometheus.\n\n## Configuration\n\nThe exporter can be configured through the following environment variables:\n\n| Name | Description | Default value |\n|------|-------------|---------------|\n| `DIR` | Directory containing the files to serve | `/srv/metrics` |\n| `PORT` | Port on which the content is served | 9872 |\n\n## Use case\n\nA common use case for this exporter is using it as a sidecar container in Kubernetes for exporting the metrics of another container:\n\n```yaml\nspec:\n  containers:\n    - name: app\n      image: \u003cimage:tag\u003e\n      volumeMounts:\n        - name: metrics\n          mountPath: /root/metrics\n    - name: exporter\n      image: weibeld/file-exporter:0.0.2\n      ports:\n        - name: metrics\n          containerPort: 9872\n      volumeMounts:\n        - name: metrics\n          mountPath: /srv/metrics\n  volumes:\n    - name: metrics\n      emptyDir: {}\n```\n\nThe above [PodSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#podspec-v1-core) defines two containers that share an [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) volume. The `app` container can have its metrics exported by the `exporter` container by simply writing them to one or more files in its mount of the emptyDir volume (in that case, `/root/metrics`). The `exporter` container will then combine and serve the metrics in these files whenever it receives a scrape request.\n\nPrometheus can scrape the `exporter` container under the following URL:\n\n```\nhttp://\u003cpod-ip\u003e:9872/metrics\n```\n\n\u003e **Note:** as mentioned, any other HTTP path would also work, for example, `http://\u003cpod-ip\u003e:9872`.\n\n### Custom configuration\n\nTo customise the configurable parameters of the exporter, you can assign custom values to the corresponding environment variables in the container specification:\n\n```yaml\n    - name: exporter\n      image: weibeld/file-exporter:0.0.2\n      env:\n        - name: DIR\n          value: /metrics\n        - name: PORT\n          value: \"10000\"\n      ports:\n        - name: metrics\n          containerPort: 10000\n      volumeMounts:\n        - name: metrics\n          mountPath: /metrics\n```\n\n\u003e **Attention:** when you change the values of the environment variables, don't forget to also update the corresponding values in other parts of the container specification, such as in `volumeMounts` or `ports`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweibeld%2Ffile-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweibeld%2Ffile-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweibeld%2Ffile-exporter/lists"}