Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 434bd49

Browse files
committed
1.1.0
* updated Grafana Template * renamed some metrics * mc_loaded_chunks_total > mc_loaded_chunks * mc_players_online_total > mc_players_online * mc_entities_total > mc_entities * mc_tile_entities_total > mc_tile_entities * got rid of all the Jetty logspam
1 parent b1eaee5 commit 434bd49

File tree

6 files changed

+182
-64
lines changed

6 files changed

+182
-64
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
group = 'de.sldk.mc.prometheusexporter'
11-
version = '1.0.4'
11+
version = '1.1.0'
1212
description = "Sponge Minecraft Prometheus Exporter"
1313
ext.url = 'https://github.com/Stonebound/minecraft-prometheus-exporter'
1414

@@ -60,7 +60,7 @@ blossom {
6060
def location = 'src/main/java/de/sldk/mc/prometheusexporter/PluginInfo.java'
6161

6262
replaceToken '@name@', project.name, location
63-
replaceToken '@version@', version, location
63+
replaceToken '@version@', project.version, location
6464
replaceToken '@description@', project.description, location
6565
replaceToken '@url@', project.url, location
6666
}

logo.png

22.3 KB
Loading

minecraft-grafana.json

Lines changed: 99 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"__inputs": [
33
{
4-
"name": "DS_HOST",
5-
"label": "prometheus",
4+
"name": "DS_LOCAL",
5+
"label": "Local",
66
"description": "",
77
"type": "datasource",
88
"pluginId": "prometheus",
@@ -43,7 +43,16 @@
4343
"graphTooltip": 1,
4444
"hideControls": false,
4545
"id": null,
46-
"links": [],
46+
"links": [
47+
{
48+
"asDropdown": false,
49+
"icon": "external link",
50+
"tags": [
51+
"server"
52+
],
53+
"type": "dashboards"
54+
}
55+
],
4756
"refresh": false,
4857
"rows": [
4958
{
@@ -53,7 +62,7 @@
5362
{
5463
"aliasColors": {},
5564
"bars": false,
56-
"datasource": "${DS_HOST}",
65+
"datasource": "${DS_LOCAL}",
5766
"fill": 1,
5867
"id": 1,
5968
"legend": {
@@ -84,7 +93,7 @@
8493
"legendFormat": "{{state}}",
8594
"metric": "mc_players_total",
8695
"refId": "A",
87-
"step": 4
96+
"step": 240
8897
}
8998
],
9099
"thresholds": [],
@@ -131,7 +140,7 @@
131140
"rgba(237, 129, 40, 0.89)",
132141
"rgba(50, 172, 45, 0.97)"
133142
],
134-
"datasource": "${DS_HOST}",
143+
"datasource": "${DS_LOCAL}",
135144
"format": "none",
136145
"gauge": {
137146
"maxValue": 100,
@@ -183,7 +192,7 @@
183192
"legendFormat": "",
184193
"metric": "mc_players_total",
185194
"refId": "A",
186-
"step": 40
195+
"step": 1800
187196
}
188197
],
189198
"thresholds": "0,1",
@@ -202,7 +211,7 @@
202211
{
203212
"aliasColors": {},
204213
"bars": false,
205-
"datasource": "${DS_HOST}",
214+
"datasource": "${DS_LOCAL}",
206215
"fill": 1,
207216
"id": 7,
208217
"legend": {
@@ -228,12 +237,19 @@
228237
"steppedLine": false,
229238
"targets": [
230239
{
231-
"expr": "mc_jvm_memory",
240+
"expr": "mc_jvm_memory{type=\"max\"}",
232241
"intervalFactor": 2,
233242
"legendFormat": "mem{{type}}",
234243
"metric": "mc_jvm_memory",
235244
"refId": "A",
236-
"step": 4
245+
"step": 240
246+
},
247+
{
248+
"expr": "mc_jvm_memory{type=\"used\"}",
249+
"intervalFactor": 2,
250+
"legendFormat": "mem{{type}}",
251+
"refId": "B",
252+
"step": 240
237253
}
238254
],
239255
"thresholds": [],
@@ -276,11 +292,11 @@
276292
"colorBackground": false,
277293
"colorValue": false,
278294
"colors": [
279-
"rgba(50, 172, 45, 0.97)",
295+
"rgba(245, 54, 54, 0.9)",
280296
"rgba(237, 129, 40, 0.89)",
281-
"rgba(245, 54, 54, 0.9)"
297+
"rgba(50, 172, 45, 0.97)"
282298
],
283-
"datasource": "${DS_HOST}",
299+
"datasource": "${DS_LOCAL}",
284300
"decimals": null,
285301
"format": "bytes",
286302
"gauge": {
@@ -332,11 +348,11 @@
332348
"legendFormat": "",
333349
"metric": "mc_jvm_memory",
334350
"refId": "A",
335-
"step": 40
351+
"step": 1800
336352
}
337353
],
338-
"thresholds": "5500000000",
339-
"title": "JVM Memory Used",
354+
"thresholds": "500000000",
355+
"title": "JVM Memory Free",
340356
"type": "singlestat",
341357
"valueFontSize": "80%",
342358
"valueMaps": [
@@ -361,9 +377,51 @@
361377
"height": 250,
362378
"panels": [
363379
{
380+
"alert": {
381+
"conditions": [
382+
{
383+
"evaluator": {
384+
"params": [
385+
10
386+
],
387+
"type": "lt"
388+
},
389+
"operator": {
390+
"type": "and"
391+
},
392+
"query": {
393+
"datasourceId": 2,
394+
"model": {
395+
"expr": "mc_tps{state=\"tps\"}",
396+
"intervalFactor": 2,
397+
"legendFormat": "tps",
398+
"metric": "mc_tps",
399+
"refId": "A",
400+
"step": 40
401+
},
402+
"params": [
403+
"A",
404+
"5m",
405+
"now"
406+
]
407+
},
408+
"reducer": {
409+
"params": [],
410+
"type": "avg"
411+
},
412+
"type": "query"
413+
}
414+
],
415+
"executionErrorState": "alerting",
416+
"frequency": "60s",
417+
"handler": 1,
418+
"name": "TPS alert Beyond",
419+
"noDataState": "no_data",
420+
"notifications": []
421+
},
364422
"aliasColors": {},
365423
"bars": false,
366-
"datasource": "${DS_HOST}",
424+
"datasource": "${DS_LOCAL}",
367425
"fill": 1,
368426
"id": 9,
369427
"legend": {
@@ -389,15 +447,23 @@
389447
"steppedLine": false,
390448
"targets": [
391449
{
392-
"expr": "mc_tps{state=\"tps\"",
450+
"expr": "mc_tps{state=\"tps\"}",
393451
"intervalFactor": 2,
394452
"legendFormat": "tps",
395453
"metric": "mc_tps",
396454
"refId": "A",
397-
"step": 2
455+
"step": 120
456+
}
457+
],
458+
"thresholds": [
459+
{
460+
"colorMode": "critical",
461+
"fill": true,
462+
"line": true,
463+
"op": "lt",
464+
"value": 10
398465
}
399466
],
400-
"thresholds": [],
401467
"timeFrom": null,
402468
"timeShift": null,
403469
"title": "TPS",
@@ -447,7 +513,7 @@
447513
{
448514
"aliasColors": {},
449515
"bars": false,
450-
"datasource": "${DS_HOST}",
516+
"datasource": "${DS_LOCAL}",
451517
"fill": 1,
452518
"id": 3,
453519
"legend": {
@@ -473,12 +539,12 @@
473539
"steppedLine": false,
474540
"targets": [
475541
{
476-
"expr": "mc_loaded_chunks_total",
542+
"expr": "mc_loaded_chunks",
477543
"intervalFactor": 2,
478544
"legendFormat": "{{world}}",
479545
"metric": "mc_loaded_chunks_total",
480546
"refId": "A",
481-
"step": 2
547+
"step": 120
482548
}
483549
],
484550
"thresholds": [],
@@ -531,9 +597,9 @@
531597
{
532598
"aliasColors": {},
533599
"bars": false,
534-
"datasource": "${DS_HOST}",
600+
"datasource": "${DS_LOCAL}",
535601
"fill": 1,
536-
"id": null,
602+
"id": 4,
537603
"legend": {
538604
"avg": false,
539605
"current": false,
@@ -557,12 +623,12 @@
557623
"steppedLine": false,
558624
"targets": [
559625
{
560-
"expr": "mc_entities_total",
626+
"expr": "mc_entities",
561627
"intervalFactor": 2,
562628
"legendFormat": "{{world}}_total",
563629
"metric": "mc_entities_total",
564630
"refId": "A",
565-
"step": 4
631+
"step": 240
566632
}
567633
],
568634
"thresholds": [],
@@ -603,7 +669,7 @@
603669
{
604670
"aliasColors": {},
605671
"bars": false,
606-
"datasource": "Local",
672+
"datasource": "${DS_LOCAL}",
607673
"fill": 1,
608674
"id": 10,
609675
"legend": {
@@ -629,12 +695,12 @@
629695
"steppedLine": false,
630696
"targets": [
631697
{
632-
"expr": "mc_tile_entities_total{group=\"dw20\"}",
698+
"expr": "mc_tile_entities",
633699
"intervalFactor": 2,
634700
"legendFormat": "{{world}}_total",
635701
"metric": "mc_entities_total",
636702
"refId": "A",
637-
"step": 4
703+
"step": 240
638704
}
639705
],
640706
"thresholds": [],
@@ -690,7 +756,7 @@
690756
"list": []
691757
},
692758
"time": {
693-
"from": "now-30m",
759+
"from": "now-24h",
694760
"to": "now"
695761
},
696762
"timepicker": {
@@ -719,6 +785,6 @@
719785
]
720786
},
721787
"timezone": "browser",
722-
"title": "Minecraft",
723-
"version": 6
788+
"title": "Minecraft Server",
789+
"version": 14
724790
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package de.sldk.mc.prometheusexporter;
2+
3+
import org.eclipse.jetty.util.log.Logger;
4+
5+
public class JettyNullLogger implements Logger {
6+
public String getName() {
7+
return "Jetty";
8+
}
9+
10+
public void warn(String s, Object... objects) {
11+
}
12+
13+
public void warn(Throwable throwable) {
14+
}
15+
16+
public void warn(String s, Throwable throwable) {
17+
}
18+
19+
public void info(String s, Object... objects) {
20+
}
21+
22+
public void info(Throwable throwable) {
23+
}
24+
25+
public void info(String s, Throwable throwable) {
26+
}
27+
28+
public boolean isDebugEnabled() {
29+
return false;
30+
}
31+
32+
public void setDebugEnabled(boolean b) {
33+
}
34+
35+
public void debug(String s, Object... objects) {
36+
}
37+
38+
public void debug(String msg, long value) {
39+
40+
}
41+
42+
public void debug(Throwable throwable) {
43+
}
44+
45+
public void debug(String s, Throwable throwable) {
46+
}
47+
48+
public Logger getLogger(String s) {
49+
return this;
50+
}
51+
52+
public void ignore(Throwable throwable) {
53+
}
54+
}

0 commit comments

Comments
 (0)