{"id":21313956,"url":"https://github.com/octopusdeploy/teamcitybuildstatsscraper","last_synced_at":"2025-08-26T23:36:48.662Z","repository":{"id":39638051,"uuid":"388633267","full_name":"OctopusDeploy/TeamCityBuildStatsScraper","owner":"OctopusDeploy","description":"| Public |  ","archived":false,"fork":false,"pushed_at":"2025-06-25T07:27:11.000Z","size":156,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-06-25T08:34:12.047Z","etag":null,"topics":["public"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OctopusDeploy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-07-23T00:25:02.000Z","updated_at":"2025-06-25T07:27:14.000Z","dependencies_parsed_at":"2023-02-05T14:46:21.696Z","dependency_job_id":"dcaa8491-d0b6-4c94-9bec-0964abb2a5d8","html_url":"https://github.com/OctopusDeploy/TeamCityBuildStatsScraper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OctopusDeploy/TeamCityBuildStatsScraper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctopusDeploy%2FTeamCityBuildStatsScraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctopusDeploy%2FTeamCityBuildStatsScraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctopusDeploy%2FTeamCityBuildStatsScraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctopusDeploy%2FTeamCityBuildStatsScraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OctopusDeploy","download_url":"https://codeload.github.com/OctopusDeploy/TeamCityBuildStatsScraper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctopusDeploy%2FTeamCityBuildStatsScraper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272267556,"owners_count":24903719,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["public"],"created_at":"2024-11-21T18:09:28.028Z","updated_at":"2025-08-26T23:36:48.639Z","avatar_url":"https://github.com/OctopusDeploy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TeamCity Build Stats Scraper\n\nThis app scrapes a TeamCity instance for some aggregated statistics and exposes them in Prometheus format on port 9090 at `\u003chostname\u003e:9090/metrics`.\n\n## Configuration\n\nThe following environment variables need to be set:\n\n- `BUILD_SERVER_URL` - The URL (or IP address) of your TeamCity instance, without `http(s)://` or trailing `/` - e.g. `buildserver.example.com` and not `https://buildserver.example.com/`\n- `TEAMCITY_TOKEN` - An [authentication token](https://www.jetbrains.com/help/teamcity/managing-your-user-account.html#Managing+Access+Tokens) for your TeamCity instance, with enough access to read build information.\n- `USE_SSL` - Whether to use SSL for connecting to TeamCity.\n\nOptionally, you can also set\n\n- `SEQ_URL` - The URL (with http/https prefix) to a seq server to log messages to\n- `SEQ_API_KEY` - If your seq server requires an api key, you can specify it here. This also allows you to modify the logging level from seq.\n\n## How to run\n\n### Console app\n\n- Install the .NET 5 SDK\n- Clone this repo\n- `dotnet publish -c Release` from the root directory\n- `cd` to `/bin/net5.0/Release/publish` and run `dotnet TeamCityBuildStatsScraper.dll`\n\n### Docker container\n\n- `docker build` the Dockerfile\n- `docker run -p 9090:9090` and provide your environment variables via `-e`\n\n## Metrics collected\n\nEvery 15 minutes, the app collects:\n\n- `muted_tests` - number of muted tests per build type, _currently filtered only to the Octopus Server project_.\n\nIn a rolling three-hour window, the app collects the below [gauges](https://prometheus.io/docs/concepts/metric_types/#gauge) every five minutes for each build type that ran at least once in the window.\n\n- `build_artifact_push_size` - mean size (in bytes) of the build artifacts pushed out from the agent\n- `build_artifact_pull_size` - mean size (in bytes) of the build artifacts pulled into the agent\n- `build_artifact_push_time` - mean time (in milliseconds) spent pushing build artifacts from the agent\n- `build_artifact_pull_time` - mean time (in milliseconds) spent pulling build artifacts into the agent\n\nEvery minute, the app collects:\n\n- `probably_hanging_builds` - number of builds that are probably hanging, per build type\n- `queued_builds_with_reason` - total number of builds queued per wait reason\n\nEvery 15 seconds, the app collects:\n- `queued_builds_wait_times_by_type` - a [Summary](https://prometheus.io/docs/concepts/metric_types/#summary) with P50, P90, and P99 values for the time spent in the queue, per build type, over a ten-minute rolling window\n\nEach gauge has a label called `buildTypeId` which matches the Build Configuration ID in TeamCity (not the numeric internal ID, but the human-readable one).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctopusdeploy%2Fteamcitybuildstatsscraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctopusdeploy%2Fteamcitybuildstatsscraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctopusdeploy%2Fteamcitybuildstatsscraper/lists"}