A golang based Prometheus metrics exporter for Catchpoint
Catchpoint Prometheus Exporter allows you to integrate Catchpoint's Tests Data Webhook into Prometheus, enabling you to monitor performance metrics directly through your Prometheus setup.
The exporter is configurable via command-line flags or environment variables. Here are the key configuration options:
--port
orCATCHPOINT_EXPORTER_PORT
: Sets the port on which the exporter will run (default:9090
).--webhook-path
orCATCHPOINT_WEBHOOK_PATH
: Defines the path where the exporter will receive webhook data from Catchpoint (default:/catchpoint-webhook
).--verbose
orCATCHPOINT_VERBOSE
: Enables verbose logging to provide more detailed output for debugging purposes (default:false
).
You can also configure the exporter using the following environment variables:
CATCHPOINT_EXPORTER_PORT
: Overrides the default port.CATCHPOINT_WEBHOOK_PATH
: Overrides the default webhook path.CATCHPOINT_VERBOSE
: Set totrue
to enable verbose logging.
The exporter provides a range of metrics, reflecting various performance aspects captured by Catchpoint. A complete list of available metrics can be found in the file /collector/testdata/all_metrics.prom.
To receive data from Catchpoint, you need to set up a webhook that points to the URL where this exporter is running. Follow these steps to configure the webhook in Catchpoint:
- Log in to your Catchpoint account.
- Navigate to Settings > API > Test Data Webhooks
- Click Add URL
- Set the "URL" to
http://<your_exporter_address>:<port>/catchpoint-webhook
, where<your_exporter_address>
is the IP address or domain of your server where the exporter is running, and<port>
is configured as per theCATCHPOINT_EXPORTER_PORT
. - Add a template json to target the selected metrics used in this Prometheus exporter.
- Save the webhook configuration.
Next you need to set up the webhook for tests:
- Navigate to Control Center > Tests > Select the Product Properties(or multiple) within the nav section
- Under the Product Properties section, enable the Test Data Webhook and select the Template you just created
- Next, under Navigate to Control Center > Tests you will see a list of test names
- Click on each test name you wish to monitor which brings a window up
- Under More Settings, enable the
Test Data Webhook
- Under Targeting & Scheduling, set the desired Frequency
To start the exporter, you can use the following command:
go build -o catchpoint-exporter ./cmd/catchpoint-exporter/main.go
./catchpoint-exporter --port="9090" --webhook-path="/catchpoint-webhook"
This command starts the exporter on port 9090, sets up /catchpoint-webhook
as the endpoint for receiving webhook data, and enables verbose logging.