TMP provides the remote read API, which supports organizing a series of data sources of the Prometheus protocol into a single data source for query. This document describes how to use self-built Prometheus to read data from a cloud-managed TMP instance through the remote read API.
Remote Read Configuration
The recommended configuration for
prometheus.yml is as follows:
- url: 'http://prom_ip:prom_port/api/v1/read'
It is recommended to use the Basic Auth method to access the cloud-managed TMP instance. The username is the account AppID and the password is the token obtained on Basic Info > Service Address in the Prometheus console.
global:external_labels carefully for TMP instances with remote read enabled:
external_labels will be appended to the query condition of remote read, an inaccurate label may prevent you from querying the necessary data.
filter_external_labels: false configuration item can avoid adding
external_labels to the query condition (supported in v2.34 and later).
Avoid identical series:
For two identical series, TMP will randomly select a series value at each time point to form a new series as the query result during query merging, which will lead to inaccurate query results.
Since there is no multi-copy redundant storage in the design concept of TMP, identical series will not be supported.
Remote Read Configuration Items
The configuration items in
 are optional. This document shows Prometheus v2.40 configuration, and some configuration items may be missing in lower versions. For more information, see [Prometheus official documentation](https://prometheus.io/docs/prometheus/ latest/configuration/configuration/#remote_read!6e20ad768c6d07502616bec8cb05b521).
[ name: <string> ]
[ <labelname>: <labelvalue> ... ]
[ remote_timeout: <duration> | default = 1m ]
[ <string>: <string> ... ]
[ read_recent: <boolean> | default = false ]
[ username: <string> ]
[ password: <secret> ]
[ password_file: <string> ]
[ type: <string> | default: Bearer ]
[ credentials: <secret> ]
[ credentials_file: <filename> ]
[ <oauth2> ]
[ <tls_config> ]
[ proxy_url: <string> ]
[ follow_redirects: <boolean> | default = true ]
[ enable_http2: <bool> | default: true ]
[ filter_external_labels: <boolean> | default = true ]