A small Node.js service that polls Jaeger for new error traces and posts them to a Mattermost channel.
- Node.js 20 or Docker
- A running Jaeger instance
- A Mattermost incoming webhook
docker build . -t jaeger-to-mattermost
# Set the environment variables listed below and run
# Example:
# docker run -d --env-file .env -p 3005:3005 jaeger-to-mattermostnpm installCreate a .env file with the variables shown in the Configuration section and start the service:
node ./index.mjsThe service exposes a simple HTTP API (default port 3005).
GET /start– begin polling Jaeger and sending messagesGET /stop– stop polling
You may also check the root endpoint GET / for a simple status message.
The service relies on the following environment variables:
MATTERMOST_WEBHOOK_URL - URL of your Mattermost incoming webhook
JAEGAR_API_URL - Jaeger API URL (query must include service and tags)
JAEGAR_DOMAIN_URL - Base URL to Jaeger UI (used in message links)
MATTERMOST_CHANNEL_ID - Channel ID used by the webhook
PORT - (optional) HTTP port, default is 3005
Additional runtime options are defined in lib/app.mjs:
start: Date.now() - backInterval, // initial timestamp to query from
backInterval: 2 * 60000, // how far back to look for traces
requestInterval: 1 * 60000, // how often to query Jaeger
limit: 5 // maximum number of messages per cycleRun the unit tests with:
npm test- Fork this repository
- Create your feature branch:
git checkout -b my-feature - Commit your changes:
git commit -am 'Add my feature' - Push to the branch:
git push origin my-feature - Open a pull request
This project is licensed under the MIT License.