2023-04-06 02:22:52 +02:00
|
|
|
[![status-badge](https://woodpecker.boerlage.me/api/badges/daan/osrs-prometheus-exporter/status.svg)](https://woodpecker.boerlage.me/daan/osrs-prometheus-exporter)
|
2023-04-05 02:32:25 +02:00
|
|
|
|
2023-04-06 02:22:52 +02:00
|
|
|
# OSRS Prometheus Exporter
|
2023-04-05 02:32:25 +02:00
|
|
|
|
2023-04-06 14:12:04 +02:00
|
|
|
Collects data about oldschool runescape from various source
|
2023-04-05 02:32:25 +02:00
|
|
|
|
2023-04-06 14:12:04 +02:00
|
|
|
## Features
|
2023-04-05 02:32:25 +02:00
|
|
|
|
2023-04-06 14:12:04 +02:00
|
|
|
* Track highscores rank per player
|
|
|
|
* Track xp gain per skill per player
|
|
|
|
* Track levels per skill per player
|
|
|
|
* Track how many player are logged in per world
|
2023-04-05 02:32:25 +02:00
|
|
|
|
2023-04-06 14:12:04 +02:00
|
|
|
## Endpoints
|
|
|
|
|
|
|
|
| uri | description |
|
|
|
|
|---------------|-------------------------|
|
|
|
|
| `/stats/:rsn` | Player metrics endpoint |
|
|
|
|
| `/worlds` | World metrics endpoint |
|
|
|
|
|
|
|
|
## Prometheus metrics
|
|
|
|
|
|
|
|
```promql
|
|
|
|
# Player metrics
|
|
|
|
osrs_player_level{skill="Hunter",player="rsn",profile="Standard"} 1
|
|
|
|
osrs_player_xp{skill="Hunter",player="rsn",profile="Standard"} 0
|
|
|
|
osrs_player_rank{skill="Hunter",player="rsn",profile="Standard"} 0
|
|
|
|
# World metrics
|
|
|
|
osrs_world_players{id="302",isMembers="true",location="UK"}
|
2023-04-05 02:32:25 +02:00
|
|
|
```
|
2023-04-06 14:12:04 +02:00
|
|
|
|
|
|
|
## Prometheus Configuration
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
scrape_configs:
|
|
|
|
- job_name: osrs-world-data
|
|
|
|
scrape_interval: 5m
|
|
|
|
metrics_path: /worlds
|
|
|
|
static_configs:
|
|
|
|
- targets:
|
|
|
|
- osrs-prometheus-exporter:3030
|
|
|
|
|
|
|
|
- job_name: osrs-player-runebaas
|
|
|
|
scrape_interval: 1h
|
|
|
|
metrics_path: /stats/runebaas
|
|
|
|
static_configs:
|
|
|
|
- targets:
|
|
|
|
- osrs-prometheus-exporter:3030
|
2023-04-05 02:32:25 +02:00
|
|
|
```
|
2023-04-06 14:12:04 +02:00
|
|
|
|
|
|
|
## Open Telemetry
|
|
|
|
|
|
|
|
This app includes support for Open Telemetry
|
|
|
|
|
|
|
|
It supports the following configuration options:
|
|
|
|
|
|
|
|
| Name | Default | Description |
|
|
|
|
|-------------------------------|-------------------------|---------------------|
|
|
|
|
| `OTEL_SERVICE_NAME` | `app` | Name of the app |
|
|
|
|
| `OTEL_EXPORTER_OTLP_ENDPOINT` | `http://localhost:4317` | Collection endpoint |
|
|
|
|
| `OTEL_EXPORTER_OTLP_PROTOCOL` | `grpc` | Collection protocol |
|