Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fwiedmann/heartbeat
Simple HTTP endpoint with Prometheus metrics
https://github.com/fwiedmann/heartbeat
endpoint golang healthcheck heartbeat metrics prometheus
Last synced: about 23 hours ago
JSON representation
Simple HTTP endpoint with Prometheus metrics
- Host: GitHub
- URL: https://github.com/fwiedmann/heartbeat
- Owner: fwiedmann
- License: mit
- Created: 2019-08-08T19:32:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T21:33:52.000Z (over 3 years ago)
- Last Synced: 2024-10-28T09:55:48.206Z (about 2 months ago)
- Topics: endpoint, golang, healthcheck, heartbeat, metrics, prometheus
- Language: Go
- Size: 412 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Heartbeat
Simple HTTP healthcheck endpoint with Prometheus metrics
Latest release
·
Docker Hub
·
Report bug
·
Request feature
![badge](https://action-badges.now.sh/fwiedmann/heartbeat)
## Table of contents
- [Quick start](#quick-start)
- [Avialable flags](#available-flags)
- [Metrics](#metrics)
- [Custom Configuration](#custom-configuration)
- [Options description](#options-description)
- [Build](#build)
- [Copyright and license](#copyright-and-license)## Quick start
Deploy Heartbeat to your Kubernetes cluster
```bash
kubectl apply -f https://raw.githubusercontent.com/fwiedmann/heartbeat/master/k8s/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/fwiedmann/heartbeat/master/k8s/configMap.yaml
kubectl apply -f https://raw.githubusercontent.com/fwiedmann/heartbeat/master/k8s/deployment.yaml
```Run Heartbeat as single Docker container with / without config.yaml
```bash
docker run --rm -d -p 8080:8080 -p 9100:9100 wiedmannfelix/heartbeat:latestdocker run --rm -d -p 8080:8080 -p 9100:9100 -v config.yaml:/code/config.yaml wiedmannfelix/heartbeat:latest
```Run Heartbeat binary directly on your host
```bash
wget https://github.com/fwiedmann/heartbeat/releases/download/1.0.0/heartbeatchmod +x heartbeat
./heartbeat &
```## Available flags
```bash
Usage:
Heartbeat [flags]Flags:
--config string config file for endpoint configuration (default "./config.yaml")
-h, --help help for Heartbeat
--loglevel string Set loglevel. Default is info (default "info")
```## Metrics
| Metric | Type | Description |
| --------------------------------------- | ----- | -------------------------------------- |
| heartbeat_version{version=""} | Gauge | Prints the latest version of Heartbeat |
| heartbeat_requester{host="", method=""} | Gauge | Counter of request by each requester |
| heartbeat_total_requests{method=""} | Gauge | Total Number of requests |## Custom Configuration
Basic config file:
```yaml
heartbeatEndpoint:
port: 8080
path: "/heartbeat"
responseCode: 200
responseMessage: "OK"
metricsEndpoint:
enabled: true
port: 9100
path: "/metrics"
```### Options description
| Endpoint | Option | Type | Default vaule |
| --------- | ---------------- | ------ | ------------- |
| Heartbeat | path | srting | "/heartbeat" |
| Heartbeat | port | int | 8080 |
| Heartbeat | response message | srting | "OK" |
| Heartbeat | response code | int | 200 |
| Metrics | path | srting | "/metrics" |
| Metrics | port | int | 9100 |
| Metrics | enabled | bool | true |## Build
```bash
make build# or
go build -o heartbeat -ldflags "-X main.HeartbeatVersion="
```## Copyright and license
[MIT License](https://reponame/blob/master/LICENSE).