Sharpening my Golang skills with coding challenges and skunkworks.
Some packages are only executed as unit tests, others can be run as commands using the
-c <command>
argument. The -l
argument will list the available commands.
docker build -t go-sharpen-blade .
- Build the Docker imagedocker run go-sharpen-blade
- Run without arguments
OR
docker run go-sharpen-blade /app/go-sharpen-blade <args>
- Run with the given arguments
go run ./main <args>
- Run the main.go file with the given arguments
Argument | Description |
---|---|
-c <command> |
Command to run |
-d <directory> |
Working directory |
-h | --help |
Print the help message |
-l |
List commands |
-lt |
Log with timestamps (UTC) |
-o11y-prometheus |
Enable Prometheus metrics |
When run with -o11y-prometheus -c <command>
, prometheus metrics are exposed on :2112/metrics
.
The program will wait for 20 seconds before exiting, so that the metrics can be scraped.
prometheus.yml
:
scrape_configs:
- job_name: sharpen_blade
scrape_interval: 10s
static_configs:
- targets:
- localhost:2112