{"id":22741823,"url":"https://github.com/t2bot/pgo-fleet","last_synced_at":"2026-02-01T23:32:12.740Z","repository":{"id":192589307,"uuid":"683828139","full_name":"t2bot/pgo-fleet","owner":"t2bot","description":"Collect performance profiles from a fleet of Go processes","archived":false,"fork":false,"pushed_at":"2023-09-05T03:03:12.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T12:46:28.477Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/t2bot.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}},"created_at":"2023-08-27T20:30:09.000Z","updated_at":"2023-09-05T02:28:31.000Z","dependencies_parsed_at":"2023-09-05T04:11:52.856Z","dependency_job_id":null,"html_url":"https://github.com/t2bot/pgo-fleet","commit_stats":null,"previous_names":["t2bot/pgo-fleet"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/t2bot/pgo-fleet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2bot%2Fpgo-fleet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2bot%2Fpgo-fleet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2bot%2Fpgo-fleet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2bot%2Fpgo-fleet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t2bot","download_url":"https://codeload.github.com/t2bot/pgo-fleet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2bot%2Fpgo-fleet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28994918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T23:10:54.274Z","status":"ssl_error","status_checked_at":"2026-02-01T23:10:47.298Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-12-11T00:18:04.235Z","updated_at":"2026-02-01T23:32:12.719Z","avatar_url":"https://github.com/t2bot.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgo-fleet\n\nCollects profiles to enable [PGO](https://go.dev/doc/pgo) builds in Go projects. This is primarily intended for fleets\nof Go processes, either to inform better default builds in open source projects or to produce performance-tailored builds.\n\nPlease consider [donating](https://t2bot.io/donations/) to t2bot.io if you deploy this.\n\n## Architecture\n\nSomewhere, a `collector` process is deployed. Profiles are submitted to this collector for later merging/retrieval in\nthe build process. Profiles are typically sampled with the `embedded` profiler, but the collector will accept manual\nprofiles as well (such as via `curl`).\n\nWhen it's time to build the Go project, or at whatever frequency is desirable, a merged profile is requested from the\ncollector and placed into the build pipeline. It's the caller's responsibility to figure out how to get the profile into\nsaid build pipeline ;)\n\nOpen source projects can (anonymously) collect profiles from users to improve their published build artifacts, and consumers\nmight deploy their own collector to create tailored builds.\n\n## Usage: Collector\n\nThe collector provided here assumes that profiles are relatively infrequent (dozens per hour rather than dozens per second),\nand that losing some profiles is *not* a problem. For example, if the container running the collector were to crash or\nbecome unavailable due to high load, some profiles might be dropped. This shouldn't affect the PGO-enabled build too badly\nthough, provided some profiles do actually make it into the build pipeline.\n\nIt's also assumed that there is a dedicated collector process for each project. The collector will verify that what it\nreceived is in fact a CPU profile, but will not attempt to identify the Go project it is for. If multiple projects are\nsent to a single collector, the merged profiles will be extremely weird.\n\nThe collector can be run either inside private infrastructure or be exposed as public-facing via a reverse proxy. Regardless\nof what network it's servicing, only give auth keys to trusted sources. \"Trusted\" here meaning processes/people who won't\nprovide useless CPU profiles to you.\n\nNote that if exposed externally that the reverse proxy will be responsible for rate limiting. The collector will dutifully\nattempt to respond to *every* request it receives, good or bad.\n\nIf you'd like to write your own collector, see the API definitions in [`./collector/README.md`](./collector/README.md).\n\nNow that the disclaimers are out of the way, the actual collector can be configured using environment variables:\n\n```bash\n# Listening address for HTTP server.\n# In the official Docker container, this is set to \":8080\" for exposure to the host.\n# Otherwise, this defaults to the value shown here.\nexport PGOF_BIND_ADDRESS=\"127.0.0.1:8080\"\n\n# Where to store all the profiles. Process must have read and write access, and will\n# attempt to create the directory if it doesn't exist.\n# In the official Docker container, this is set to \"/data\" for mounting.\n# Otherwise, this defaults to the value shown here.\nexport PGOF_DIRECTORY=\"./profiles\"\n\n# The file which has auth keys (1 per line) that are valid for submitting profiles.\n# Note that profiles are not associated with the keys themselves, but if multiple\n# submission sources are in use then individually rotatable keys can be useful.\n# Defaults to the value shown here.\nexport PGOF_SUBMIT_AUTH_KEYS_FILE=\"/secret/submit_keys\"\n\n# Like the submit keys file above, but for the merge API instead.\n# Defaults to the value shown here.\nexport PGOF_MERGE_AUTH_KEYS_FILE=\"/secret/merge_keys\"\n```\n\nAny changes to the environment variables require the process to be restarted. This includes adding/removing/rotating keys.\n\nThis documentation does not include directions for how to deploy an HTTP service behind a reverse proxy, sorry. Once deployed\nthough, the submit URL will be at the path `/v1/submit` and merge at `/v1/merge`. See [`./collector/README.md`](./collector/README.md)\nfor more details on the API.\n\n**Tip**: When requesting a merge, set `?and_combine=true` to reduce the file count on disk.\n\nA health endpoint is exposed at `/healthz`. It will return `200 OK` with body `OK`.\n\nPre-built Docker images are available [here](https://github.com/t2bot/pgo-fleet/pkgs/container/pgo-fleet).\n\n## Usage: Embedded Profiler\n\nSee [`./embedded/README.md`](./embedded/README.md) for usage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft2bot%2Fpgo-fleet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft2bot%2Fpgo-fleet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft2bot%2Fpgo-fleet/lists"}