Sentinel Prometheus Exporter is a module which provides the Sentinel metrics data for prometheus.
You can integrate it into your Sentinel application, and then get the sentinel metrics in your prometheus.
when the prometheus server collect the sentinel metrics,it get metrics from sentinel logs
To use Sentinel Prometheus Exporter, you should add the following dependency:
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-prometheus-metric-exporter</artifactId>
<version>x.y.z</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_httpserver</artifactId>
<version>0.3.0</version>
</dependency>
scrape_configs:
- job_name: 'sentinelMetrics'
static_configs:
- targets: ['localhost:20001']
you can set system params to control the exporter behavior
the port for prometheus exporter,default 20001
the max fetch nums for prometheus exporter,in case the memory is not enough,default 1024
the delay time for fetching , may be it is still do some statistics work according to the sliding window size when fetching,
so need to set the delay time to insure the accuracy.
unit: second
default: 0
set the resource which need to fetch,default null,fetch all resources
the types need to fetch,such as passQps,concurrency
format: "xx|xx|xx"
default: "passQps|blockQps|exceptionQps|rt|concurrency"
you can reset the types as you need to,exm: "passQps|rt|concurrency|occupiedPassQps"
the type is same as the MetricNode class variables, with range: {"passQps","blockQps","successQps","exceptionQps","rt","occupiedPassQps","concurrency"}
set the appName when do PromSQL