{"id":19500258,"url":"https://github.com/rea1shane/exporter","last_synced_at":"2026-02-14T03:12:31.466Z","repository":{"id":57646929,"uuid":"440804614","full_name":"rea1shane/exporter","owner":"rea1shane","description":"Prometheus exporter framework.","archived":false,"fork":false,"pushed_at":"2025-02-11T07:20:03.000Z","size":94,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T06:21:26.437Z","etag":null,"topics":["exporter","framework","metrics","node-exporter","prometheus","prometheus-exporter"],"latest_commit_sha":null,"homepage":"","language":"Go","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/rea1shane.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}},"created_at":"2021-12-22T09:32:33.000Z","updated_at":"2025-02-11T07:20:06.000Z","dependencies_parsed_at":"2025-01-02T10:32:39.300Z","dependency_job_id":"27b98214-c5a3-457d-b64d-95eb1204aea3","html_url":"https://github.com/rea1shane/exporter","commit_stats":null,"previous_names":["rea1shane/exporter_template","rea1shane/basexporter"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rea1shane%2Fexporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rea1shane%2Fexporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rea1shane%2Fexporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rea1shane%2Fexporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rea1shane","download_url":"https://codeload.github.com/rea1shane/exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252811195,"owners_count":21807905,"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":["exporter","framework","metrics","node-exporter","prometheus","prometheus-exporter"],"created_at":"2024-11-10T22:08:01.493Z","updated_at":"2026-02-14T03:12:26.426Z","avatar_url":"https://github.com/rea1shane.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Prometheus](https://github.com/prometheus/prometheus) exporter framework\n\nLets you create a powerful exporter in two minutes.\n\n## Features\n\nThis framework is extracted from [`node_exporter`](https://github.com/prometheus/node_exporter)'s [`node_exporter.go`](https://github.com/prometheus/node_exporter/blob/master/node_exporter.go) and [`collector.go`](https://github.com/prometheus/node_exporter/blob/master/collector/collector.go). You can use all the features of `node_exporter` with this framework:\n\n- [Enable \u0026 Disable collectors](https://github.com/prometheus/node_exporter/?tab=readme-ov-file#collectors)\n- [Include \u0026 Exclude flags](https://github.com/prometheus/node_exporter/?tab=readme-ov-file#include--exclude-flags)\n- [Filtering enabled collectors](https://github.com/prometheus/node_exporter/?tab=readme-ov-file#filtering-enabled-collectors)\n- Useful metrics `collector_duration_seconds` and `collector_success`\n- ...\n\n## Example\n\nThere is an example in [`_example`](https://github.com/rea1shane/exporter/tree/main/_example).\n\n## Usage\n\nCreating your exporter is very easy:\n\n1. Create some collectors implement `github.com/rea1shane/exporter/collector.Collector` and call `github.com/rea1shane/exporter/collector.RegisterCollector` in their `init` function.\n2. Call the `github.com/rea1shane/exporter.Run` function to start the exporter.\n\nNow, everything is done!\n\n### Tips\n\n- Same as `node_exporter`, the framework uses `log/slog` as the logger and `github.com/alecthomas/kingpin/v2` as the command line argument parser.\n- `github.com/rea1shane/exporter/collector.ErrNoData` indicates the collector found no data to collect, but had no other error. If necessary, return it in the `github.com/rea1shane/exporter/collector.Collector`'s `Update` method.\n- `github.com/rea1shane/exporter/metric.TypedDesc` makes easier to create metrics.\n- If you are not using `github.com/rea1shane/exporter/metric.TypedDesc` to create metrics, you can use `github.com/rea1shane/exporter/util.AnyToFloat64` function to convert the data to `float64`.\n\n### Optional features\n\n#### PProf statistics\n\nAdd `_ \"net/http/pprof\"` to imports to enable PProf statistics:\n\n```go\npackage main\n\nimport (\n\t_ \"net/http/pprof\"\n)\n```\n\nSee [prometheus/exporter-toolkit#196](https://github.com/prometheus/exporter-toolkit/pull/196) for more information.\n\n## Building, running and more\n\n### Using Prometheus's `Makefile.common` file\n\nYou can using Prometheus's `Makefile.common` file to building or running an exporter that uses this framework just like `node_exporter`. All you need is:\n\n1. Copy [prometheus/node_exporter/Makefile.common](https://github.com/prometheus/node_exporter/blob/master/Makefile.common) to your repository root path.\n2. Create `.promu.yml` like [prometheus/node_exporter/.promu.yml](https://github.com/prometheus/node_exporter/blob/master/.promu.yml).\n3. Create `Makefile` like [prometheus/node_exporter/Makefile](https://github.com/prometheus/node_exporter/blob/master/Makefile).\n4. Create `VERSION` like [prometheus/node_exporter/VERSION](https://github.com/prometheus/node_exporter/blob/master/VERSION).\n\nNow your repository will looks like this:\n\n```\nyour_exporter\n├── .promu.yml\n├── Makefile.common\n├── Makefile\n├── VERSION\n└── ...\n```\n\nThen you can execute everything that has been defined in `Makefile.common`. Some examples:\n\n- [Run](https://github.com/prometheus/node_exporter?tab=readme-ov-file#development-building-and-running)\n- [Local build](https://github.com/prometheus/blackbox_exporter?tab=readme-ov-file#local-build)\n- [Building with Docker](https://github.com/prometheus/blackbox_exporter?tab=readme-ov-file#building-with-docker) (Note: You need a `Dockerfile` like [this](https://github.com/prometheus/blackbox_exporter/blob/master/Dockerfile))\n\n### Manually\n\nIf you want to build in a simple way, see example's [Makefile](https://github.com/rea1shane/exporter/tree/main/_example/Makefile). (Note: Also need a `VERSION` file and may missing `tags` info)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frea1shane%2Fexporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frea1shane%2Fexporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frea1shane%2Fexporter/lists"}