heartbeats

command module
v0.4.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README

Heartbeats

heartbeats.png

Small helper service to monitor heartbeats (repeating "pings" from other systems). If a "ping" does not arrive in the given interval & grace period, Heartbeats will send notifications.

Flags

  -c, --config string      Path to Heartbeats config file (default "./config.yaml")
  -d, --debug              Verbose logging.
  -t, --trace              More verbose logging.
  -j, --json-log           Output logging as json.
  -v, --version            Print the current version and exit.
      --host string        Host of Heartbeat service. (default "127.0.0.1")
  -p, --port int           Port to listen on (default 8090)
  -s, --site-root string   Site root for the heartbeat service (default "http://host:port")
  -m, --max-size int       Max Size of History Cache per Heartbeat (default 500)
  -r, --reduce int         Reduce Max Size of History Cache by this value if it exceeds the Max Size (default 100)
  -h, --help               help for heartbeat

Endpoints

Path Method Description
/ GET Home Page
/config GET Shows current configuration
/ping/{HEARTBEAT} GET, POST Resets timer at configured interval
/ping/{HEARTBEAT}/fail GET, POST Mark heartbeat as failed
/status GET Returns current status of all Heartbeats
/status/{HEARTBEAT} GET Returns current status of Heartbeat
/history GET Show history of all Heartbeats
/history/{HEARTBEAT} GET Show history of Heartbeat
/metrics GET Entrypoint for prometheus metrics
/healthz GET Show if Heartbeats is healthy
/version GET Show version of Heartbeats server

Add the query output=json|yaml|text to receive the response in the corresponding format.

Configuration

Heartbeats and notifications must be configured in a file. The config file can be yaml, json or toml. The config file should be loaded automatically if changed. Please check the log output to control if the automatic config reload works in your environment. If interval and grace where changed, they will be reset to the corresponding new value!

Deployment

Download the binary and update the example config.yaml according your needs. If you prefer to run heartbeats in docker, you find a docker-compose.yaml & config.yaml here. For a kubernetes deployment you find the manifests here.

Notification

Heartbeat uses the library https://github.com/containrrr/shoutrrr/ for notifications. See their documentation for how to generate the necessary url.

Documentation

Start heartbeats and go to the url http://localhost:8090/docs.

Documentation

Overview

Copyright © 2022 containeroo https://github.com/containeroo

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
ago

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL