Coder Social home page Coder Social logo

pubgtracker_exporter's Introduction

Pubgtracker Exporter

DEPRECATED - DOESN'T WORK ANYMORE DUE TO API CHANGES AND NO PLANS TO UPDATE Dashboard

Prometheus Exporter exposing pubtracker stats.

Rating stats

PUBGTracker provides gaming stats for the PLAYERUNKNOWN'S BATTLEGROUND.

The exporter exposes the raw stats from the pubgtracker API, therefor the metrics are untyped and do not follow the Prometheus best practices.

Dashboard

You can find a ready to use dashboard in grafana/ or get it from Grafana Labs: https://grafana.com/dashboards/3287

Examples

The examples use this scrape config for nicer labels and configuration:

- job_name: 'pubg'
  static_configs:
    - targets:
      - discordianfish
      - bangpowwww
      - drdisrespect
      - shroud
      - moondye7
  relabel_configs:
    - target_label: __metrics_path__
      source_labels: [__address__]
      replacement: /metrics/${1}
    - target_label: instance
      source_labels: [__address__]
    - target_label: __address__
      replacement: 127.0.0.1:9001

Where under targets we list the players we're interested in.

"kill rate"

Kill rate

Calculate average kills per minute across all seasons

avg by (instance) ((pubgtracker_stats_kills/pubgtracker_stats_time_survived) * 60)

{instance="shroud"} 0.24515264442634924
{instance="drdisrespect"} 0.17125793695285624
{instance="moondye7"} 0.1913623025488996
{instance="bangpowwww"} 0.04702200358885065
{instance="discordianfish"} 0.0662140377518949

Average kills per day played

avg by (instance) ((pubgtracker_stats_kills/pubgtracker_stats_days))

{instance="moondye7"} 7.064513179239221
{instance="drdisrespect"} 8.723919380353863
{instance="discordianfish"} 3.5027568922305767
{instance="shroud"} 20.597288676236047
{instance="bangpowwww"} 2.525

Usage

$ ./pubgtracker_exporter &
$ curl -s localhost:8080/metrics/discordianfish | grep -i pubgtracker_stats_longest_kill
# HELP pubgtracker_stats_longest_kill Longest Kill
# TYPE pubgtracker_stats_longest_kill untyped
pubgtracker_stats_longest_kill{match="duo",region="eu",season="2017-pre2"}
342.54
pubgtracker_stats_longest_kill{match="duo",region="eu",season="2017-pre4"}
184.39
pubgtracker_stats_longest_kill{match="solo",region="eu",season="2017-pre2"}
219.08
pubgtracker_stats_longest_kill{match="solo",region="eu",season="2017-pre4"}
190.7
pubgtracker_stats_longest_kill{match="squad",region="eu",season="2017-pre2"}
367.31
pubgtracker_stats_longest_kill{match="squad",region="eu",season="2017-pre4"}
1.41

pubgtracker_exporter's People

Contributors

discordianfish avatar

Stargazers

Trent Braidner avatar [riftlab] ErgoZ avatar Felix Fröschlin avatar  avatar Conor Broderick avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

pubgtracker_exporter's Issues

collector has no descriptors

Hello,
I've cloned the git repo, build the container with 'docker build -t "pubgtracker_exporter" .' and startet it with 'docker run -d -p 8080:8080 -i -t pubgtracker_exporter'
But I always get the following error if I want to pull metrics from it:

2018/01/12 09:48:26 http: panic serving 192.168.1.184:12582: collector has no descriptors
goroutine 68 [running]:
net/http.(*conn).serve.func1(0xc42023e460)
/usr/local/go/src/net/http/server.go:1697 +0xd0
panic(0x6f8fa0, 0xc4202a4430)
/usr/local/go/src/runtime/panic.go:491 +0x283
github.com/discordianfish/pubgtracker_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*Registry).MustRegister(0xc420292c00, 0xc420107c40, 0x1, 0x1)
/go/src/github.com/discordianfish/pubgtracker_exporter/vendor/github.com/prometheus/client_golang/prometheus/registry.go:354 +0x9e
main.handler(0x914ac0, 0xc4202a09a0, 0xc42012f400, 0xc4200c1240)
/go/src/github.com/discordianfish/pubgtracker_exporter/main.go:100 +0x3ee
main.main.func1(0x914ac0, 0xc4202a09a0, 0xc42012f400)
/go/src/github.com/discordianfish/pubgtracker_exporter/main.go:180 +0x48
net/http.HandlerFunc.ServeHTTP(0xc42000f1d0, 0x914ac0, 0xc4202a09a0, 0xc42012f400)
/usr/local/go/src/net/http/server.go:1918 +0x44
net/http.(*ServeMux).ServeHTTP(0x94a940, 0x914ac0, 0xc4202a09a0, 0xc42012f400)
/usr/local/go/src/net/http/server.go:2254 +0x130
net/http.serverHandler.ServeHTTP(0xc420065520, 0x914ac0, 0xc4202a09a0, 0xc42012f400)
/usr/local/go/src/net/http/server.go:2619 +0xb4
net/http.(*conn).serve(0xc42023e460, 0x9151c0, 0xc420292b00)
/usr/local/go/src/net/http/server.go:1801 +0x71d
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2720 +0x288

I also tried another api key and with other users. Everytime the same error. Any idea?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.