~jae/neos-metrics-exporter

eee2b26b8d1f69129b0f591bb8b885cc88cbc7a6 — Jae Salokettu (J4) 7 months ago 2a5251a
META: add README + update gitignore
2 files changed, 51 insertions(+), 1 deletions(-)

M .gitignore
A README.md
M .gitignore => .gitignore +0 -1
@@ 3,7 3,6 @@ out/
*.o
*.bin
*.db
*.md
lib/
node_modules/
.env

A README.md => README.md +51 -0
@@ 0,0 1,51 @@
# Neos Metrics Exporter

This small project is made as a temporary band-aid to export player stats of Headlesses to [Prometheus](https://prometheus.io/) in order to plan events better.

## Dev setup

Dependencies:
- [Yarn](https://yarnpkg.com/)

Getting started:
```
git clone https://git.sr.ht/~jae/neos-metrics-exporter
cd neos-metrics-exporter
yarn
yarn dev
```

You should now be able to access the solution on https://localhost:3001

## Production setup

For production setup, it is recommended using [Docker](https://www.docker.com/).

You can either build your own image or use the prebuilt one at `rg.nl-ams.scw.cloud/jaexencont/nme:latest`.

Example of `docker-compose.yml` file:

```yml
version: '3.9'

services:
  nme:
    image: rg.nl-ams.scw.cloud/jaexencont/nme:latest
    environment:
      - NODE_ENV=production
      - USERS=j4,SynthImperium
```

Then into your Prometheus config (assumes Prometheus is running within the same Docker network):

```yml
global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: 'nme'
    scrape_interval: 15s
    static_configs:
      - targets: ['nme:3001']
```