https://github.com/fcrespel/jka-exporter
Jedi Academy metrics exporter (Prometheus/OTLP)
https://github.com/fcrespel/jka-exporter
exporter jedi-academy jka opentelemetry otlp prometheus
Last synced: about 2 months ago
JSON representation
Jedi Academy metrics exporter (Prometheus/OTLP)
- Host: GitHub
- URL: https://github.com/fcrespel/jka-exporter
- Owner: fcrespel
- License: mit
- Created: 2025-10-14T22:19:25.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-10-29T21:14:14.000Z (8 months ago)
- Last Synced: 2025-10-29T22:34:36.076Z (8 months ago)
- Topics: exporter, jedi-academy, jka, opentelemetry, otlp, prometheus
- Language: Go
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JKA Exporter
A metrics exporter for Star Wars Jedi Knight: Jedi Academy dedicated servers, supporting Prometheus and OTLP formats.
## Usage
The following commands can be used to run the exporter as a [Docker](https://docs.docker.com/engine/) container.
```bash
# Show syntax help
docker run --rm ghcr.io/fcrespel/jka-exporter:latest -help
# Start in the background with Prometheus exporter (default)
docker run -d --name jka-exporter -p 8870:8870 ghcr.io/fcrespel/jka-exporter:latest -host -port 29070
# Start in the background with OTLP HTTP exporter
docker run -d --name jka-exporter -p 8870:8870 -e OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-receiver:4318 ghcr.io/fcrespel/jka-exporter:latest -host -port 29070 -exporter otlphttp
# Start in the background with OTLP gRPC exporter
docker run -d --name jka-exporter -p 8870:8870 -e OTEL_EXPORTER_OTLP_ENDPOINT=otlp-receiver:4317 ghcr.io/fcrespel/jka-exporter:latest -host -port 29070 -exporter otlpgrpc
# Stop container
docker stop jka-exporter
# Delete container
docker rm jka-exporter
```
### Options
The following command line arguments are supported:
```
-host string
Server host name or IP address (default "localhost")
-port int
Server port (default 29070)
-rcon-password string
Server Rcon password (can also be set via RCON_PASSWORD environment variable)
-enable-rpmetrics
Enable RPMod rpmetrics Rcon command to gather additional metrics
-metrics-port int
Metrics server port (default 8870)
-exporter string
Metrics exporter type (prometheus, otlphttp, or otlpgrpc) (default "prometheus")
-log-level string
Log level (debug, info, warn, error) (default "info")
-log-format string
Log format (text or json) (default "text")
```
### Environment variables
The following standard OpenTelemetry environment variables are supported:
- `OTEL_EXPORTER_OTLP_CERTIFICATE`: certificate file path for TLS verification
- `OTEL_EXPORTER_OTLP_ENDPOINT`: OTLP endpoint URL (e.g. `http://localhost:4318` for HTTP, `localhost:4317` for gRPC)
- `OTEL_EXPORTER_OTLP_HEADERS`: headers to include in requests (comma-separated key=value pairs)
- `OTEL_EXPORTER_OTLP_INSECURE`: use insecure transport for gRPC (default false)
- `OTEL_EXPORTER_OTLP_TIMEOUT`: timeout for OTLP export requests in milliseconds (default 10000)
- `OTEL_METRIC_EXPORT_INTERVAL`: metric export interval in milliseconds (default 60000)
- `OTEL_METRIC_EXPORT_TIMEOUT`: metric export timeout in milliseconds (default 30000)
- `OTEL_RESOURCE_ATTRIBUTES`: extra resource attributes (comma-separated key=value pairs)
- `OTEL_SERVICE_NAME`: service name resource attribute (default "jka-server")
Variables may reference other environment variables using `${VAR}` syntax, e.g. `OTEL_EXPORTER_OTLP_ENDPOINT=http://${HOST_IP}:4318`.
### Metrics
The following base metrics are exposed:
- `jka.clients.connected`: current number of clients connected
- `jka.clients.limit`: maximum number of clients allowed
- `jka.clients.ping`: player ping in milliseconds (with player name label)
The following RPMod metrics are exposed when the `-enable-rpmetrics` flag is set:
- `jka.server.cs.limit`: maximum number of Config String characters allowed
- `jka.server.cs.usage`: current number of Config String characters used
- `jka.server.entities.limit`: maximum number of entities allowed
- `jka.server.entities.usage`: current number of entities used
- `jka.server.rpcs.limit`: maximum number of RPCS characters allowed
- `jka.server.rpcs.usage`: current number of RPCS characters used
- `jka.server.uptime`: server uptime in milliseconds
When using the Prometheus exporter (default), metrics are available at `http://localhost:8870/metrics`. Note that dots (`.`) are replaced with underscores (`_`) in Prometheus metric names.
Additionally, a `http://localhost:8870/health` endpoint is available for health checking, e.g. by Kubernetes liveness/readiness probes.
## Building from source
1. Clone the repository:
```bash
git clone https://github.com/fcrespel/jka-exporter.git
cd jka-exporter
```
2. Build the project:
```bash
go build
```