You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `--typesense-api-key` | `TYPESENSE_API_KEY` | *(none)*| Your Typesense API key. |
66
-
| `--typesense-metrics-url` | `TYPESENSE_METRICS_URL` | `https://localhost:8108/metrics.json` | The full URL to `metrics.json` endpoint. |
67
-
| `--typesense-stats-url` | `TYPESENSE_STATS_URL` | `https://localhost:8108/stats.json` | The full URL to `stats.json` endpoint. |
68
-
| `--typesense-debug-url` | `TYPESENSE_DEBUG_URL` | `https://localhost:8108/debug` | The full URL to `stats.json` endpoint. |
69
-
| `--typesense-nodes` | `TYPESENSE_NODES` | `localhost:8108` | A comma-separated list of `host:port` entries for Typesense nodes (e.g., `node1:8108,node2:8108`). |
70
-
| `--verify` | `VERIFY_SSL` | `False` | Verify SSL certificates. Set `--verify` to enable, or `VERIFY_SSL=true` for environment. |
71
-
| `--port` | *(not applicable)*| `8000` | Which port the exporter will listen on for Prometheus scrapes. |
| `--typesense-api-key` | `TYPESENSE_API_KEY` | _(none)_ | Your Typesense API key. |
58
+
| `--typesense-metrics-url` | `TYPESENSE_METRICS_URL` | `https://localhost:8108/metrics.json` | The full URL to `metrics.json` endpoint. |
59
+
| `--typesense-stats-url` | `TYPESENSE_STATS_URL` | `https://localhost:8108/stats.json` | The full URL to `stats.json` endpoint. |
60
+
| `--typesense-debug-url` | `TYPESENSE_DEBUG_URL` | `https://localhost:8108/debug` | The full URL to `stats.json` endpoint. |
61
+
| `--typesense-nodes` | `TYPESENSE_NODES` | `localhost:8108` | A comma-separated list of `host:port` entries for Typesense nodes (e.g., `node1:8108,node2:8108`). |
62
+
| `--verify` | `VERIFY_SSL` | `False` | Verify SSL certificates. Set `--verify` to enable, or `VERIFY_SSL=true` for environment. |
63
+
| `--port` | _(not applicable)_ | `8000` | Which port the exporter will listen on for Prometheus scrapes. |
72
64
73
65
> **Tip**: Command-line arguments override environment variables, which override the defaults.
74
66
75
67
## How It Works
76
68
77
-
* The script registers a custom TypesenseCollector with Prometheus.
78
-
* Every time Prometheus sends a GET request to /metrics:
79
-
* The collector fetches /metrics.json, /stats.json, and the list of collections from the configured Typesense node(s).
80
-
* Each field is converted to a Prometheus metric and yielded dynamically.
69
+
-The script registers a custom TypesenseCollector with Prometheus.
70
+
-Every time Prometheus sends a GET request to /metrics:
71
+
-The collector fetches /metrics.json, /stats.json, and the list of collections from the configured Typesense node(s).
72
+
-Each field is converted to a Prometheus metric and yielded dynamically.
81
73
82
74
This design guarantees that metrics are always up-to-date at scrape time (with no in-memory caching or stale metrics).
83
75
84
76
## Customization
85
-
* Modify `_collect_metrics_json` or `_collect_stats_json` to handle additional fields or parse additional endpoints as needed.
86
-
* Adjust `_sanitize_metric_name` if you want to add or remove transformations for metric names.
87
-
* Wrap the exporter in Docker or a systemd service to manage it in production environments.
88
77
78
+
- Modify `_collect_metrics_json` or `_collect_stats_json` to handle additional fields or parse additional endpoints as needed.
79
+
- Adjust `_sanitize_metric_name` if you want to add or remove transformations for metric names.
80
+
- Wrap the exporter in Docker or a systemd service to manage it in production environments.
89
81
90
82
## License
91
83
92
-
This exporter is released under the MIT License. See LICENSE for details (or replace with your preferred license).
84
+
This exporter is released under the MIT License. See LICENSE for details (or replace with your preferred license).
0 commit comments