health-probe

command module
v0.0.0-...-de99731 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 10 Imported by: 0

README

Build and Publish

health-probe

Core part of pingchck.co, Accepts a list of urls, then periodically send a request to each and records response code and duration, and expose the results as Prometheus metrics.

List of urls can be passed using --url(short -u) flag at startup, you can also update the list during runtime using the API /urls:/urls?urls=https://pingchck.co&urls=https://s13h.xyz

API

  • /urls endpoint to update urls list: /urls?urls=https://pingchck.co&urls=https://s13h.xyz
  • /add add url to existing list during runtime: /add?url=https://pingchck.co
  • / to list current urls
  • /metrics Prometheus metrics

Metrics:

  • request_duration_seconds: a gauge of Request durations, has 3 labels: duration, response, url.

  • request_duration_seconds{duration="total"} returns the total response time of request.

    • duration label can have any of the following values:
    • dns: dns lookup time
    • connect: request connect duration
    • tls: tls handshake duration
    • first: time until first byte
    • total: Total request duration
  • response_code{response_code="200",url="https://pingchck.co"} a counter of each url response type

public docker image is available on ghcr:

docker pull ghcr.io/shadi/health-probe:latest

Test using go: go run .

The application has a number of configurable parameters, you can see them by using -h or --help:

go run . --help

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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