{"id":13715769,"url":"https://github.com/kinduff/csgo_exporter","last_synced_at":"2025-05-07T03:47:10.843Z","repository":{"id":46588624,"uuid":"350064320","full_name":"kinduff/csgo_exporter","owner":"kinduff","description":"A Prometheus exporter for Counter-Strike: Global Offensive.","archived":false,"fork":false,"pushed_at":"2025-04-16T20:03:29.000Z","size":2177,"stargazers_count":19,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T03:47:03.087Z","etag":null,"topics":["counter-strike-global-offensive","csgo","docker","golang","grafana","grafana-dashboard","hacktoberfest","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kinduff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"kinduff","ko_fi":"kinduff","liberapay":"kinduff"}},"created_at":"2021-03-21T17:06:39.000Z","updated_at":"2023-11-06T18:30:03.000Z","dependencies_parsed_at":"2022-07-20T04:32:21.416Z","dependency_job_id":"d24028f6-9a1d-4808-9cc4-28b4435c154f","html_url":"https://github.com/kinduff/csgo_exporter","commit_stats":{"total_commits":144,"total_committers":7,"mean_commits":"20.571428571428573","dds":0.1597222222222222,"last_synced_commit":"e4b0b0a4e7ffc5f2edf274e11c04ef50b19a8bf1"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinduff%2Fcsgo_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinduff%2Fcsgo_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinduff%2Fcsgo_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinduff%2Fcsgo_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kinduff","download_url":"https://codeload.github.com/kinduff/csgo_exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810275,"owners_count":21807759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["counter-strike-global-offensive","csgo","docker","golang","grafana","grafana-dashboard","hacktoberfest","prometheus"],"created_at":"2024-08-03T00:01:03.294Z","updated_at":"2025-05-07T03:47:10.818Z","avatar_url":"https://github.com/kinduff.png","language":"Go","funding_links":["https://github.com/sponsors/kinduff","https://ko-fi.com/kinduff","https://liberapay.com/kinduff"],"categories":[],"sub_categories":[],"readme":"![CSGO Exporter banner](extra/images/banner.png)\n\n# CSGO Exporter\n\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/kinduff/csgo_exporter?)][releases]\n[![Go Reference](https://pkg.go.dev/badge/github.com/kinduff/csgo_exporter.svg?)][godoc]\n[![Go Report Card](https://goreportcard.com/badge/github.com/kinduff/csgo_exporter?)][goreport]\n[![CodeFactor](https://www.codefactor.io/repository/github/kinduff/csgo_exporter/badge)][codefactor]\n[![Test / Build](https://github.com/kinduff/csgo_exporter/actions/workflows/ci.yml/badge.svg?branch=master)][workflow-c]\n[![Docker Pulls](https://img.shields.io/docker/pulls/kinduff/csgo_exporter.svg?)][dockerhub]\n[![GitHub all releases](https://img.shields.io/github/downloads/kinduff/csgo_exporter/total?)][releases]\n\nThis is a Prometheus exporter for [Counter-Strike: Global Offensive][csgo]. It provides statistics from diverse categories, including last matches.\n\nAn example of the output of this exporter can be found [here][metrics_example].\n\n## Grafana Dashboard\n\nThis wouldn't be an exporter without its corresponding Grafana Dashboard.\n\n![Grafana Dashboard](extra/images/grafana.png)\n\nThis dashboard can be found with the ID `14629` using the Grafana import ([dashboard link][dashboard_link]) or [here in plain text][grafana_dashboard].\n\n## Prerequisites\n\nOne of the two, depending on your running method.\n\n* [Go][go] `\u003e= 1.13`\n* [Docker][docker]\n\n## Running this exporter\n\nSee [Configuration][configuration] in order to set the necessary params to run the exporter.\n\n### Using a binary\n\nYou can download the latest version of the binary built for your architecture [here][releases].\n\n### Using Docker\n\nThe exporter is also available as a Docker image in [DockerHub][dockerhub] and [Github CR][ghcr]. You can run it using the following example and pass the configuration as environment variables:\n\n```shell\n$ docker run \\\n  --name csgo_exporter \\\n  -p 7355:7355 \\\n  -e STEAM_API_KEY=\u003cyour-api-key\u003e \\\n  -e STEAM_NAME=\u003cyour-user-name\u003e \\\n  -e STEAM_ID=\u003cyour-user-id\u003e \\\n  kinduff/csgo_exporter:latest\n```\n\nAlternative, you can use `ghcr.io/kinduff/csgo_exporter` if you want to use the Github Container Registry.\n\n### Using the source\n\nOptionally, you can download and build it from the sources. You have to retrieve the project sources by using one of the following way:\n\n```shell\n$ go get -u github.com/kinduff/csgo_exporter\n# or\n$ git clone https://github.com/kinduff/csgo_exporter.git\n```\n\nInstall the needed vendors:\n\n```shell\n$ GO111MODULE=on go mod vendor\n```\n\nThen, build the binary:\n\n```shell\n$ go build -o csgo_exporter .\n```\n\n## Configuration\n\nYou 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.\n\n| Environment variable                   | Description                                                                                         | Default                         | Required |\n| -------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------- | -------- |\n| `HTTP_PORT`                            | The port the exporter will be running the HTTP server                                               | 7355\u003csup id=\"a1\"\u003e[1](#f1)\u003c/sup\u003e |          |\n| `SCRAPE_INTERVAL`                      | Time in natural format to scrap statistics from the CS:GO APIs                                      | `15m`                           |          |\n| `STEAM_API_KEY`                        | Your personal API key from Steam, get one using [this link][steam-api]                              |                                 | Yes      |\n| `STEAM_ID` \u003csup id=\"a2\"\u003e[2](#f2)\u003c/sup\u003e | The Steam ID you want to fetch the data from for the player statistics                              |                                 | Yes      |\n| `STEAM_NAME`                           | If you don't want to provide a `STEAM_ID` you can provide your username, see the footnotes          |                                 |          |\n| `FETCH_INVENTORY`                      | Boolean to determine if the exporter should fetch the player's inventory\u003csup id=\"a3\"\u003e[3](#f3)\u003c/sup\u003e | `false`                         |          |\n| `CURRENCY`                             | The price currency to display the average cost of the player inventory items                        | EUR                             |          |\n\n## Available Prometheus metrics\n\n| Metric name                  | Description                                                                                            |\n| ---------------------------- | ------------------------------------------------------------------------------------------------------ |\n| `csgo_stats_metric`          | All the stats from the player, it includes last_match data, totals per weapon, among other cool things |\n| `csgo_total_kills_metric`    | Total kills from a player per weapon                                                                   |\n| `csgo_total_shots_metric`    | Total shots from a player per weapon                                                                   |\n| `csgo_total_hits_metric`     | Total hits from a player per weapon                                                                    |\n| `csgo_achievements_metric`   | All achievements done by the player, with value `1` or `0` for achieved or not                         |\n| `csgo_playtime_metric`       | Hours spent playing the game in minutes in different types, includes stats for each OS                 |\n| `csgo_news_metric`           | The latest news from the CS: GO community, can be used in a table. Value is an epoch                   |\n| `csgo_user_inventory_metric` | The player's inventory and the cost of each item. Value is the average cost in the desired currency.   |\n\n## Contributors\n\nThanks goes to these wonderful people who had contributed to the project:\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://blog.simonszu.de\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/700707?v=4?s=100\" width=\"100px;\" alt=\"Simon Szustkowski\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSimon Szustkowski\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#content-simonszu\" title=\"Content\"\u003e🖋\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://olegzaytsev.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1511481?v=4?s=100\" width=\"100px;\" alt=\"Oleg Zaytsev\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eOleg Zaytsev\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#content-colega\" title=\"Content\"\u003e🖋\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/phyzical\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/5182053?v=4?s=100\" width=\"100px;\" alt=\"Jack\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJack\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/kinduff/csgo_exporter/commits?author=phyzical\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## Footnotes\n\n* \u003cb id=\"f1\"\u003e[1]\u003c/b\u003e: This port is being assigned for fun, since the bomb code from Counter Strike is `7355608`.\n* \u003cb id=\"f2\"\u003e[2]\u003c/b\u003e: Please note that the `STEAM_ID` environment variable is not required if you provide a `STEAM_NAME`. If you want to save 1 HTTP call, provide both variables.\n* \u003cb id=\"f3\"\u003e[3]\u003c/b\u003e: Inventory should be public, if it's not, the request will fail and the program will exit.\n\n[codefactor]: https://www.codefactor.io/repository/github/kinduff/csgo_exporter\n[configuration]: #configuration\n[csgo]: https://store.steampowered.com/app/730/CounterStrike_Global_Offensive\n[docker]: https://docs.docker.com\n[dockerhub]: https://hub.docker.com/r/kinduff/csgo_exporter\n[ghcr]: #ghcr\n[go]: https://golang.org\n[godoc]: https://pkg.go.dev/github.com/kinduff/csgo_exporter\n[goreport]: https://goreportcard.com/report/github.com/kinduff/csgo_exporter\n[releases]: https://github.com/kinduff/csgo_exporter/releases\n[steam-api]: https://steamcommunity.com/dev/apikey\n[workflow-c]: https://github.com/kinduff/csgo_exporter/actions/workflows/ci.yml\n[metrics_example]: extra/metrics_example.txt\n[dashboard_link]: https://grafana.com/grafana/dashboards/14629\n[grafana_dashboard]: extra/grafana_dashboard.json\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinduff%2Fcsgo_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkinduff%2Fcsgo_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinduff%2Fcsgo_exporter/lists"}