1
0
mirror of https://github.com/Lunik/gitea_prometheus_exporter.git synced 2025-04-18 11:04:02 +03:00

add README & example

Signed-off-by: Lunik <lunik@tiwabbit.fr>
This commit is contained in:
Lunik 2021-02-26 23:14:20 +01:00
parent 9305ca6cbb
commit 56f0a21717
No known key found for this signature in database
GPG Key ID: AEC152C8AC2C85EE
2 changed files with 86 additions and 0 deletions

42
README.md Normal file
View File

@ -0,0 +1,42 @@
# Prometheus export for Gitea
## What does it do ?
Export repositories metrics with prometheus format.
### Metrics exported
| Metric | Labels | Type |
|:-------------------|:----------------------------------------|:------|
| user | ['username', 'full_name'] | Gauge |
| org | ['username', 'full_name', 'visibility'] | Gauge |
| repo | ['name', 'owner'] | Gauge |
| repo_size | ['name', 'owner', 'unit'] | Gauge |
| repo_empty | ['name', 'owner'] | Gauge |
| repo_archived | ['name', 'owner'] | Gauge |
| repo_stars | ['name', 'owner'] | Gauge |
| repo_commits | ['name', 'owner'] | Gauge |
| repo_branches | ['name', 'owner'] | Gauge |
| repo_forks | ['name', 'owner'] | Gauge |
| repo_issues | ['name', 'owner'] | Gauge |
| repo_pull_requests | ['name', 'owner'] | Gauge |
## Build it
```shell
$ docker build -t gitea-exporter:latest .
```
## Run it
Take a look at the [Docker compose file](docker-compose.yml)
## Sources
[Gitea](https://github.com/go-gitea/gitea)
Thanks to [Langenfeld/py-gitea](https://github.com/Langenfeld/py-gitea)
## Disclaimer
This software was built by me, for my usages. It may not work "as it is" in your setup.

44
docker-compose.yml Normal file
View File

@ -0,0 +1,44 @@
version: '3.7'
services:
gitea:
image: "gitea/gitea"
environment:
DB_TYPE: postgres
DB_HOST: "gitea_database:5432"
DB_NAME: gitea
DB_USER: gitea
DB_PASSWD: "changeit"
networks:
- gitea
volumes:
- /app/gitea/data:/data
depends_on:
- gitea_database
gitea_database:
image: "postgres"
environment:
POSTGRES_USER: gitea
POSTGRES_PASSWORD: "changeit"
POSTGRES_DB: gitea
networks:
- gitea
volumes:
- /app/gitea/database:/var/lib/postgresql/data
gitea_exporter:
image: "gitea-exporter:latest"
configs:
- source: gitea_exporter
target: /app/config.yml
networks:
- gitea
configs:
gitea_exporter:
name: gitea-exporter-config
file: ./config.yml
networks:
gitea: