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

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
phit committed Apr 18, 2017
1 parent b1eaee5 commit 434bd49
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 64 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

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

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

replaceToken '@name@', project.name, location
replaceToken '@version@', version, location
replaceToken '@version@', project.version, location
replaceToken '@description@', project.description, location
replaceToken '@url@', project.url, location
}
Expand Down
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
132 changes: 99 additions & 33 deletions minecraft-grafana.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"__inputs": [
{
"name": "DS_HOST",
"label": "prometheus",
"name": "DS_LOCAL",
"label": "Local",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
Expand Down Expand Up @@ -43,7 +43,16 @@
"graphTooltip": 1,
"hideControls": false,
"id": null,
"links": [],
"links": [
{
"asDropdown": false,
"icon": "external link",
"tags": [
"server"
],
"type": "dashboards"
}
],
"refresh": false,
"rows": [
{
Expand All @@ -53,7 +62,7 @@
{
"aliasColors": {},
"bars": false,
"datasource": "${DS_HOST}",
"datasource": "${DS_LOCAL}",
"fill": 1,
"id": 1,
"legend": {
Expand Down Expand Up @@ -84,7 +93,7 @@
"legendFormat": "{{state}}",
"metric": "mc_players_total",
"refId": "A",
"step": 4
"step": 240
}
],
"thresholds": [],
Expand Down Expand Up @@ -131,7 +140,7 @@
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"datasource": "${DS_HOST}",
"datasource": "${DS_LOCAL}",
"format": "none",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -183,7 +192,7 @@
"legendFormat": "",
"metric": "mc_players_total",
"refId": "A",
"step": 40
"step": 1800
}
],
"thresholds": "0,1",
Expand All @@ -202,7 +211,7 @@
{
"aliasColors": {},
"bars": false,
"datasource": "${DS_HOST}",
"datasource": "${DS_LOCAL}",
"fill": 1,
"id": 7,
"legend": {
Expand All @@ -228,12 +237,19 @@
"steppedLine": false,
"targets": [
{
"expr": "mc_jvm_memory",
"expr": "mc_jvm_memory{type=\"max\"}",
"intervalFactor": 2,
"legendFormat": "mem{{type}}",
"metric": "mc_jvm_memory",
"refId": "A",
"step": 4
"step": 240
},
{
"expr": "mc_jvm_memory{type=\"used\"}",
"intervalFactor": 2,
"legendFormat": "mem{{type}}",
"refId": "B",
"step": 240
}
],
"thresholds": [],
Expand Down Expand Up @@ -276,11 +292,11 @@
"colorBackground": false,
"colorValue": false,
"colors": [
"rgba(50, 172, 45, 0.97)",
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
"rgba(50, 172, 45, 0.97)"
],
"datasource": "${DS_HOST}",
"datasource": "${DS_LOCAL}",
"decimals": null,
"format": "bytes",
"gauge": {
Expand Down Expand Up @@ -332,11 +348,11 @@
"legendFormat": "",
"metric": "mc_jvm_memory",
"refId": "A",
"step": 40
"step": 1800
}
],
"thresholds": "5500000000",
"title": "JVM Memory Used",
"thresholds": "500000000",
"title": "JVM Memory Free",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
Expand All @@ -361,9 +377,51 @@
"height": 250,
"panels": [
{
"alert": {
"conditions": [
{
"evaluator": {
"params": [
10
],
"type": "lt"
},
"operator": {
"type": "and"
},
"query": {
"datasourceId": 2,
"model": {
"expr": "mc_tps{state=\"tps\"}",
"intervalFactor": 2,
"legendFormat": "tps",
"metric": "mc_tps",
"refId": "A",
"step": 40
},
"params": [
"A",
"5m",
"now"
]
},
"reducer": {
"params": [],
"type": "avg"
},
"type": "query"
}
],
"executionErrorState": "alerting",
"frequency": "60s",
"handler": 1,
"name": "TPS alert Beyond",
"noDataState": "no_data",
"notifications": []
},
"aliasColors": {},
"bars": false,
"datasource": "${DS_HOST}",
"datasource": "${DS_LOCAL}",
"fill": 1,
"id": 9,
"legend": {
Expand All @@ -389,15 +447,23 @@
"steppedLine": false,
"targets": [
{
"expr": "mc_tps{state=\"tps\"",
"expr": "mc_tps{state=\"tps\"}",
"intervalFactor": 2,
"legendFormat": "tps",
"metric": "mc_tps",
"refId": "A",
"step": 2
"step": 120
}
],
"thresholds": [
{
"colorMode": "critical",
"fill": true,
"line": true,
"op": "lt",
"value": 10
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "TPS",
Expand Down Expand Up @@ -447,7 +513,7 @@
{
"aliasColors": {},
"bars": false,
"datasource": "${DS_HOST}",
"datasource": "${DS_LOCAL}",
"fill": 1,
"id": 3,
"legend": {
Expand All @@ -473,12 +539,12 @@
"steppedLine": false,
"targets": [
{
"expr": "mc_loaded_chunks_total",
"expr": "mc_loaded_chunks",
"intervalFactor": 2,
"legendFormat": "{{world}}",
"metric": "mc_loaded_chunks_total",
"refId": "A",
"step": 2
"step": 120
}
],
"thresholds": [],
Expand Down Expand Up @@ -531,9 +597,9 @@
{
"aliasColors": {},
"bars": false,
"datasource": "${DS_HOST}",
"datasource": "${DS_LOCAL}",
"fill": 1,
"id": null,
"id": 4,
"legend": {
"avg": false,
"current": false,
Expand All @@ -557,12 +623,12 @@
"steppedLine": false,
"targets": [
{
"expr": "mc_entities_total",
"expr": "mc_entities",
"intervalFactor": 2,
"legendFormat": "{{world}}_total",
"metric": "mc_entities_total",
"refId": "A",
"step": 4
"step": 240
}
],
"thresholds": [],
Expand Down Expand Up @@ -603,7 +669,7 @@
{
"aliasColors": {},
"bars": false,
"datasource": "Local",
"datasource": "${DS_LOCAL}",
"fill": 1,
"id": 10,
"legend": {
Expand All @@ -629,12 +695,12 @@
"steppedLine": false,
"targets": [
{
"expr": "mc_tile_entities_total{group=\"dw20\"}",
"expr": "mc_tile_entities",
"intervalFactor": 2,
"legendFormat": "{{world}}_total",
"metric": "mc_entities_total",
"refId": "A",
"step": 4
"step": 240
}
],
"thresholds": [],
Expand Down Expand Up @@ -690,7 +756,7 @@
"list": []
},
"time": {
"from": "now-30m",
"from": "now-24h",
"to": "now"
},
"timepicker": {
Expand Down Expand Up @@ -719,6 +785,6 @@
]
},
"timezone": "browser",
"title": "Minecraft",
"version": 6
"title": "Minecraft Server",
"version": 14
}
54 changes: 54 additions & 0 deletions src/main/java/de/sldk/mc/prometheusexporter/JettyNullLogger.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package de.sldk.mc.prometheusexporter;

import org.eclipse.jetty.util.log.Logger;

public class JettyNullLogger implements Logger {
public String getName() {
return "Jetty";
}

public void warn(String s, Object... objects) {
}

public void warn(Throwable throwable) {
}

public void warn(String s, Throwable throwable) {
}

public void info(String s, Object... objects) {
}

public void info(Throwable throwable) {
}

public void info(String s, Throwable throwable) {
}

public boolean isDebugEnabled() {
return false;
}

public void setDebugEnabled(boolean b) {
}

public void debug(String s, Object... objects) {
}

public void debug(String msg, long value) {

}

public void debug(Throwable throwable) {
}

public void debug(String s, Throwable throwable) {
}

public Logger getLogger(String s) {
return this;
}

public void ignore(Throwable throwable) {
}
}
Loading

0 comments on commit 434bd49

Please sign in to comment.