Skip to content

A lightweight TCP/HTTP "Hello World!" responder, for use with Prometheus Blackbox Exporter

License

Notifications You must be signed in to change notification settings

KohlsTechnology/blackbox-helloworld-responder

Repository files navigation

Blackbox HelloWorld Responder

Build Status Go Report Card codecov Join the chat at https://gitter.im/KohlsTechnology/helloworld-responder

The blackbox-helloworld-responder's sole purpose is to respond with "Hello World!" on either a HTTP or TCP connection. It is intended to work as a simple responder for blackbox or synthetic transaction monitoring, using tools like the Prometheus Blackbox Exporter. It purposely is written very simple, so that it can run securely and with minimal resources.

License

See LICENSE for details.

Code of Conduct

See CODE_OF_CONDUCT.md for details.

Execution

The executable supports overwriting of the ports via environment variables and will log all connections to stdout.

Settings

Protocol Default Port Environment Variable
HTTP 8080 HELLO_WORLD_HTTP_PORT
TCP 8081 HELLO_WORLD_TCP_PORT

Sample process output

./blackbox-helloworld-responder

2020/07/28 13:57:39 Starting HTTP Server on 8080
2020/07/28 13:57:39 Starting TCP Server on 8081
2020/07/28 13:57:46 HTTP 127.0.0.1:60513
2020/07/28 13:57:50 TCP 127.0.0.1:60514

Testing

# HTTP
curl -v 127.0.0.1:8080

# TCP
nc 127.0.0.1 8081

Development

Binary

If you just need a local version to test, then the simplest way is to execute:

make build

Image

In order to build the docker image, simply execute:

make image

Testing

Unit Test

make test

Releasing

This project is using goreleaser. GitHub release creation is automated using GitHub Actions. New releases are automatically created when new tags are pushed to the repo.

$ TAG=v0.0.2 make tag

How to manually create a release without relying on GitHub Actions.

$ TAG=v0.0.2 make tag
$ GITHUB_TOKEN=xxx make clean release

Test Release

make test-release

About

A lightweight TCP/HTTP "Hello World!" responder, for use with Prometheus Blackbox Exporter

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published