cURL
curl --request POST \
--url https://{tenant}.chronosphere.io/api/v1/config/trace-metrics-rules \
--header 'API-Token: <api-key>' \
--header 'Content-Type: application/json' \
--data '{}'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant}.chronosphere.io/api/v1/config/trace-metrics-rules"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenant}.chronosphere.io/api/v1/config/trace-metrics-rules")
.header("API-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();const options = {
method: 'POST',
headers: {'API-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{tenant}.chronosphere.io/api/v1/config/trace-metrics-rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{tenant}.chronosphere.io/api/v1/config/trace-metrics-rules"
payload = {}
headers = {
"API-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"trace_metrics_rule": {
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"group_by": [
{
"key": {
"named_key": "<string>"
},
"label": "<string>"
}
],
"histogram_buckets_secs": [
123
],
"metric_labels": {},
"metric_name": "<string>",
"scope_filter": {
"span_scopes": [
{
"duration": {
"max_secs": 123,
"min_secs": 123
},
"error": {
"value": true
},
"is_root_span": {
"value": true
},
"operation": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"parent_operation": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"parent_service": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"service": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"span_count": {
"max": 123,
"min": 123
},
"tags": [
{
"key": "<string>",
"numeric_value": {
"value": 123
},
"value": {
"in_values": [
"<string>"
],
"value": "<string>"
}
}
]
}
]
},
"slug": "<string>",
"trace_filter": {
"scope_filter": {
"span_scopes": [
{
"duration": {
"max_secs": 123,
"min_secs": 123
},
"error": {
"value": true
},
"is_root_span": {
"value": true
},
"operation": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"parent_operation": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"parent_service": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"service": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"span_count": {
"max": 123,
"min": 123
},
"tags": [
{
"key": "<string>",
"numeric_value": {
"value": 123
},
"value": {
"in_values": [
"<string>"
],
"value": "<string>"
}
}
]
}
]
},
"span": [
{
"duration": {
"max_secs": 123,
"min_secs": 123
},
"error": {
"value": true
},
"is_root_span": {
"value": true
},
"operation": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"parent_operation": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"parent_service": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"service": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"span_count": {
"max": 123,
"min": 123
},
"tags": [
{
"key": "<string>",
"numeric_value": {
"value": 123
},
"value": {
"in_values": [
"<string>"
],
"value": "<string>"
}
}
]
}
],
"trace": {
"duration": {
"max_secs": 123,
"min_secs": 123
},
"error": {
"value": true
}
}
},
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{}CreateTraceMetricsRule
Trace Metrics Rules
POST
/
api
/
v1
/
config
/
trace-metrics-rules
cURL
curl --request POST \
--url https://{tenant}.chronosphere.io/api/v1/config/trace-metrics-rules \
--header 'API-Token: <api-key>' \
--header 'Content-Type: application/json' \
--data '{}'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant}.chronosphere.io/api/v1/config/trace-metrics-rules"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenant}.chronosphere.io/api/v1/config/trace-metrics-rules")
.header("API-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();const options = {
method: 'POST',
headers: {'API-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{tenant}.chronosphere.io/api/v1/config/trace-metrics-rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{tenant}.chronosphere.io/api/v1/config/trace-metrics-rules"
payload = {}
headers = {
"API-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"trace_metrics_rule": {
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"group_by": [
{
"key": {
"named_key": "<string>"
},
"label": "<string>"
}
],
"histogram_buckets_secs": [
123
],
"metric_labels": {},
"metric_name": "<string>",
"scope_filter": {
"span_scopes": [
{
"duration": {
"max_secs": 123,
"min_secs": 123
},
"error": {
"value": true
},
"is_root_span": {
"value": true
},
"operation": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"parent_operation": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"parent_service": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"service": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"span_count": {
"max": 123,
"min": 123
},
"tags": [
{
"key": "<string>",
"numeric_value": {
"value": 123
},
"value": {
"in_values": [
"<string>"
],
"value": "<string>"
}
}
]
}
]
},
"slug": "<string>",
"trace_filter": {
"scope_filter": {
"span_scopes": [
{
"duration": {
"max_secs": 123,
"min_secs": 123
},
"error": {
"value": true
},
"is_root_span": {
"value": true
},
"operation": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"parent_operation": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"parent_service": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"service": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"span_count": {
"max": 123,
"min": 123
},
"tags": [
{
"key": "<string>",
"numeric_value": {
"value": 123
},
"value": {
"in_values": [
"<string>"
],
"value": "<string>"
}
}
]
}
]
},
"span": [
{
"duration": {
"max_secs": 123,
"min_secs": 123
},
"error": {
"value": true
},
"is_root_span": {
"value": true
},
"operation": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"parent_operation": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"parent_service": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"service": {
"in_values": [
"<string>"
],
"value": "<string>"
},
"span_count": {
"max": 123,
"min": 123
},
"tags": [
{
"key": "<string>",
"numeric_value": {
"value": 123
},
"value": {
"in_values": [
"<string>"
],
"value": "<string>"
}
}
]
}
],
"trace": {
"duration": {
"max_secs": 123,
"min_secs": 123
},
"error": {
"value": true
}
}
},
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{}Authorizations
Chronosphere API token
Body
application/json
If true, validates the specified configuration without creating the TraceMetricsRule. If the specified configuration is valid, the endpoint returns a partial response without the TraceMetricsRule. If the specified configuration is invalid, the endpoint returns an error.
The TraceMetricsRule to create.
Show child attributes
Show child attributes
Response
A successful response containing the created TraceMetricsRule.
Show child attributes
Show child attributes
⌘I

