{"id":15221610,"url":"https://github.com/googlecloudplatform/prometheus-engine","last_synced_at":"2025-05-15T01:06:52.218Z","repository":{"id":37070546,"uuid":"381500711","full_name":"GoogleCloudPlatform/prometheus-engine","owner":"GoogleCloudPlatform","description":"Google Cloud Managed Service for Prometheus libraries and manifests.","archived":false,"fork":false,"pushed_at":"2025-05-09T18:17:43.000Z","size":167976,"stargazers_count":212,"open_issues_count":71,"forks_count":98,"subscribers_count":44,"default_branch":"main","last_synced_at":"2025-05-09T18:45:58.939Z","etag":null,"topics":["gcp","golang","kubernetes","prometheus"],"latest_commit_sha":null,"homepage":"https://g.co/cloud/managedprometheus","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/GoogleCloudPlatform.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-06-29T21:25:07.000Z","updated_at":"2025-05-09T10:42:48.000Z","dependencies_parsed_at":"2025-05-09T18:51:20.164Z","dependency_job_id":null,"html_url":"https://github.com/GoogleCloudPlatform/prometheus-engine","commit_stats":{"total_commits":896,"total_committers":46,"mean_commits":19.47826086956522,"dds":0.8069196428571428,"last_synced_commit":"584732e30ffbd3789621b1ec7e8b3d22c8a66b6b"},"previous_names":[],"tags_count":143,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fprometheus-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fprometheus-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fprometheus-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fprometheus-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoogleCloudPlatform","download_url":"https://codeload.github.com/GoogleCloudPlatform/prometheus-engine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254041,"owners_count":22039792,"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":["gcp","golang","kubernetes","prometheus"],"created_at":"2024-09-28T15:06:26.116Z","updated_at":"2025-05-15T01:06:47.202Z","avatar_url":"https://github.com/GoogleCloudPlatform.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prometheus Engine\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/GoogleCloudPlatform/prometheus-engine)](https://goreportcard.com/report/github.com/GoogleCloudPlatform/prometheus-engine)\n[![GoDoc](https://pkg.go.dev/badge/github.com/GoogleCloudPlatform/prometheus-engine?status.svg)](https://pkg.go.dev/github.com/GoogleCloudPlatform/prometheus-engine?tab=doc)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/GoogleCloudPlatform/prometheus-engine)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n![Build status](https://github.com/GoogleCloudPlatform/prometheus-engine/actions/workflows/presubmit.yml/badge.svg)\n\nThis repository contains various binaries and packages for client-side usage\nof Google Cloud Managed Service for Prometheus (GMP), a managed Prometheus offering on top\nof Google Cloud Monitoring (GCM).\n\nFor more documentation and to get started, go to [g.co/cloud/managedprometheus](https://g.co/cloud/managedprometheus).\n\n## Binaries\n\n* **[config-reloader](cmd/config-reloader)**: An auxiliary binary to initiate reload on configuration file changes.\n* **[frontend](cmd/frontend)**: An authorizing proxy for the Prometheus-compatible query API of GMP. It additionally hosts a query UI.\n* **[operator](cmd/operator)**: A Kubernetes operator for managed metric collection for GMP.\n* **[rule-evaluator](cmd/rule-evaluator)**: A Prometheus rule evaluation engine that evaluates against GMP.\n* **[datasource-syncer](cmd/datasource-syncer)**: A cron job for periodic Oauth2 token injection to Grafana Prometheus datasource.\n\nFor the fully Prometheus-compatible binary that writes ingested data into GMP/GCM,\nsee [GoogleCloudPlatform/prometheus](https://github.com/GoogleCloudPlatform/prometheus).\n\n## Docker Images\n\nImages for this repo are regularly released [in the GKE release GCR](https://console.cloud.google.com/gcr/images/gke-release/global[main.go](cmd%2Fdatasource-syncer%2Fmain.go)/prometheus-engine).\n\n## Development\n\n### Dependencies\n\nIn order to best develop and contribute to this repository, the following dependencies are\nrecommended:\n1. [`go`](https://golang.org/doc/install)\n2. [`gcloud`](https://cloud.google.com/sdk/docs/install)\n3. [`kubectl`](https://kubernetes.io/docs/tasks/tools/)\n\nCan be also installed via:\n\n```bash\ngcloud components install kubectl\n```\n4. [`Docker`](https://docs.docker.com/get-docker/) with\n   [`buildx`](https://docs.docker.com/build/architecture/#install-buildx) plugin.\n\nIf you want to execute docker containers on remote machine you can run:\n\n```bash\ngcloud alpha cloud-shell ssh --authorize-session -- -nNT -L `pwd`/docker.sock:/var/run/docker.sock\n\n# Then in separate terminal.\nexport DOCKER_HOST=unix://docker.sock\n```\n\n5. For UI development or update (e.g. to resolve UI security issue), `npm` is\n   required. See [pkg/ui documentation](pkg/ui/README.md) for details.\n\n### Presubmit\n\n`make presubmit` regenerates all resources, builds all images and runs all tests.\n\nSteps from presubmit are validated on the CI, but feel free to run it if you see\nCI failures related to regenerating resources or when you want to do local check\nbefore submitting.\n\nRun `CHECK=1 make presubmit` to fail the command if repo state is not clean after\npresubmit (might require committing the changes).\n\n### Building\n\nRun `make help` shows a list of candidate targets with documentation.\n\nAny go application in `./cmd/` with an associated `main.go`, e.g. `./cmd/operator/main.go`\nis a candidate for build by running, for example:\n\n```bash\nmake operator\nmake frontend\nmake rule-evaluator\nmake config-reloader\n```\n\nThis also includes example Go apps from `/examples/instrumentation/`:\n\n```bash\nmake go-synthetic\n```\n\nRunning `make bin` will build all of the above go binaries.\n* Setting `NO_DOCKER=1` here will build all the binaries natively on the host machine.\n\n### Testing\n\n#### Unit\n\nTo run unit tests locally, use `go test`, your IDE or `NO_DOCKER=1 make test`.\n\nTo run unit tests from docker container run `make test`\n\n#### Kubernetes End-to-end tests\n\nRunning `make e2e` will run e2e tests against Kubernetes cluster:\n* By default, it run in hermetic docker container, downloads kind, recreates\n  a single node kind cluster and runs [e2e](./e2e) tests against it.\n* To run a single test, use the `TEST_RUN` environment variable. For example, to run all collector tests, pass `TEST_RUN=TestCollector`:\n\n```bash\nTEST_RUN=TestCollector make e2e\n```\n\n##### Debugging\n\nIn docker mode, to run a single test or debug a cluster during or after failed\ntest, you can try entering shell of the `kindtest` container. Before doing so,\nrun `make e2e` to setup `kind` and start a cluster.\n\nTo enter shell with kind Kubernetes context, (ensure your docker socket is on\n`/var/run/docker.sock`):\n\n```bash\ndocker run --network host --rm -it \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v `pwd`/e2e:/build/e2e gmp/kindtest bash\n```\n\nTo access kind Kubernetes (e.g. to list pods) run:\n\n```bash\nkind export kubeconfig\nkubectl get po\n```\n\nTo execute a single test e.g. `TestAlertmanagerDefault` you can do (in `kindtest` shell):\n\n```bash\nkind export kubeconfig\ngo test -v ./e2e -run \"TestAlertmanagerDefault\" -args -project-id=test-proj -cluster=test-cluster -location=test-loc -skip-gcm\n```\n\nEach test case is creating a separate set of namespaces e.g.\n`gmp-test-testalertmanagerdefault-20230714-120756` and\n`gmp-test-testalertmanagerdefault-20230714-120756-pub`, so to debug tests you\nhave to ensure those namespaces are not cleaned. You can also provide\n`time.Sleep` in the place you want debug in.\n\n##### Benchmarking\n\nSee [BENCHMARK.md](./BENCHMARK.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglecloudplatform%2Fprometheus-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglecloudplatform%2Fprometheus-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglecloudplatform%2Fprometheus-engine/lists"}