The configuration parameters for sending metrics to Prometheus are as follows:
|provider||Any APM provider name available in the supported APM provider's table.|
|remoteWriteURL||The remoteWriteURL provided by your Prometheus Remote Write provider or the URL of your own self-hosted Prometheus instance, for example: http://monitoring.example.com:9090/api/v1/write.|
|credentials||The credentials provided by your Prometheus Remote Write provider. Currently only bearer token and HTTP basic authentication mechanism are supported, as listed below. This field is optional.|
|metrics||List of built-in and custom metrics to be exported. Metric names will be validated against the Prometheus metric name conventions and non-conforming metrics will be ignored.|
|includeDefaultMetrics||If set, the export will include the default metrics. Default is true.|
|resampleRate||The rate by which the metrics are resampled and sent to the APM provider in seconds. Default is 3 and acceptable values are integers between 1 and 10.|
|includeTestRunId||If set, the test_run_id will be exported per each metric as an extra tag. Default is false.|
Currently only bearer token and HTTP basic authentication mechanisms are supported. To configure your authentication mechanism, populate credentials with either of these configuration parameters:
|username||The username in HTTP basic authentication.|
|password||The password in HTTP basic authentication.|
|token||The bearer token without the prefix/type.|
All the above configuration parameters are passed like this in your test run.
For sending custom metrics from your test run to New Relic's Prometheus remote write integration, follow the instructions on their documentation.
The prometheus_server parameter should be included in the remoteWriteURL configuration parameter. The bearer token can be included either as credentials.token (APM configuration parameter) or as part of the remoteWriteURL using the X-License-Key parameter, as mentioned in their documentation.
So an example configuration for New Relic might look like this, with X-License-Key used as token in credentials would be:
For sending custom metrics from your test run to Grafana Cloud's Prometheus remote write integration, follow the instructions on their documentation.
As also mentioned in their documentation, you can find the remoteWriteURL, username and password for your metrics endpoint by clicking on Details in the Prometheus card of the Grafana Cloud Portal. When you are creating an API key on Grafana Cloud Portal to be used as password, make sure to use MetricsPublisher as role.
An example configuration for Grafana Cloud might look like this: