ClickStack: Create Dashboard
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future.
ClickStack: Creates a new dashboard
curl --request POST \
--url https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "New Dashboard",
"tiles": [
{
"name": "Error Rate",
"x": 0,
"y": 0,
"w": 6,
"h": 3,
"config": {
"displayType": "line",
"sourceId": "65f5e4a3b9e77c001a111111",
"select": [
{
"aggFn": "count",
"valueExpression": "Duration",
"alias": "Request Duration",
"where": "service:api",
"metricName": "http.server.duration",
"periodAggFn": "delta",
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": true,
"average": false,
"decimalBytes": false,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
}
}
],
"groupBy": "host",
"asRatio": true,
"alignDateRangeToGranularity": true,
"fillNulls": true,
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": true,
"average": false,
"decimalBytes": false,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
},
"compareToPreviousPeriod": true
},
"containerId": "service-health",
"tabId": "errors",
"id": "65f5e4a3b9e77c001a901234",
"asRatio": false,
"series": [
{
"type": "time",
"sourceId": "65f5e4a3b9e77c001a567890",
"aggFn": "count",
"where": "service:api",
"whereLanguage": "lucene",
"groupBy": [
"host"
],
"level": 0.95,
"field": "duration",
"alias": "Request Duration",
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": true,
"average": false,
"decimalBytes": false,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
},
"metricDataType": "sum",
"metricName": "http.server.duration",
"displayType": "line"
}
]
}
],
"tags": [
"development"
],
"filters": [
{
"type": "QUERY_EXPRESSION",
"name": "Environment",
"expression": "environment",
"sourceId": "65f5e4a3b9e77c001a111111",
"sourceMetricType": "gauge",
"where": "ServiceName:api",
"whereLanguage": "lucene"
}
],
"savedQuery": "service.name = 'api'",
"savedQueryLanguage": "sql",
"savedFilterValues": [
{
"condition": "ServiceName IN ('hdx-oss-dev-api')",
"type": "sql"
}
],
"containers": [
{
"id": "service-health",
"title": "Service Health",
"collapsed": false,
"collapsible": true,
"bordered": true,
"tabs": [
{
"id": "errors",
"title": "Errors"
}
]
}
]
}
EOFimport requests
url = "https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards"
payload = {
"name": "New Dashboard",
"tiles": [
{
"name": "Error Rate",
"x": 0,
"y": 0,
"w": 6,
"h": 3,
"config": {
"displayType": "line",
"sourceId": "65f5e4a3b9e77c001a111111",
"select": [
{
"aggFn": "count",
"valueExpression": "Duration",
"alias": "Request Duration",
"where": "service:api",
"metricName": "http.server.duration",
"periodAggFn": "delta",
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": True,
"average": False,
"decimalBytes": False,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
}
}
],
"groupBy": "host",
"asRatio": True,
"alignDateRangeToGranularity": True,
"fillNulls": True,
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": True,
"average": False,
"decimalBytes": False,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
},
"compareToPreviousPeriod": True
},
"containerId": "service-health",
"tabId": "errors",
"id": "65f5e4a3b9e77c001a901234",
"asRatio": False,
"series": [
{
"type": "time",
"sourceId": "65f5e4a3b9e77c001a567890",
"aggFn": "count",
"where": "service:api",
"whereLanguage": "lucene",
"groupBy": ["host"],
"level": 0.95,
"field": "duration",
"alias": "Request Duration",
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": True,
"average": False,
"decimalBytes": False,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
},
"metricDataType": "sum",
"metricName": "http.server.duration",
"displayType": "line"
}
]
}
],
"tags": ["development"],
"filters": [
{
"type": "QUERY_EXPRESSION",
"name": "Environment",
"expression": "environment",
"sourceId": "65f5e4a3b9e77c001a111111",
"sourceMetricType": "gauge",
"where": "ServiceName:api",
"whereLanguage": "lucene"
}
],
"savedQuery": "service.name = 'api'",
"savedQueryLanguage": "sql",
"savedFilterValues": [
{
"condition": "ServiceName IN ('hdx-oss-dev-api')",
"type": "sql"
}
],
"containers": [
{
"id": "service-health",
"title": "Service Health",
"collapsed": False,
"collapsible": True,
"bordered": True,
"tabs": [
{
"id": "errors",
"title": "Errors"
}
]
}
]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'New Dashboard',
tiles: [
{
name: 'Error Rate',
x: 0,
y: 0,
w: 6,
h: 3,
config: {
displayType: 'line',
sourceId: '65f5e4a3b9e77c001a111111',
select: [
{
aggFn: 'count',
valueExpression: 'Duration',
alias: 'Request Duration',
where: 'service:api',
metricName: 'http.server.duration',
periodAggFn: 'delta',
numberFormat: {
output: 'number',
mantissa: 2,
thousandSeparated: true,
average: false,
decimalBytes: false,
factor: 1,
currencySymbol: '$',
numericUnit: 'bytes_iec',
unit: 'ms'
}
}
],
groupBy: 'host',
asRatio: true,
alignDateRangeToGranularity: true,
fillNulls: true,
numberFormat: {
output: 'number',
mantissa: 2,
thousandSeparated: true,
average: false,
decimalBytes: false,
factor: 1,
currencySymbol: '$',
numericUnit: 'bytes_iec',
unit: 'ms'
},
compareToPreviousPeriod: true
},
containerId: 'service-health',
tabId: 'errors',
id: '65f5e4a3b9e77c001a901234',
asRatio: false,
series: [
{
type: 'time',
sourceId: '65f5e4a3b9e77c001a567890',
aggFn: 'count',
where: 'service:api',
whereLanguage: 'lucene',
groupBy: ['host'],
level: 0.95,
field: 'duration',
alias: 'Request Duration',
numberFormat: {
output: 'number',
mantissa: 2,
thousandSeparated: true,
average: false,
decimalBytes: false,
factor: 1,
currencySymbol: '$',
numericUnit: 'bytes_iec',
unit: 'ms'
},
metricDataType: 'sum',
metricName: 'http.server.duration',
displayType: 'line'
}
]
}
],
tags: ['development'],
filters: [
{
type: 'QUERY_EXPRESSION',
name: 'Environment',
expression: 'environment',
sourceId: '65f5e4a3b9e77c001a111111',
sourceMetricType: 'gauge',
where: 'ServiceName:api',
whereLanguage: 'lucene'
}
],
savedQuery: 'service.name = \'api\'',
savedQueryLanguage: 'sql',
savedFilterValues: [{condition: 'ServiceName IN (\'hdx-oss-dev-api\')', type: 'sql'}],
containers: [
{
id: 'service-health',
title: 'Service Health',
collapsed: false,
collapsible: true,
bordered: true,
tabs: [{id: 'errors', title: 'Errors'}]
}
]
})
};
fetch('https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'New Dashboard',
'tiles' => [
[
'name' => 'Error Rate',
'x' => 0,
'y' => 0,
'w' => 6,
'h' => 3,
'config' => [
'displayType' => 'line',
'sourceId' => '65f5e4a3b9e77c001a111111',
'select' => [
[
'aggFn' => 'count',
'valueExpression' => 'Duration',
'alias' => 'Request Duration',
'where' => 'service:api',
'metricName' => 'http.server.duration',
'periodAggFn' => 'delta',
'numberFormat' => [
'output' => 'number',
'mantissa' => 2,
'thousandSeparated' => true,
'average' => false,
'decimalBytes' => false,
'factor' => 1,
'currencySymbol' => '$',
'numericUnit' => 'bytes_iec',
'unit' => 'ms'
]
]
],
'groupBy' => 'host',
'asRatio' => true,
'alignDateRangeToGranularity' => true,
'fillNulls' => true,
'numberFormat' => [
'output' => 'number',
'mantissa' => 2,
'thousandSeparated' => true,
'average' => false,
'decimalBytes' => false,
'factor' => 1,
'currencySymbol' => '$',
'numericUnit' => 'bytes_iec',
'unit' => 'ms'
],
'compareToPreviousPeriod' => true
],
'containerId' => 'service-health',
'tabId' => 'errors',
'id' => '65f5e4a3b9e77c001a901234',
'asRatio' => false,
'series' => [
[
'type' => 'time',
'sourceId' => '65f5e4a3b9e77c001a567890',
'aggFn' => 'count',
'where' => 'service:api',
'whereLanguage' => 'lucene',
'groupBy' => [
'host'
],
'level' => 0.95,
'field' => 'duration',
'alias' => 'Request Duration',
'numberFormat' => [
'output' => 'number',
'mantissa' => 2,
'thousandSeparated' => true,
'average' => false,
'decimalBytes' => false,
'factor' => 1,
'currencySymbol' => '$',
'numericUnit' => 'bytes_iec',
'unit' => 'ms'
],
'metricDataType' => 'sum',
'metricName' => 'http.server.duration',
'displayType' => 'line'
]
]
]
],
'tags' => [
'development'
],
'filters' => [
[
'type' => 'QUERY_EXPRESSION',
'name' => 'Environment',
'expression' => 'environment',
'sourceId' => '65f5e4a3b9e77c001a111111',
'sourceMetricType' => 'gauge',
'where' => 'ServiceName:api',
'whereLanguage' => 'lucene'
]
],
'savedQuery' => 'service.name = \'api\'',
'savedQueryLanguage' => 'sql',
'savedFilterValues' => [
[
'condition' => 'ServiceName IN (\'hdx-oss-dev-api\')',
'type' => 'sql'
]
],
'containers' => [
[
'id' => 'service-health',
'title' => 'Service Health',
'collapsed' => false,
'collapsible' => true,
'bordered' => true,
'tabs' => [
[
'id' => 'errors',
'title' => 'Errors'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards"
payload := strings.NewReader("{\n \"name\": \"New Dashboard\",\n \"tiles\": [\n {\n \"name\": \"Error Rate\",\n \"x\": 0,\n \"y\": 0,\n \"w\": 6,\n \"h\": 3,\n \"config\": {\n \"displayType\": \"line\",\n \"sourceId\": \"65f5e4a3b9e77c001a111111\",\n \"select\": [\n {\n \"aggFn\": \"count\",\n \"valueExpression\": \"Duration\",\n \"alias\": \"Request Duration\",\n \"where\": \"service:api\",\n \"metricName\": \"http.server.duration\",\n \"periodAggFn\": \"delta\",\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n }\n }\n ],\n \"groupBy\": \"host\",\n \"asRatio\": true,\n \"alignDateRangeToGranularity\": true,\n \"fillNulls\": true,\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n },\n \"compareToPreviousPeriod\": true\n },\n \"containerId\": \"service-health\",\n \"tabId\": \"errors\",\n \"id\": \"65f5e4a3b9e77c001a901234\",\n \"asRatio\": false,\n \"series\": [\n {\n \"type\": \"time\",\n \"sourceId\": \"65f5e4a3b9e77c001a567890\",\n \"aggFn\": \"count\",\n \"where\": \"service:api\",\n \"whereLanguage\": \"lucene\",\n \"groupBy\": [\n \"host\"\n ],\n \"level\": 0.95,\n \"field\": \"duration\",\n \"alias\": \"Request Duration\",\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n },\n \"metricDataType\": \"sum\",\n \"metricName\": \"http.server.duration\",\n \"displayType\": \"line\"\n }\n ]\n }\n ],\n \"tags\": [\n \"development\"\n ],\n \"filters\": [\n {\n \"type\": \"QUERY_EXPRESSION\",\n \"name\": \"Environment\",\n \"expression\": \"environment\",\n \"sourceId\": \"65f5e4a3b9e77c001a111111\",\n \"sourceMetricType\": \"gauge\",\n \"where\": \"ServiceName:api\",\n \"whereLanguage\": \"lucene\"\n }\n ],\n \"savedQuery\": \"service.name = 'api'\",\n \"savedQueryLanguage\": \"sql\",\n \"savedFilterValues\": [\n {\n \"condition\": \"ServiceName IN ('hdx-oss-dev-api')\",\n \"type\": \"sql\"\n }\n ],\n \"containers\": [\n {\n \"id\": \"service-health\",\n \"title\": \"Service Health\",\n \"collapsed\": false,\n \"collapsible\": true,\n \"bordered\": true,\n \"tabs\": [\n {\n \"id\": \"errors\",\n \"title\": \"Errors\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"New Dashboard\",\n \"tiles\": [\n {\n \"name\": \"Error Rate\",\n \"x\": 0,\n \"y\": 0,\n \"w\": 6,\n \"h\": 3,\n \"config\": {\n \"displayType\": \"line\",\n \"sourceId\": \"65f5e4a3b9e77c001a111111\",\n \"select\": [\n {\n \"aggFn\": \"count\",\n \"valueExpression\": \"Duration\",\n \"alias\": \"Request Duration\",\n \"where\": \"service:api\",\n \"metricName\": \"http.server.duration\",\n \"periodAggFn\": \"delta\",\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n }\n }\n ],\n \"groupBy\": \"host\",\n \"asRatio\": true,\n \"alignDateRangeToGranularity\": true,\n \"fillNulls\": true,\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n },\n \"compareToPreviousPeriod\": true\n },\n \"containerId\": \"service-health\",\n \"tabId\": \"errors\",\n \"id\": \"65f5e4a3b9e77c001a901234\",\n \"asRatio\": false,\n \"series\": [\n {\n \"type\": \"time\",\n \"sourceId\": \"65f5e4a3b9e77c001a567890\",\n \"aggFn\": \"count\",\n \"where\": \"service:api\",\n \"whereLanguage\": \"lucene\",\n \"groupBy\": [\n \"host\"\n ],\n \"level\": 0.95,\n \"field\": \"duration\",\n \"alias\": \"Request Duration\",\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n },\n \"metricDataType\": \"sum\",\n \"metricName\": \"http.server.duration\",\n \"displayType\": \"line\"\n }\n ]\n }\n ],\n \"tags\": [\n \"development\"\n ],\n \"filters\": [\n {\n \"type\": \"QUERY_EXPRESSION\",\n \"name\": \"Environment\",\n \"expression\": \"environment\",\n \"sourceId\": \"65f5e4a3b9e77c001a111111\",\n \"sourceMetricType\": \"gauge\",\n \"where\": \"ServiceName:api\",\n \"whereLanguage\": \"lucene\"\n }\n ],\n \"savedQuery\": \"service.name = 'api'\",\n \"savedQueryLanguage\": \"sql\",\n \"savedFilterValues\": [\n {\n \"condition\": \"ServiceName IN ('hdx-oss-dev-api')\",\n \"type\": \"sql\"\n }\n ],\n \"containers\": [\n {\n \"id\": \"service-health\",\n \"title\": \"Service Health\",\n \"collapsed\": false,\n \"collapsible\": true,\n \"bordered\": true,\n \"tabs\": [\n {\n \"id\": \"errors\",\n \"title\": \"Errors\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"New Dashboard\",\n \"tiles\": [\n {\n \"name\": \"Error Rate\",\n \"x\": 0,\n \"y\": 0,\n \"w\": 6,\n \"h\": 3,\n \"config\": {\n \"displayType\": \"line\",\n \"sourceId\": \"65f5e4a3b9e77c001a111111\",\n \"select\": [\n {\n \"aggFn\": \"count\",\n \"valueExpression\": \"Duration\",\n \"alias\": \"Request Duration\",\n \"where\": \"service:api\",\n \"metricName\": \"http.server.duration\",\n \"periodAggFn\": \"delta\",\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n }\n }\n ],\n \"groupBy\": \"host\",\n \"asRatio\": true,\n \"alignDateRangeToGranularity\": true,\n \"fillNulls\": true,\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n },\n \"compareToPreviousPeriod\": true\n },\n \"containerId\": \"service-health\",\n \"tabId\": \"errors\",\n \"id\": \"65f5e4a3b9e77c001a901234\",\n \"asRatio\": false,\n \"series\": [\n {\n \"type\": \"time\",\n \"sourceId\": \"65f5e4a3b9e77c001a567890\",\n \"aggFn\": \"count\",\n \"where\": \"service:api\",\n \"whereLanguage\": \"lucene\",\n \"groupBy\": [\n \"host\"\n ],\n \"level\": 0.95,\n \"field\": \"duration\",\n \"alias\": \"Request Duration\",\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n },\n \"metricDataType\": \"sum\",\n \"metricName\": \"http.server.duration\",\n \"displayType\": \"line\"\n }\n ]\n }\n ],\n \"tags\": [\n \"development\"\n ],\n \"filters\": [\n {\n \"type\": \"QUERY_EXPRESSION\",\n \"name\": \"Environment\",\n \"expression\": \"environment\",\n \"sourceId\": \"65f5e4a3b9e77c001a111111\",\n \"sourceMetricType\": \"gauge\",\n \"where\": \"ServiceName:api\",\n \"whereLanguage\": \"lucene\"\n }\n ],\n \"savedQuery\": \"service.name = 'api'\",\n \"savedQueryLanguage\": \"sql\",\n \"savedFilterValues\": [\n {\n \"condition\": \"ServiceName IN ('hdx-oss-dev-api')\",\n \"type\": \"sql\"\n }\n ],\n \"containers\": [\n {\n \"id\": \"service-health\",\n \"title\": \"Service Health\",\n \"collapsed\": false,\n \"collapsible\": true,\n \"bordered\": true,\n \"tabs\": [\n {\n \"id\": \"errors\",\n \"title\": \"Errors\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"result": {
"id": "65f5e4a3b9e77c001a567890",
"name": "Service Overview",
"tiles": [
{
"name": "Error Rate",
"x": 0,
"y": 0,
"w": 6,
"h": 3,
"id": "65f5e4a3b9e77c001a901234",
"config": {
"displayType": "line",
"sourceId": "65f5e4a3b9e77c001a111111",
"select": [
{
"aggFn": "count",
"valueExpression": "Duration",
"alias": "Request Duration",
"where": "service:api",
"metricName": "http.server.duration",
"periodAggFn": "delta",
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": true,
"average": false,
"decimalBytes": false,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
}
}
],
"groupBy": "host",
"asRatio": true,
"alignDateRangeToGranularity": true,
"fillNulls": true,
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": true,
"average": false,
"decimalBytes": false,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
},
"compareToPreviousPeriod": true
},
"containerId": "service-health",
"tabId": "errors"
}
],
"tags": [
"production",
"monitoring"
],
"filters": [
{
"type": "QUERY_EXPRESSION",
"name": "Environment",
"expression": "environment",
"sourceId": "65f5e4a3b9e77c001a111111",
"id": "<string>",
"sourceMetricType": "gauge",
"where": "ServiceName:api",
"whereLanguage": "lucene"
}
],
"savedQuery": "service.name = 'api'",
"savedQueryLanguage": "sql",
"savedFilterValues": [
{
"condition": "ServiceName IN ('hdx-oss-dev-api')",
"type": "sql"
}
],
"containers": [
{
"id": "service-health",
"title": "Service Health",
"collapsed": false,
"collapsible": true,
"bordered": true,
"tabs": [
{
"id": "errors",
"title": "Errors"
}
]
}
]
}
}{
"status": 400,
"error": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"status": 500,
"error": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}ClickStack: Creates a new dashboard
Authorizations
Use key ID and key secret obtained in ClickHouse Cloud console: https://clickhouse.com/docs/cloud/manage/openapi
Path Parameters
ID of the organization that owns the service.
ID of the ClickStack service.
Body
Dashboard name.
"New Dashboard"
List of tiles/charts to include in the dashboard.
Show child attributes
Show child attributes
Tags for organizing and filtering dashboards.
["development"]
Dashboard filter keys to add to the dashboard and apply across all tiles
Show child attributes
Show child attributes
Optional default dashboard query to persist on the dashboard.
"service.name = 'api'"
Query language used by savedQuery.
sql, lucene "sql"
Optional default dashboard filter values to persist on the dashboard.
Show child attributes
Show child attributes
Optional grouping containers. Each tile may join a container via tile.containerId, and a tab inside it via tile.tabId.
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "New Dashboard",
"tiles": [
{
"name": "Error Rate",
"x": 0,
"y": 0,
"w": 6,
"h": 3,
"config": {
"displayType": "line",
"sourceId": "65f5e4a3b9e77c001a111111",
"select": [
{
"aggFn": "count",
"valueExpression": "Duration",
"alias": "Request Duration",
"where": "service:api",
"metricName": "http.server.duration",
"periodAggFn": "delta",
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": true,
"average": false,
"decimalBytes": false,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
}
}
],
"groupBy": "host",
"asRatio": true,
"alignDateRangeToGranularity": true,
"fillNulls": true,
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": true,
"average": false,
"decimalBytes": false,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
},
"compareToPreviousPeriod": true
},
"containerId": "service-health",
"tabId": "errors",
"id": "65f5e4a3b9e77c001a901234",
"asRatio": false,
"series": [
{
"type": "time",
"sourceId": "65f5e4a3b9e77c001a567890",
"aggFn": "count",
"where": "service:api",
"whereLanguage": "lucene",
"groupBy": [
"host"
],
"level": 0.95,
"field": "duration",
"alias": "Request Duration",
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": true,
"average": false,
"decimalBytes": false,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
},
"metricDataType": "sum",
"metricName": "http.server.duration",
"displayType": "line"
}
]
}
],
"tags": [
"development"
],
"filters": [
{
"type": "QUERY_EXPRESSION",
"name": "Environment",
"expression": "environment",
"sourceId": "65f5e4a3b9e77c001a111111",
"sourceMetricType": "gauge",
"where": "ServiceName:api",
"whereLanguage": "lucene"
}
],
"savedQuery": "service.name = 'api'",
"savedQueryLanguage": "sql",
"savedFilterValues": [
{
"condition": "ServiceName IN ('hdx-oss-dev-api')",
"type": "sql"
}
],
"containers": [
{
"id": "service-health",
"title": "Service Health",
"collapsed": false,
"collapsible": true,
"bordered": true,
"tabs": [
{
"id": "errors",
"title": "Errors"
}
]
}
]
}
EOFimport requests
url = "https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards"
payload = {
"name": "New Dashboard",
"tiles": [
{
"name": "Error Rate",
"x": 0,
"y": 0,
"w": 6,
"h": 3,
"config": {
"displayType": "line",
"sourceId": "65f5e4a3b9e77c001a111111",
"select": [
{
"aggFn": "count",
"valueExpression": "Duration",
"alias": "Request Duration",
"where": "service:api",
"metricName": "http.server.duration",
"periodAggFn": "delta",
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": True,
"average": False,
"decimalBytes": False,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
}
}
],
"groupBy": "host",
"asRatio": True,
"alignDateRangeToGranularity": True,
"fillNulls": True,
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": True,
"average": False,
"decimalBytes": False,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
},
"compareToPreviousPeriod": True
},
"containerId": "service-health",
"tabId": "errors",
"id": "65f5e4a3b9e77c001a901234",
"asRatio": False,
"series": [
{
"type": "time",
"sourceId": "65f5e4a3b9e77c001a567890",
"aggFn": "count",
"where": "service:api",
"whereLanguage": "lucene",
"groupBy": ["host"],
"level": 0.95,
"field": "duration",
"alias": "Request Duration",
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": True,
"average": False,
"decimalBytes": False,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
},
"metricDataType": "sum",
"metricName": "http.server.duration",
"displayType": "line"
}
]
}
],
"tags": ["development"],
"filters": [
{
"type": "QUERY_EXPRESSION",
"name": "Environment",
"expression": "environment",
"sourceId": "65f5e4a3b9e77c001a111111",
"sourceMetricType": "gauge",
"where": "ServiceName:api",
"whereLanguage": "lucene"
}
],
"savedQuery": "service.name = 'api'",
"savedQueryLanguage": "sql",
"savedFilterValues": [
{
"condition": "ServiceName IN ('hdx-oss-dev-api')",
"type": "sql"
}
],
"containers": [
{
"id": "service-health",
"title": "Service Health",
"collapsed": False,
"collapsible": True,
"bordered": True,
"tabs": [
{
"id": "errors",
"title": "Errors"
}
]
}
]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'New Dashboard',
tiles: [
{
name: 'Error Rate',
x: 0,
y: 0,
w: 6,
h: 3,
config: {
displayType: 'line',
sourceId: '65f5e4a3b9e77c001a111111',
select: [
{
aggFn: 'count',
valueExpression: 'Duration',
alias: 'Request Duration',
where: 'service:api',
metricName: 'http.server.duration',
periodAggFn: 'delta',
numberFormat: {
output: 'number',
mantissa: 2,
thousandSeparated: true,
average: false,
decimalBytes: false,
factor: 1,
currencySymbol: '$',
numericUnit: 'bytes_iec',
unit: 'ms'
}
}
],
groupBy: 'host',
asRatio: true,
alignDateRangeToGranularity: true,
fillNulls: true,
numberFormat: {
output: 'number',
mantissa: 2,
thousandSeparated: true,
average: false,
decimalBytes: false,
factor: 1,
currencySymbol: '$',
numericUnit: 'bytes_iec',
unit: 'ms'
},
compareToPreviousPeriod: true
},
containerId: 'service-health',
tabId: 'errors',
id: '65f5e4a3b9e77c001a901234',
asRatio: false,
series: [
{
type: 'time',
sourceId: '65f5e4a3b9e77c001a567890',
aggFn: 'count',
where: 'service:api',
whereLanguage: 'lucene',
groupBy: ['host'],
level: 0.95,
field: 'duration',
alias: 'Request Duration',
numberFormat: {
output: 'number',
mantissa: 2,
thousandSeparated: true,
average: false,
decimalBytes: false,
factor: 1,
currencySymbol: '$',
numericUnit: 'bytes_iec',
unit: 'ms'
},
metricDataType: 'sum',
metricName: 'http.server.duration',
displayType: 'line'
}
]
}
],
tags: ['development'],
filters: [
{
type: 'QUERY_EXPRESSION',
name: 'Environment',
expression: 'environment',
sourceId: '65f5e4a3b9e77c001a111111',
sourceMetricType: 'gauge',
where: 'ServiceName:api',
whereLanguage: 'lucene'
}
],
savedQuery: 'service.name = \'api\'',
savedQueryLanguage: 'sql',
savedFilterValues: [{condition: 'ServiceName IN (\'hdx-oss-dev-api\')', type: 'sql'}],
containers: [
{
id: 'service-health',
title: 'Service Health',
collapsed: false,
collapsible: true,
bordered: true,
tabs: [{id: 'errors', title: 'Errors'}]
}
]
})
};
fetch('https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'New Dashboard',
'tiles' => [
[
'name' => 'Error Rate',
'x' => 0,
'y' => 0,
'w' => 6,
'h' => 3,
'config' => [
'displayType' => 'line',
'sourceId' => '65f5e4a3b9e77c001a111111',
'select' => [
[
'aggFn' => 'count',
'valueExpression' => 'Duration',
'alias' => 'Request Duration',
'where' => 'service:api',
'metricName' => 'http.server.duration',
'periodAggFn' => 'delta',
'numberFormat' => [
'output' => 'number',
'mantissa' => 2,
'thousandSeparated' => true,
'average' => false,
'decimalBytes' => false,
'factor' => 1,
'currencySymbol' => '$',
'numericUnit' => 'bytes_iec',
'unit' => 'ms'
]
]
],
'groupBy' => 'host',
'asRatio' => true,
'alignDateRangeToGranularity' => true,
'fillNulls' => true,
'numberFormat' => [
'output' => 'number',
'mantissa' => 2,
'thousandSeparated' => true,
'average' => false,
'decimalBytes' => false,
'factor' => 1,
'currencySymbol' => '$',
'numericUnit' => 'bytes_iec',
'unit' => 'ms'
],
'compareToPreviousPeriod' => true
],
'containerId' => 'service-health',
'tabId' => 'errors',
'id' => '65f5e4a3b9e77c001a901234',
'asRatio' => false,
'series' => [
[
'type' => 'time',
'sourceId' => '65f5e4a3b9e77c001a567890',
'aggFn' => 'count',
'where' => 'service:api',
'whereLanguage' => 'lucene',
'groupBy' => [
'host'
],
'level' => 0.95,
'field' => 'duration',
'alias' => 'Request Duration',
'numberFormat' => [
'output' => 'number',
'mantissa' => 2,
'thousandSeparated' => true,
'average' => false,
'decimalBytes' => false,
'factor' => 1,
'currencySymbol' => '$',
'numericUnit' => 'bytes_iec',
'unit' => 'ms'
],
'metricDataType' => 'sum',
'metricName' => 'http.server.duration',
'displayType' => 'line'
]
]
]
],
'tags' => [
'development'
],
'filters' => [
[
'type' => 'QUERY_EXPRESSION',
'name' => 'Environment',
'expression' => 'environment',
'sourceId' => '65f5e4a3b9e77c001a111111',
'sourceMetricType' => 'gauge',
'where' => 'ServiceName:api',
'whereLanguage' => 'lucene'
]
],
'savedQuery' => 'service.name = \'api\'',
'savedQueryLanguage' => 'sql',
'savedFilterValues' => [
[
'condition' => 'ServiceName IN (\'hdx-oss-dev-api\')',
'type' => 'sql'
]
],
'containers' => [
[
'id' => 'service-health',
'title' => 'Service Health',
'collapsed' => false,
'collapsible' => true,
'bordered' => true,
'tabs' => [
[
'id' => 'errors',
'title' => 'Errors'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards"
payload := strings.NewReader("{\n \"name\": \"New Dashboard\",\n \"tiles\": [\n {\n \"name\": \"Error Rate\",\n \"x\": 0,\n \"y\": 0,\n \"w\": 6,\n \"h\": 3,\n \"config\": {\n \"displayType\": \"line\",\n \"sourceId\": \"65f5e4a3b9e77c001a111111\",\n \"select\": [\n {\n \"aggFn\": \"count\",\n \"valueExpression\": \"Duration\",\n \"alias\": \"Request Duration\",\n \"where\": \"service:api\",\n \"metricName\": \"http.server.duration\",\n \"periodAggFn\": \"delta\",\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n }\n }\n ],\n \"groupBy\": \"host\",\n \"asRatio\": true,\n \"alignDateRangeToGranularity\": true,\n \"fillNulls\": true,\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n },\n \"compareToPreviousPeriod\": true\n },\n \"containerId\": \"service-health\",\n \"tabId\": \"errors\",\n \"id\": \"65f5e4a3b9e77c001a901234\",\n \"asRatio\": false,\n \"series\": [\n {\n \"type\": \"time\",\n \"sourceId\": \"65f5e4a3b9e77c001a567890\",\n \"aggFn\": \"count\",\n \"where\": \"service:api\",\n \"whereLanguage\": \"lucene\",\n \"groupBy\": [\n \"host\"\n ],\n \"level\": 0.95,\n \"field\": \"duration\",\n \"alias\": \"Request Duration\",\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n },\n \"metricDataType\": \"sum\",\n \"metricName\": \"http.server.duration\",\n \"displayType\": \"line\"\n }\n ]\n }\n ],\n \"tags\": [\n \"development\"\n ],\n \"filters\": [\n {\n \"type\": \"QUERY_EXPRESSION\",\n \"name\": \"Environment\",\n \"expression\": \"environment\",\n \"sourceId\": \"65f5e4a3b9e77c001a111111\",\n \"sourceMetricType\": \"gauge\",\n \"where\": \"ServiceName:api\",\n \"whereLanguage\": \"lucene\"\n }\n ],\n \"savedQuery\": \"service.name = 'api'\",\n \"savedQueryLanguage\": \"sql\",\n \"savedFilterValues\": [\n {\n \"condition\": \"ServiceName IN ('hdx-oss-dev-api')\",\n \"type\": \"sql\"\n }\n ],\n \"containers\": [\n {\n \"id\": \"service-health\",\n \"title\": \"Service Health\",\n \"collapsed\": false,\n \"collapsible\": true,\n \"bordered\": true,\n \"tabs\": [\n {\n \"id\": \"errors\",\n \"title\": \"Errors\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"New Dashboard\",\n \"tiles\": [\n {\n \"name\": \"Error Rate\",\n \"x\": 0,\n \"y\": 0,\n \"w\": 6,\n \"h\": 3,\n \"config\": {\n \"displayType\": \"line\",\n \"sourceId\": \"65f5e4a3b9e77c001a111111\",\n \"select\": [\n {\n \"aggFn\": \"count\",\n \"valueExpression\": \"Duration\",\n \"alias\": \"Request Duration\",\n \"where\": \"service:api\",\n \"metricName\": \"http.server.duration\",\n \"periodAggFn\": \"delta\",\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n }\n }\n ],\n \"groupBy\": \"host\",\n \"asRatio\": true,\n \"alignDateRangeToGranularity\": true,\n \"fillNulls\": true,\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n },\n \"compareToPreviousPeriod\": true\n },\n \"containerId\": \"service-health\",\n \"tabId\": \"errors\",\n \"id\": \"65f5e4a3b9e77c001a901234\",\n \"asRatio\": false,\n \"series\": [\n {\n \"type\": \"time\",\n \"sourceId\": \"65f5e4a3b9e77c001a567890\",\n \"aggFn\": \"count\",\n \"where\": \"service:api\",\n \"whereLanguage\": \"lucene\",\n \"groupBy\": [\n \"host\"\n ],\n \"level\": 0.95,\n \"field\": \"duration\",\n \"alias\": \"Request Duration\",\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n },\n \"metricDataType\": \"sum\",\n \"metricName\": \"http.server.duration\",\n \"displayType\": \"line\"\n }\n ]\n }\n ],\n \"tags\": [\n \"development\"\n ],\n \"filters\": [\n {\n \"type\": \"QUERY_EXPRESSION\",\n \"name\": \"Environment\",\n \"expression\": \"environment\",\n \"sourceId\": \"65f5e4a3b9e77c001a111111\",\n \"sourceMetricType\": \"gauge\",\n \"where\": \"ServiceName:api\",\n \"whereLanguage\": \"lucene\"\n }\n ],\n \"savedQuery\": \"service.name = 'api'\",\n \"savedQueryLanguage\": \"sql\",\n \"savedFilterValues\": [\n {\n \"condition\": \"ServiceName IN ('hdx-oss-dev-api')\",\n \"type\": \"sql\"\n }\n ],\n \"containers\": [\n {\n \"id\": \"service-health\",\n \"title\": \"Service Health\",\n \"collapsed\": false,\n \"collapsible\": true,\n \"bordered\": true,\n \"tabs\": [\n {\n \"id\": \"errors\",\n \"title\": \"Errors\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickstack/dashboards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"New Dashboard\",\n \"tiles\": [\n {\n \"name\": \"Error Rate\",\n \"x\": 0,\n \"y\": 0,\n \"w\": 6,\n \"h\": 3,\n \"config\": {\n \"displayType\": \"line\",\n \"sourceId\": \"65f5e4a3b9e77c001a111111\",\n \"select\": [\n {\n \"aggFn\": \"count\",\n \"valueExpression\": \"Duration\",\n \"alias\": \"Request Duration\",\n \"where\": \"service:api\",\n \"metricName\": \"http.server.duration\",\n \"periodAggFn\": \"delta\",\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n }\n }\n ],\n \"groupBy\": \"host\",\n \"asRatio\": true,\n \"alignDateRangeToGranularity\": true,\n \"fillNulls\": true,\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n },\n \"compareToPreviousPeriod\": true\n },\n \"containerId\": \"service-health\",\n \"tabId\": \"errors\",\n \"id\": \"65f5e4a3b9e77c001a901234\",\n \"asRatio\": false,\n \"series\": [\n {\n \"type\": \"time\",\n \"sourceId\": \"65f5e4a3b9e77c001a567890\",\n \"aggFn\": \"count\",\n \"where\": \"service:api\",\n \"whereLanguage\": \"lucene\",\n \"groupBy\": [\n \"host\"\n ],\n \"level\": 0.95,\n \"field\": \"duration\",\n \"alias\": \"Request Duration\",\n \"numberFormat\": {\n \"output\": \"number\",\n \"mantissa\": 2,\n \"thousandSeparated\": true,\n \"average\": false,\n \"decimalBytes\": false,\n \"factor\": 1,\n \"currencySymbol\": \"$\",\n \"numericUnit\": \"bytes_iec\",\n \"unit\": \"ms\"\n },\n \"metricDataType\": \"sum\",\n \"metricName\": \"http.server.duration\",\n \"displayType\": \"line\"\n }\n ]\n }\n ],\n \"tags\": [\n \"development\"\n ],\n \"filters\": [\n {\n \"type\": \"QUERY_EXPRESSION\",\n \"name\": \"Environment\",\n \"expression\": \"environment\",\n \"sourceId\": \"65f5e4a3b9e77c001a111111\",\n \"sourceMetricType\": \"gauge\",\n \"where\": \"ServiceName:api\",\n \"whereLanguage\": \"lucene\"\n }\n ],\n \"savedQuery\": \"service.name = 'api'\",\n \"savedQueryLanguage\": \"sql\",\n \"savedFilterValues\": [\n {\n \"condition\": \"ServiceName IN ('hdx-oss-dev-api')\",\n \"type\": \"sql\"\n }\n ],\n \"containers\": [\n {\n \"id\": \"service-health\",\n \"title\": \"Service Health\",\n \"collapsed\": false,\n \"collapsible\": true,\n \"bordered\": true,\n \"tabs\": [\n {\n \"id\": \"errors\",\n \"title\": \"Errors\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"result": {
"id": "65f5e4a3b9e77c001a567890",
"name": "Service Overview",
"tiles": [
{
"name": "Error Rate",
"x": 0,
"y": 0,
"w": 6,
"h": 3,
"id": "65f5e4a3b9e77c001a901234",
"config": {
"displayType": "line",
"sourceId": "65f5e4a3b9e77c001a111111",
"select": [
{
"aggFn": "count",
"valueExpression": "Duration",
"alias": "Request Duration",
"where": "service:api",
"metricName": "http.server.duration",
"periodAggFn": "delta",
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": true,
"average": false,
"decimalBytes": false,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
}
}
],
"groupBy": "host",
"asRatio": true,
"alignDateRangeToGranularity": true,
"fillNulls": true,
"numberFormat": {
"output": "number",
"mantissa": 2,
"thousandSeparated": true,
"average": false,
"decimalBytes": false,
"factor": 1,
"currencySymbol": "$",
"numericUnit": "bytes_iec",
"unit": "ms"
},
"compareToPreviousPeriod": true
},
"containerId": "service-health",
"tabId": "errors"
}
],
"tags": [
"production",
"monitoring"
],
"filters": [
{
"type": "QUERY_EXPRESSION",
"name": "Environment",
"expression": "environment",
"sourceId": "65f5e4a3b9e77c001a111111",
"id": "<string>",
"sourceMetricType": "gauge",
"where": "ServiceName:api",
"whereLanguage": "lucene"
}
],
"savedQuery": "service.name = 'api'",
"savedQueryLanguage": "sql",
"savedFilterValues": [
{
"condition": "ServiceName IN ('hdx-oss-dev-api')",
"type": "sql"
}
],
"containers": [
{
"id": "service-health",
"title": "Service Health",
"collapsed": false,
"collapsible": true,
"bordered": true,
"tabs": [
{
"id": "errors",
"title": "Errors"
}
]
}
]
}
}{
"status": 400,
"error": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"status": 500,
"error": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}