This repository contains the Typesense-Prometheus-Exporter, a tool designed to expose Typesense metrics and stats in Prometheus format.
Typesense is an open-source, typo-tolerant search engine that delivers fast and relevant search results. It's designed for simplicity and ease of use, providing a scalable, highly available, and easy-to-scale search solution.
Prometheus is an open-source systems monitoring and alerting toolkit. Known for its multi-dimensional data model and flexible query language, Prometheus integrates with various external systems for comprehensive monitoring.
Prometheus exporters are tools for translating metrics from third-party systems into Prometheus-readable format, crucial for monitoring non-Prometheus systems with Prometheus.
This exporter fetches metrics and stats from a configured Typesense instance and exports them in Prometheus format, enabling their consumption by a Prometheus time series database server.
To pull the Typesense-Prometheus-Exporter image from Docker Hub:
docker pull imatefx/typesense-prometheus-exporter
To run the exporter in a Docker container, use the following command:
docker run --name="example-ts-prom-exp" \
-e "TYPESENSE_HOST=tshost.example.com" \
-e "TYPESENSE_PROTOCOL=http" \
-e "TYPESENSE_API_KEY=tsAPIKEY" \
-e "TYPESENSE_PORT=8108" \
-p 8888:8888 \
imatefx/typesense-prometheus-exporter
This command sets up the Typesense-Prometheus-Exporter with the necessary environment variables and starts the exporter service on exposed port 8888
.
Run the exporter with the necessary options:
typesense-prometheus-exporter [OPTIONS] --typesense-host <TYPESENSE_HOST> --typesense-api-key <TYPESENSE_API_KEY>
--typesense-host <TYPESENSE_HOST>
: Typesense Host URL (env: TYPESENSE_HOST).--typesense-protocol <TYPESENSE_PROTOCOL>
: Typesense protocol (env: TYPESENSE_PROTOCOL, default: http).--typesense-api-key <TYPESENSE_API_KEY>
: Typesense API key (env: TYPESENSE_API_KEY).--typesense-port <TYPESENSE_PORT>
: Typesense port number (env: TYPESENSE_PORT, default: 8108).--exporter-bind-address <EXPORTER_BIND_ADDRESS>
: Internal server bind address (env: EXPORTER_BIND_ADDRESS, default: 0.0.0.0).--exporter-bind-port <EXPORTER_BIND_PORT>
: Internal server bind port (env: EXPORTER_BIND_PORT, default: 8888).
-h, --help
: Display help.-V, --version
: Display version.
- Add logging
- Code cleanup