tencent cloud

TencentCloud Managed Service for Prometheus

Product Introduction
Overview
Strengths
Use Cases
Concepts
Use Limits
Features
Service Regions
Purchase Guide
Billing Overview
Pay-as-You-Go (Postpaid)
Free Trial Introduction
Managed Collector Billing Introduction
Archive Storage Billing Introduction
Purchase Methods
Payment Overdue
Getting Started
Integration Guide
Scrape Configuration Description
Custom Monitoring
EMR Integration
Java Application Integration
Go Application Integration
Exporter Integration
Nacos Integration
Common Exporter
Health Check
Instructions for Installing Components in the TKE Cluster
Cloud Monitoring
Non-Tencent Cloud Host Monitoring
Read Cloud-Hosted Prometheus Instance Data via Remote Read
Agent Self-Service Access
Pushgateway Integration
Security Group Open Description
Operation Guide
Instance
TKE
Integration Center
Data Multi-Write
Recording Rule
Instance Diagnosis
Archive Storage
Alerting Rule
Tag
Access Control
Grafana
API Guide
TKE Metrics
Resource Usage and Billing Overview
Practical Tutorial
Migration from Self-Built Prometheus
Custom Integration with CVM
TKE Monitoring
Enabling Public Network Access for TKE Serverless Cluster
Connecting TMP to Local Grafana
Enabling Public Network Access for Prometheus Instances
Configuring a Public Network Address for a Prometheus Instance
Terraform
Terraform Overview
Managing Prometheus Instances Using Terraform
Managing the Integration Center of Prometheus Instances Using Terraform
Collecting Container Monitoring Data Using Terraform
Configuring Alarm Policies Using Terraform
FAQs
Basic Questions
Integration with TKE Cluster
Product Consulting
Use and Technology
Cloud Monitor FAQs
Service Level Agreement
TMP Policy
Privacy Policy
Data Processing And Security Agreement

Overview

PDF
Focus Mode
Font Size
Last updated: 2024-01-29 16:01:55

HTTP API

All stable HTTP APIs of Prometheus are under the path /api/v1. When you need to query monitoring data, you can request data through query APIs. To submit data, you can use the remote write protocol or Pushgateway.

Supported APIs

API
Description
Authentication Required
Method
/api/v1/query
Query
Yes
GET/POST
/api/v1/query_range
Range query
Yes
GET/POST
/api/v1/series
Series query
Yes
GET/POST
/api/v1/labels
Labels query
Yes
GET/POST
/api/v1/label/<label_name>/values
Label value query
Yes
GET
/api/v1/prom/write
Data submission through remote write
Yes
remote write
Pushgateway
Data submission through Pushgateway
Yes
SDK

Authentication Method

Authentication is enabled by default, so all APIs require authentication, and all authentication methods support bearer token and basic authentication.

Bearer token

A bearer token is generated as an instance is generated and can be queried in the console. For more information on bearer token, please see Bearer Authentication.

Basic auth

Basic auth is compatible with the native Prometheus query authentication method. The username is your APPID, and the password is the bearer token (generated when the instance is generated), which can be queried in the console. For more information on basic auth, please see Basic Authentication.

Data Return Format

The response data of all APIs is in JSON format. Every successful request will return a status code of 2xx.
An invalid request will return a piece of JSON data containing an error object and a status code as described below:
Status Code
Description
401
Authentication failed
400
A parameter was missing or incorrect
422
An invalid expression couldn't be specified (RFC4918)
503
The query was unavailable or canceled
Below is a response template for invalid requests:
{
"status": "success" | "error",
"data": <data>,

// When the `status` is `error`, the following data will be returned
"errorType": "<string>",
"error": "<string>",

// When there is a warning message during request execution, this field will be filled and returned
"warnings": ["<string>"]
}

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback