https://github.com/joonas-fi/hellohttp
Hello world -style HTTP application with Prometheus metrics
https://github.com/joonas-fi/hellohttp
example-code prometheus-metrics
Last synced: about 1 month ago
JSON representation
Hello world -style HTTP application with Prometheus metrics
- Host: GitHub
- URL: https://github.com/joonas-fi/hellohttp
- Owner: joonas-fi
- License: apache-2.0
- Created: 2018-12-21T12:30:20.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-05-28T10:10:06.000Z (11 months ago)
- Last Synced: 2025-01-26T17:14:04.923Z (3 months ago)
- Topics: example-code, prometheus-metrics
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

A hello world HTTP server with Prometheus metrics.
When deploying, specify (service-level) ENV variable `METRICS_ENDPOINT=/metrics` to
optionally expose metrics automatically with
[promswarmconnect](https://github.com/joonas-fi/hellohttp).Example
-------```
$ docker service create \
--name hellohttp \
--env "METRICS_ENDPOINT=/metrics" \
--network yourNetwork \
--publish 8012:80 \
"ghcr.io/joonas-fi/hellohttp:VERSION"
```Replace VERSION with a tag from Docker Hub link from top of this document.
You can now access http://localhost:8012/
Metrics are at http://localhost:8012/metrics (look for `requests_served`).
If you're using promswarmconnect, `requests_served` should now be queryable from Prometheus.