grafana查询url

1、prometheus

1.1 datasource配置

对于数据源为prometheus,一般配置为http://localhost:9090

1.2、dashborad配置

对于数据源为prometheus,直接是promql

1.3、查询的url

http://localhost:9090/api/v1/query_range?query=tenanttraffic{"name":"tenant1"}&start=1608665260&end=1608686860&step=20 HTTP1.1

其中http://localhost:9090为datasource中的配置
/api/v1/query_range?query=为grafana自动补充
tenanttraffic{“name”:“tenant1”}为dashborad中的条件
start、end为查询的时间范围
step为查询步长

2、VictoriaMetrics cluster

2.1 datasource配置

对于vmselect端口8481,一般配置为http://127.0.0.1:8481/select/0/prometheus
类型为prometheus

对于不同namespace下的服务需要指定namespace,比如default下的contract:http://contract.default:8481/

2.2、dashborad配置

直接是promql

2.3、查询的url

http://127.0.0.1:8481/select/0/prometheus/api/v1/query_range?query=tenanttraffic{"name":"tenant1"}&start=1608665260&end=1608686860&step=20 HTTP1.1

你可能感兴趣的:(telemetry)