{"id":13565978,"url":"https://github.com/grafana/github-traffic","last_synced_at":"2025-10-19T10:31:30.492Z","repository":{"id":41875436,"uuid":"405608268","full_name":"grafana/github-traffic","owner":"grafana","description":"Github Traffic Insights as Prometheus metrics.","archived":false,"fork":false,"pushed_at":"2023-11-09T14:00:43.000Z","size":418,"stargazers_count":43,"open_issues_count":0,"forks_count":10,"subscribers_count":141,"default_branch":"main","last_synced_at":"2024-09-28T15:01:40.604Z","etag":null,"topics":["github-traffic","repository","stars"],"latest_commit_sha":null,"homepage":"","language":"Python","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/grafana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-09-12T10:13:07.000Z","updated_at":"2024-09-27T06:59:22.000Z","dependencies_parsed_at":"2024-01-15T13:35:47.381Z","dependency_job_id":null,"html_url":"https://github.com/grafana/github-traffic","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fgithub-traffic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fgithub-traffic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fgithub-traffic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fgithub-traffic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grafana","download_url":"https://codeload.github.com/grafana/github-traffic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219869249,"owners_count":16555572,"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":["github-traffic","repository","stars"],"created_at":"2024-08-01T13:01:59.321Z","updated_at":"2025-10-19T10:31:25.024Z","avatar_url":"https://github.com/grafana.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# github-traffic\nGithub Traffic collects your repository's traffic data and exposes it as Prometheus metrics.\n\n![Grafana dashboard](dashboard/screenshot.png)\n*Grafana dashboard that displays the metrics generated by Github Traffic.*\n\n## Quickstart\n\nRequirements:\n- Docker \u003e= 20.10.3\n\nTo run **github-traffic** locally you've to create a `.env` file like this one:\n\n```sh\n$ cat .env\n# Required\nGITHUB_TOKEN=your-github-token-goes-here\nORG_NAME=the-name-of-your-organization-goes-here\n# Optional\nREPO_TYPE=public-or-private # Default: public\nREPO_NAME_CONTAINS=string-to-match-repositories-with # Default: \"\"\nCRONTAB_SCHEDULE=crontab-schedule-to-get-data-from-github # Default: \"0 * * * *\"\n```\n\n**_NOTE:_** You also can use your username if you don't belong to any organization. In this case, use \"USER_NAME\" instead of \"ORG_NAME\".\n\nRun the image:\n```\n$ docker run --env-file .env -it -p 8001:8001 ghcr.io/grafana/github-traffic\nlevel=INFO msg=\"Github traffic is running!\" \nlevel=INFO msg=\"Gather insights\" repo=\"k6\" views=163 unique_views=90 clones=406 unique_clones=109 stars=13805\nlevel=INFO msg=\"Gather insights\" repo=\"postman-to-k6\" views=3 unique_views=2 clones=1 unique_clones=1 stars=238\nlevel=INFO msg=\"Gather insights\" repo=\"jmeter-to-k6\" views=1 unique_views=1 clones=2 unique_clones=2 stars=44\n...\nGo to http://localhost:8001/metrics\n```\nProfit!\n\nNow you can collect those metrics as you would do with any other service. To visualize them, we provide an example/template Grafana dashboard: https://grafana.com/grafana/dashboards/15000\n\n## Docker compose\nIn addition, a docker-compose.yaml file is provided. This file also run Prometheus and Grafana. \n\n**_NOTE:_** You've to create the .env file with you configuration. \n\nRun compose:\n```zsh\n❯ docker-compose up -d\nCreating network \"github-traffic_default\" with the default driver\nCreating github-traffic_traffic_1 ... done\nCreating github-traffic_prometheus_1 ... done\nCreating github-traffic_grafana_1    ... done\n```\n\nNow, you can access to:\n* Grafana: http://localhost:3000\n* Prometheus: http://localhost:9090\n* Github traffic:  http://localhost:8001\n\nOnce you navigate to Grafana (http://localhost:3000), the user and password are admin/admin you have to configure a datasource to Prometheus (http://prometheus:9090) and import the dashboard with id 15000. \n\nRemove containers:\n```zsh\n❯ docker-compose down\nStopping github-traffic_grafana_1    ... done\nStopping github-traffic_prometheus_1 ... done\nStopping github-traffic_traffic_1    ... done\nRemoving github-traffic_grafana_1    ... done\nRemoving github-traffic_prometheus_1 ... done\nRemoving github-traffic_traffic_1    ... done\nRemoving network github-traffic_default\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fgithub-traffic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrafana%2Fgithub-traffic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fgithub-traffic/lists"}