ruscalworld / fabric-exporter

Fabric mod that adds a Prometheus exporter with general metrics of your server
https://modrinth.com/mod/fabricexporter
MIT License
33 stars 6 forks source link

I need some help (not really an issue) #3

Closed obp3ter closed 2 years ago

obp3ter commented 2 years ago

I love your mod, but I need some help with the Grafana dashboard setup. How do I separate two Minecraft servers into different dashboards?

ruscalworld commented 2 years ago

Adding multiple servers is not supported now. I'll try to add this in the near future.

obp3ter commented 2 years ago

Well, it would be possible to run 2 separate instances of Prometheus (and maybe also Grafana), but it's kind of a hassle, and I'm sure it can be done in Grafana, I just don't know how, because I never worked with it. I'll continue using it, It'll just take a bit more until I figure out which line is which in the graphs.

ruscalworld commented 2 years ago

I've updated a Grafana dashboard so it now supports selecting servers. In order to use this, you should reimport dashboard.

How do I separate two Minecraft servers into different dashboards?

If you want to use different dashboards, you can just import FabricExporter's dashboard twice, but it's ID and name must be changed. In this case you should have multiple instances of Prometheus, as I think. With current version of dashboard you can just hardcode values for variables in dashboard settings. Anyway, I don't see any reasons to do this, because you can use variables in a single dashboard.

ruscalworld commented 2 years ago

And few words on prometheus config. It should look like this for multiple servers:

- job_name: 'fabric'
  static_configs:
    - targets: ['127.0.0.1:25585']
    - targets: ['127.0.0.1:25586']
    - ...

Grafana with latest version of my dashboard doesn't require any additional configuration.

obp3ter commented 2 years ago

It works beautifully. Thank you.