weihao/bungeecord-prometheus-exporter

Requires RedisBungee to even work?

Closed this issue · 28 comments

To get the plugin to load on my BungeeCord I had to edit the config.yml to manually disable the supposed "RedisBungee" checks.

However, importing the dashboard to Grafana appears to just make a dashboard with random placeholder like information, and the proxy (BungeeCord) isn't even detected itself. Its running on the default 9225 as shown in this start-up guide, with the correct allocation and assignment, I can go to serverIP:port/metrics and that resolves - the dashboard in Grafana does not.

I've edited the original comment with my issue.

Well from a quick and uneducated look, I believe Grafana uses bungee_redis_bungee_online_proxies from serverIP:port/metrics to get a list of proxies. But, as I said, I don't use RedisBungee - is RedisBungee actually required? It doesn't say that, and there is no clear indication that RedisBungee is required for the entire thing to even work, plus, any way to disable it.

RedisBungee is not required. It was actually removed in the latest version. What error are you seeing?

885d4c1

I have updated the dashboard to exclude RedisBungee.

The Bukkit/Spigot version appears to work as expected.

Just updated to your new dashboard
However, the BungeeCord version's grafana page just loads of random data in place of whats supposed to be there:
Screenshot 2021-08-18 at 01 15 04

Another thing to note is on the Bukkit version, the Variable is set to use Prometheus, but on this BungeeCord version it is set to Grafana:

Bukkit:
Screenshot 2021-08-18 at 01 18 42

BungeeCord:
Screenshot 2021-08-18 at 01 19 16

Is this intentional?
(I'm completely new to Grafama and set up everything to use this :D)

The Bukkit/Spigot version appears to work as expected.

Just updated to your new dashboard
However, the BungeeCord version's grafana page just loads of random data in place of whats supposed to be there:
Screenshot 2021-08-18 at 01 15 04

You need to update prometheus config to

    static_configs:
      - targets: [ 'localhost:9225' ]
        labels:
          proxy_name: 'proxy1'

server_name was changed to proxy_name

I've changed server_name to proxy_name, and the only difference I spotted was that the dashboard went from proxies: All to proxies: None

remove the dashboard and reimport the dashboard

I installed the new plugin (2.0.3), deleted the dashboard, re-imported it and its still showing the same thing, do you have anything in mind that I could show you to help?

are you using bungeecord? can you show me the cotent of serverIP:port/metrics?

Another thing to note is on the Bukkit version, the Variable is set to use Prometheus, but on this BungeeCord version it is set to Grafana:

Bukkit:
Screenshot 2021-08-18 at 01 18 42

BungeeCord:
Screenshot 2021-08-18 at 01 19 16

Is this intentional?
(I'm completely new to Grafama and set up everything to use this :D)

I have updated the dashboard to use label_values

are you using bungeecord? can you show me the cotent of serverIP:port/metrics?

https://ptero.co/udazezibew.shell

Even after re-importing the dashboard it shows that value still, but I'll try again.

Does Minecraft Prometheus exporter work for you?

Does Minecraft Prometheus exporter work for you?

Yes, the Bukkit/Spigot version works as shown here:
Screenshot 2021-08-18 at 14 18 47

And after deleting and re-importing the BungeeCord on Grafana, it still doesn't appear to work/detect the proxy.

EDIT:
Here is my prometheus.yml file >> https://ptero.co/zemevisege.bash
The Minecraft (Spigot) one works, and the BungeeCord one doesn't.

can you inspect the grafana dashboard queries?

Only get console errors on the BungeeCord dashboard.

Every "refresh" interval this error pops up:

{
    "type": "cancelled",
    "cancelled": true,
    "data": null,
    "status": -1,
    "statusText": "Request was aborted",
    "config": {
        "method": "GET",
        "url": "api/annotations",
        "params": {
            "from": 1629315089936,
            "to": 1629315389936,
            "limit": 100,
            "matchAny": false,
            "dashboardId": 9
        },
        "requestId": "grafana-data-source-annotations-Annotations & Alerts-9",
        "retry": 0,
        "headers": {
            "X-Grafana-Org-Id": 1
        },
        "hideFromInspector": true
    },
    "message": "Query error: -1 Request was aborted"
}

Then there is also another WebSocket error which I believe I get on both the Minecraft + BungeeCord pages:
WebSocket connection to 'ws://serverIP:3000/api/live/ws' failed:

could you get more details? like any error log you could find?

Sorry for the incredibly long wait, I suddenly found myself very busy.

Here is my grafana.log after loading the dashboard: https://hastebin.com/lurumewuxi.apache

Where would I find additional logs that may be useful?

the request was blocked by CORS.

see more

/etc/grafana/grafana.ini

domain = <change this to your ip>

Ok, I moved both Grafana and Prometheus behind my Nginx reverse proxy. After a quick re-configuration of some things, once again the Minecraft version is working fine and detecting my Hub server, but the BungeeCord one remains to provide placeholder information.

I've also added the
add_header 'Access-Control-Allow-Origin' "*";
To the Grafana nginx config, and the Request Origin is not authorized is still appearing.

I am really stuck now as to why this is happening, and I am very sorry for not being the best help.
Many thanks, however - I hope to eventually resolve this.

I have run into this issue, and my solution is

Nginx

add_header "Access-Control-Allow-Origin" "*";
            add_header "Access-Control-Allow-Credentials" "true";
            add_header "Access-Control-Allow-Methods" "GET,HEAD,OPTIONS,POST,PUT";
            add_header "Access-Control-Allow-Headers" "Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers";

grafana.ini

[live]
# allowed_origins is a comma-separated list of origins that can establish connection with Grafana Live.
# If not set then origin will be matched over root_url. Supports wildcard symbol "*".
allowed_origins = <your domain here or *>

Hi, after adding the missing Nginx headers I no longer get any errors. But placeholder information is still shown. I believe the dashboard doesn't actually detect anything from the Prometheus. Going into the variables settings shows a variable that I think is broken which is why the dashboard isn't showing the data.

could you show me what your variables look like?

Sorry for the long response I completely forgot to respond and thought I did.

Heres the variables for the bungeecord:

Screenshot 2021-12-16 at 01 55 55

And for reference, here is the bukkit one. From what I can see its using Prometheus and detecting the "Hub" correctly.

Screenshot 2021-12-16 at 01 57 44

weihao commented

Might be related to #88

The data source error should be resolved now