Overview
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:
remote_read:
- url: 'http://prom_ip:prom_port/api/v1/read'
read_recent: true
basic_auth:
username: app_id
password: token
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. Note
Configure global:external_labels
carefully for TMP instances with remote read enabled:
As external_labels
will be appended to the query condition of remote read, an inaccurate label may prevent you from querying the necessary data.
The 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
Note
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.
url: <string>
[ name: <string> ]
required_matchers:
[ <labelname>: <labelvalue> ... ]
[ remote_timeout: <duration> | default = 1m ]
headers:
[ <string>: <string> ... ]
[ read_recent: <boolean> | default = false ]
basic_auth:
[ username: <string> ]
[ password: <secret> ]
[ password_file: <string> ]
authorization:
[ type: <string> | default: Bearer ]
[ credentials: <secret> ]
[ credentials_file: <filename> ]
oauth2:
[ <oauth2> ]
tls_config:
[ <tls_config> ]
[ proxy_url: <string> ]
[ follow_redirects: <boolean> | default = true ]
[ enable_http2: <bool> | default: true ]
[ filter_external_labels: <boolean> | default = true ]
Was this page helpful?