{"id":16939983,"url":"https://github.com/kcq/poc-prometheus-metrics","last_synced_at":"2026-04-16T11:33:32.548Z","repository":{"id":70291698,"uuid":"169647993","full_name":"kcq/poc-prometheus-metrics","owner":"kcq","description":"A basic Go app with Prometheus instrumentation","archived":false,"fork":false,"pushed_at":"2019-02-11T05:12:45.000Z","size":309,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T02:52:14.474Z","etag":null,"topics":["go","golang","prometheus","prometheus-client"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kcq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2019-02-07T21:49:10.000Z","updated_at":"2019-05-10T17:42:36.000Z","dependencies_parsed_at":"2023-03-22T16:17:57.740Z","dependency_job_id":null,"html_url":"https://github.com/kcq/poc-prometheus-metrics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcq%2Fpoc-prometheus-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcq%2Fpoc-prometheus-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcq%2Fpoc-prometheus-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcq%2Fpoc-prometheus-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kcq","download_url":"https://codeload.github.com/kcq/poc-prometheus-metrics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745760,"owners_count":20503050,"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":["go","golang","prometheus","prometheus-client"],"created_at":"2024-10-13T21:05:59.740Z","updated_at":"2026-04-16T11:33:32.519Z","avatar_url":"https://github.com/kcq.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PoC - Go Service Metrics Instrumentation with Prometheus\n\nThe PoC shows how to instrument a Go service and how to create custom Prom registry and HTTP metrics handlers.\n\nThe Docker Compose config for the PoC starts Prometheus, Grafana and the instrumented PoC service.\n\nThe PoC services exposes a dummy API on port 7000. The Prometheus metrics is exposed using the `/metrics` endpoint.\n\n## Demo Steps\n\n* Build the PoC service and its container image (`make build_container` or you can build them separately with `make build_linux` and `make build_container_only`).\n* Start Docker Compose (either with `make up` or `all_up.command` in the script directory).\n* Make HTTP calls to the PoC service (`curl http://localhost:7000`).\n* Use Prom UI (`http://localhost:9090`) or Grafana (`http://localhost:3000`) to see the generated metrics\n* Access the `/metrics` endpoint (`curl http://localhost:7000/metrics`) if you want to see the raw metrics exposed by the PoC service.\n* You can observe the Docker Compose logs with `make tail`.\n* Destroy the demo containers with `make down`.\n\nNote:\n\nThe Grafana dashboard requires authentication (user: `poc`, password: `prometheus`). In addition to the preconfigured Prometheus data source the PoC Grafana is preconfigured with a simple PoC dashboard (called `PoC`), a dashboard that will show Go runtime and process info (`Go Processes`) and a couple of Prometheus dashboards (`Prometheus Stats`,`Prometheus 2.0 Stats`).\n\n### Run Standalone Service in Docker (no Prometheus and Grafana)\n\n* Build the PoC service: `make build_container`\n* Run the PoC service: `make run_container`\n* Make HTTP calls to the PoC service (`curl http://localhost:7000`)\n* Access the Prometheus metrics exposed by the service (`curl http://localhost:7000/metrics`)\n\nNote:\n\n* The `build_container` make command uses a Dockerized build, so you don't need to have Go installed locally.\n* Docker is a requirement.\n\n### Run Standalone Service Natively\n\n* Build the PoC service: `make`\n* Run the PoC service: `make run`\n* Make HTTP calls to the PoC service (`curl http://localhost:7000`)\n* Access the Prometheus metrics exposed by the service (`curl http://localhost:7000/metrics`)\n\n## Overview\n\n* `cmd/prom-metrics-service/main.go` - the PoC code\n* `configs` - Prometheus config for the PoC\n* `deployments` - Docker and Docker Compose files for the PoC\n* `scripts` - helper build and run scripts\n\n## Notes\n\nThe PoC also leverages static Go build and Docker containers build from `scratch`, so the images includes only the PoC service binary and nothing else.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcq%2Fpoc-prometheus-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkcq%2Fpoc-prometheus-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcq%2Fpoc-prometheus-metrics/lists"}