The prometheus remote write plugin allows you to take metrics from Fluent Bit and submit them to a Prometheus server through the remote write mechanism.
Important Note: The prometheus exporter only works with metric plugins, such as Node Exporter Metrics
IP address or hostname of the target HTTP Server
Basic Auth Username
Basic Auth Password. Requires HTTP_user to be set
TCP port of the target HTTP Server
Specify an HTTP Proxy. The expected format of this value is http://host:port. Note that https is not supported yet. Please consider not setting this and use
Specify an optional HTTP URI for the target web server, e.g: /something
Add a HTTP header key/value pair. Multiple headers can be set.
Log the response payload within the Fluent Bit log
The Prometheus remote write plugin only works with metrics collected by one of the from metric input plugins. In the following example, host metrics are collected by the node exporter metrics plugin and then delivered by the prometheus remote write output plugin.
# Node Exporter Metrics + Prometheus remote write output plugin# -------------------------------------------# The following example collects host metrics on Linux and delivers# them through the Prometheus remote write plugin to new relic :#[SERVICE]Flush 1Log_level info[INPUT]Name node_exporter_metricsTag node_metricsScrape_interval 2[OUTPUT]Name prometheus_remote_writeMatch node_metricsHost metric-api.newrelic.comPort 443Uri /prometheus/v1/write?prometheus_server=YOUR_DATA_SOURCE_NAMEHeader bearer_token YOUR_LICENSE_KEYLog_response_payload TrueTls OnTls.verify On# Note : it would be necessary to replace both YOUR_DATA_SOURCE_NAME and YOUR_LICENSE_KEY# with real values for this example to work.
The following are examples of using Prometheus remote write with hosted services below
With Grafana Cloud hosted metrics you will need to use the specific host that is mentioned as well as specify the HTTP username and password given within the Grafana Cloud page.
[OUTPUT]name prometheus_remote_writehost prometheus-us-central1.grafana.netmatch *uri /api/prom/pushport 443tls ontls.verify onhttp_user <GRAFANA Username>http_passwd <GRAFANA Password>
With Logz.io hosted prometheus you will need to make use of the header option and add the Authorization Bearer with the proper key. The host and port may also differ within your specific hosted instance.
[OUTPUT]name prometheus_remote_writehost listener.logz.ioport 8053match *header Authorization Bearer <LOGZIO Key>tls ontls.verify onlog_response_payload true
With Coralogix Metrics you may need to customize the URI. Additionally, you will make use of the header key with Coralogix private key.
[OUTPUT]name prometheus_remote_writehost metrics-api.coralogix.comuri prometheus/api/v1/write?appLabelName=path&subSystemLabelName=path&severityLabelName=severitymatch *port 443tls ontls.verify onheader Authorization Bearer <CORALOGIX Key>