Go "Hello World" application with Prometheus Metrics.
521
Introducing the braveokafor/go-hello-world Docker image.
This Go application extends beyond the conventional greeting, integrating Prometheus metrics to provide insights into the operational dynamics of HTTP servers under various conditions.

/ - Greeting message endpoint./metrics - Endpoint for accessing Prometheus metrics./healthz - Endpoint providing the application’s health status.A docker-compose.yaml file is available in the project repository to facilitate the deployment of the application alongside the necessary monitoring tools.
This configuration allows for an integrated environment where the application’s metrics can be easily visualised and analysed.
Example Grafana dashboards are also provided in the repository, offering a starting point for monitoring the application’s performance and behaviour.
Download the appropriate binary for your operating system from the GitHub Releases page.
Run the `go-hello-world`` binary with desired flags, or set the environment variables before starting the utility.
| Flag | Environment Variable | Description | Default Value |
|---|---|---|---|
-port | SERVER_PORT | Port on which the server runs | 5000 |
-min-sleep | MIN_SLEEP_MS | Min sleep duration in milliseconds to simulate work | 0 |
-max-sleep | MAX_SLEEP_MS | Max sleep duration in milliseconds to simulate work | 0 |
-error-rate | ERROR_RATE | Error simulation rate | 0.0 |
-name | NAME | Name to be used in greeting | Brave |
# With flags
go-hello-world --error-rate 0.15 --max-sleep 1050 --min-sleep 0 --name Brave --port 5000
# With environment variables
export SERVER_PORT="5000"
export MAX_SLEEP_MS="1050"
export MIN_SLEEP_MS="0"
export ERROR_RATE="0.15"
export NAME="Brave"
go-hello-world
# With flags
docker run braveokafor/go-hello-world:latest --error-rate 0.15 --max-sleep 1050 --min-sleep 0 --name Brave --port 5000
# With environment variables
docker run -p 5000:5000 -e SERVER_PORT="5000" braveokafor/go-hello-world:latest
While primarily a personal project for learning and usage, suggestions and identified issues are welcomed.
Maintenance may not be continuous, but feedback will be reviewed and addressed as time allows.
For additional information, suggestions, or enquiries, please visit the project on GitHub or connect with me on LinkedIn.
The project is open-sourced under the MIT Licence, allowing for use, modification, and distribution of the code under the licence’s terms and conditions.
For detailed understanding, refer to the LICENCE file in the project repository.
Content type
Image
Digest
sha256:73aa18731…
Size
5.9 MB
Last updated
almost 3 years ago
docker pull braveokafor/go-hello-world