How do I enable metrics for external monitoring tools?
FeatureBase can be configured to output runtime metrics for the following tools:
- Expvar
- Statsd
- Prometheus (and Datadog)
Before you begin
- Learn about metrics generated by FeatureBase
- Setup one of the following as your a supported tool to receive metrics from FeatureBase:
- Obtain your service IP address to send FeatureBase metrics
Syntax
Change these parameters by editing the */featurebase/opt/featurebase.conf
file.
[metric]
service= "<metric-service>"
host="<statsd-host>"
poll-interval= "<poll-interval>"
Parameters
Parameter | Description | Required | Additional information |
---|---|---|---|
<metric-service> | FeatureBase supports: * expvar * statsd * prometheus | No | Comment out or set to "none" to disable |
<statsd-host> | Remote host to send statsd metrics | For statsd metrics | Comment out to disable |
<poll-interval> | An integer and time unit that determines how frequently FeatureBase checks for metrics | For statsd metrics and to enable runtime metrics | Comment out or set to zero to disable |
Additional information
Default FeatureBase ports
Default ports can be:
- used with CLI commands
- added to the FeatureBase configuration file
Port | Used for | Example | |
---|---|---|---|
5432 | External database for ExternalLookup queries | lookup-db-dsn = "postgres://localhost:5432/db" | |
6831 | Tracing agent | agent-host-port = "localhost:6831" | |
8125 | statsd metrics | host = "localhost:8125" | |
9093 | Ingest metrics | [metric] stats | |
10101 | FeatureBase IP address | bind = "localhost:10101" | |
10301 | FeatureBase cluster listen peer address | * listen-peer-address = "http://localhost:10301" * initial-cluster = "featurebase1=http://localhost:10301" | |
10401 | FeatureBase Cluster URL | * cluster-url = "http://localhost:10401" * listen-client-address = "http://localhost:10401" | |
20101 | Bind grpc | bind-grpc = "0.0.0.0:20101" |
Verify metrics are being generated
- Verify metrics are generated by running:
curl localhost:10101/metrics
Prometheus metrics
Add featurebase metrics to the Prometheus configuration file scrape_configs
section.
Examples
Prometheus example
Add the following to the <scrape_config>
section of the Prometheus configuration file to monitor:
- FeatureBase metrics
- Ingester metrics
- job_name: 'featurebase'
static_configs:
- targets: ['localhost:10101', 'localhost:10102', 'localhost:10103']
- job_name: 'ingester'
static_configs:
- targets: ['localhost:9093']
Add the following to the featurebase.conf
file to enable Prometheus monitoring at a 15 second interval.
[metric]
service = "prometheus"
poll-interval = "15s"