Document updated on Jun 13, 2021
Exporting metrics to Prometheus
Prometheus is an open-source systems monitoring and alerting toolkit.
The Opencensus exporter allows you to expose data to Prometheus. Enabling it only requires you to include in the root level of your configuration the Opencensus middleware with the prometheus exporter. Specify the port which Prometheus should hit, the namespace (optional), and Prometheus will start receiving the data.
{
"version": 2,
"extra_config": {
"github_com/devopsfaith/krakend-opencensus": {
"exporters": {
"prometheus": {
"port": 9091,
"namespace": "krakend",
"tag_host": false,
"tag_path": true,
"tag_method": true,
"tag_statuscode": false
}
}
}
}
}porton which the Prometheus exporter should listennamespacesets the domain the metric belongs to. Optional field.
Optional fields (default to false):
tag_host(bool): Whether to send the host as a metric or not.tag_path(bool): Whether to send the path as a metric or not. Client metrics are reported as:/hello/:hello/:worldand backend metrics are reported as:/{hello}/{world}. Paths are case insensitive, all metrics are reported lowercased.tag_method(bool): Whether to send the HTTP method as a metric or not.tag_statuscode(bool): Whether to send the status code as a metric or not.
See also the additional settings of the Opencensus module that can be declared.
