Skip to content

Commit

Permalink
docs: add usage docs on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
luissimas committed Jun 23, 2024
1 parent 2d87a32 commit 097fbe1
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,37 @@ An agent that collects metrics from an zettelkasten and stores them into an Infl
- Authenticate in private git repositories using personal access tokens
- Grafana dashboards included

## Usage

The exporter is distributed as both a binary and a Docker image. The currently documented ways of deploy are via docker compose and Kubernetes. For details about the setup, check out the examples:

- [Docker compose example](./examples/compose).
- [Kubernetes example](./examples/kubernetes).

Note that for a complete solution, it will be necessary to also configure InfluxDB and Grafana. For more information about setting them up, refer to their documentation. Here are some links that might be useful:

- https://grafana.com/docs/grafana/latest/getting-started/get-started-grafana-influxdb/
- https://docs.influxdata.com/influxdb/v2/get-started/setup/

## Configuration

All configuration is supplied via environment variables. You should supply at least the required variables and either the `ZETTELKASTEN_DIRECTORY` or the `ZETTELKASTEN_GIT_URL` variables.

| Name | Description | Default | Required |
| -------------------------- | -------------------------------------------------------------------- | ------------------------------ | -------- |
| INFLUXDB_URL | The InfluxDB URL | | Yes |
| INFLUXDB_TOKEN | The InfluxDB token to authenticate in the bucket | | Yes |
| INFLUXDB_ORG | The InfluxDB org containing the bucket | | Yes |
| INFLUXDB_BUCKET | The InfluxDB bucket to register metrics | | Yes |
| ZETTELKASTEN_DIRECTORY | The local directory containing the zettelkasten | | No |
| ZETTELKASTEN_GIT_URL | The URL for the git repository containing the zettelkasten | | No |
| ZETTELKASTEN_GIT_TOKEN | The access token to authenticate with private repositories | | No |
| ZETTELKASTEN_GIT_BRANCH | The branch to use for git repositories | main | No |
| COLLECTION_INTERVAL | Time to wait between metric collections | 5m | No |
| COLLECT_HISTORICAL_METRICS | Wether to collect historical metrics at startup | true | No |
| IGNORE_FILES | Comma separated list of files that will be ignored in the collection | .git,obsidian,.trash,README.md | No |
| LOG_LEVEL | The minimum log level | INFO | No |

## References

https://prometheus.io/docs/instrumenting/writing_exporters/
Expand All @@ -28,3 +59,5 @@ https://github.com/influxdata/helm-charts/tree/master/charts/influxdb2
https://grafana.com/docs/grafana/latest/getting-started/get-started-grafana-influxdb/

https://docs.influxdata.com/flux/v0/get-started/

https://github.com/onedr0p/exportar

0 comments on commit 097fbe1

Please sign in to comment.