Sign inSign up

kinduff/csgo_exporter

By kinduff

Updated about 5 years ago

A Prometheus exporter for Counter-Strike: Global Offensive.

Image
0

2.2K

kinduff/csgo_exporter repository overview

CSGO Exporter

GitHub release (latest by date) Go Reference Go Report Card CodeFactor Test / Build Docker Pulls GitHub all releases

This is a Prometheus exporter for Counter-Strike: Global Offensive. It provides statistics from diverse categories, including last matches.

Prerequisites

One of the two, depending on your running method.

Running this exporter

See Configuration in order to set the necessary params to run the exporter.

Using a binary

You can download the latest version of the binary built for your architecture here.

Using Docker

The exporter is also available as a Docker image in DockerHub and Github CR. You can run it using the following example and pass the configuration as environment variables:

$ docker run \
  --name csgo_exporter \
  -p 7355:7355 \
  -e STEAM_API_KEY=<your-api-key> \
  -e STEAM_NAME=<your-user-name> \
  -e STEAM_ID=<your-user-id> \
  kinduff/csgo_exporter:latest

Alternative, you can use ghcr.io/kinduff/csgo_exporter if you want to use the Github Container Registry.

Using the source

Optionally, you can download and build it from the sources. You have to retrieve the project sources by using one of the following way:

$ go get -u github.com/kinduff/csgo_exporter
# or
$ git clone https://github.com/kinduff/csgo_exporter.git

Install the needed vendors:

$ GO111MODULE=on go mod vendor

Then, build the binary:

$ go build -o csgo_exporter .

Configuration

You can use both environment variables or parameters in both the binary or the docker image. If you wish to use parameters, simply invoke the same environment variable but in downcase, or use the flag --help for more information.

Environment variableDescriptionDefaultRequired
HTTP_PORTThe port the exporter will be running the HTTP server73551
STEAM_API_KEYYour personal API key from Steam, get one using this linkYes
STEAM_ID 2The Steam ID you want to fetch the data from for the player statisticsYes
STEAM_NAMEIf you don't want to provide a STEAM_ID you can provide your username, see the footnotes

Available Prometheus metrics

Metric nameDescription
csgo_stats_metricAll the stats from the player, it includes last_match data, totals per weapon, among other cool things
csgo_achievements_metricAll achievements done by the player, with value 1 or 0 for achieved or not
csgo_playtime_metricHours spent playing the game in minutes in different types, includes stats for each OS
csgo_news_metricThe latest news from the CS: GO community, can be used in a table. Value is an epoch

Footnotes

  • [1]: This port is being assigned for fun, since the bomb code from Counter Strike is 7355608.
  • [2]: Please note that the STEAM_ID environment variable is not required if you provide a STEAM_NAME, but this will add 1 HTTP call in order to fetch the SteamID.

Tag summary

Content type

Image

Digest

Size

3.3 MB

Last updated

about 5 years ago

docker pull kinduff/csgo_exporter