Metrics
Metrics API endpoints
Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Query Parameters
1 <= length1 <= value <= 5000 <= value"full" | "slim"Response Body
application/json
curl -X GET "http://localhost:3013/api/metrics/definitions"{
"metrics": [
{
"id": "string",
"agentId": "string",
"slug": "string",
"title": "string",
"description": "string",
"definition": {
"version": 1,
"widgets": [
{
"id": "string",
"title": "string",
"description": "string",
"query": {
"sql": "string",
"params": [
"string"
],
"maxRows": 1
},
"viz": {
"type": "stat",
"x": "string",
"y": "string",
"series": [
"string"
],
"label": "string",
"value": "string",
"columns": [
{
"key": "string",
"label": "string",
"format": "number"
}
],
"format": "number"
},
"colSpan": 1,
"rowSpan": 1
}
],
"variables": [
{
"key": "string",
"label": "string",
"type": "text",
"defaultValue": "string",
"options": [
{
"label": "string",
"value": "string"
}
],
"optionsQuery": {
"sql": "string",
"valueKey": "string",
"labelKey": "string"
}
}
],
"layout": {
"columns": 1
},
"refreshSeconds": 5
},
"createdAt": "string",
"updatedAt": "string"
}
],
"total": 0,
"limit": 0,
"offset": 0
}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/metrics/definitions" \ -H "Content-Type: application/json" \ -d '{ "title": "string", "definition": { "version": 1, "widgets": [ { "id": "string", "title": "string", "query": { "sql": "string" }, "viz": { "type": "stat" } } ] } }'{
"id": "string",
"version": 1
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
Response Body
application/json
curl -X DELETE "http://localhost:3013/api/metrics/definitions/string"{
"error": "string",
"property1": null,
"property2": null
}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
Response Body
application/json
application/json
curl -X GET "http://localhost:3013/api/metrics/definitions/string"{
"id": "string",
"agentId": "string",
"slug": "string",
"title": "string",
"description": "string",
"definition": {
"version": 1,
"widgets": [
{
"id": "string",
"title": "string",
"description": "string",
"query": {
"sql": "string",
"params": [
"string"
],
"maxRows": 1
},
"viz": {
"type": "stat",
"x": "string",
"y": "string",
"series": [
"string"
],
"label": "string",
"value": "string",
"columns": [
{
"key": "string",
"label": "string",
"format": "number"
}
],
"format": "number"
},
"colSpan": 1,
"rowSpan": 1
}
],
"variables": [
{
"key": "string",
"label": "string",
"type": "text",
"defaultValue": "string",
"options": [
{
"label": "string",
"value": "string"
}
],
"optionsQuery": {
"sql": "string",
"valueKey": "string",
"labelKey": "string"
}
}
],
"layout": {
"columns": 1
},
"refreshSeconds": 5
},
"createdAt": "string",
"updatedAt": "string"
}{
"error": "string",
"property1": null,
"property2": null
}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X PUT "http://localhost:3013/api/metrics/definitions/string" \ -H "Content-Type: application/json" \ -d '{}'{
"id": "string",
"version": 1
}{
"error": "string",
"property1": null,
"property2": null
}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/metrics/definitions/string/run" \ -H "Content-Type: application/json" \ -d '{}'{
"metric": {
"id": "string",
"agentId": "string",
"slug": "string",
"title": "string",
"description": "string",
"definition": {
"version": 1,
"widgets": [
{
"id": "string",
"title": "string",
"description": "string",
"query": {
"sql": "string",
"params": [
"string"
],
"maxRows": 1
},
"viz": {
"type": "stat",
"x": "string",
"y": "string",
"series": [
"string"
],
"label": "string",
"value": "string",
"columns": [
{
"key": "string",
"label": "string",
"format": "number"
}
],
"format": "number"
},
"colSpan": 1,
"rowSpan": 1
}
],
"variables": [
{
"key": "string",
"label": "string",
"type": "text",
"defaultValue": "string",
"options": [
{
"label": "string",
"value": "string"
}
],
"optionsQuery": {
"sql": "string",
"valueKey": "string",
"labelKey": "string"
}
}
],
"layout": {
"columns": 1
},
"refreshSeconds": 5
},
"createdAt": "string",
"updatedAt": "string"
},
"variables": {
"property1": "string",
"property2": "string"
},
"widgets": [
{
"widget": {
"id": "string",
"title": "string",
"description": "string",
"query": {
"sql": "string",
"params": [
"string"
],
"maxRows": 1
},
"viz": {
"type": "stat",
"x": "string",
"y": "string",
"series": [
"string"
],
"label": "string",
"value": "string",
"columns": [
{
"key": "string",
"label": "string",
"format": "number"
}
],
"format": "number"
},
"colSpan": 1,
"rowSpan": 1
},
"result": {
"columns": [
"string"
],
"rows": [
{
"property1": null,
"property2": null
}
],
"elapsed": 0,
"total": 0,
"truncated": true,
"maxRows": 0
}
}
],
"result": {
"columns": [
"string"
],
"rows": [
{
"property1": null,
"property2": null
}
],
"elapsed": 0,
"total": 0,
"truncated": true,
"maxRows": 0
}
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
Response Body
application/json
application/json
curl -X GET "http://localhost:3013/api/metrics/definitions/string/versions"{
"versions": [
{
"id": "string",
"metricId": "string",
"version": 1,
"snapshot": {
"title": "string",
"description": "string",
"definition": {
"version": 1,
"widgets": [
{
"id": "string",
"title": "string",
"description": "string",
"query": {
"sql": "string",
"params": [
"string"
],
"maxRows": 1
},
"viz": {
"type": "stat",
"x": "string",
"y": "string",
"series": [
"string"
],
"label": "string",
"value": "string",
"columns": [
{
"key": "string",
"label": "string",
"format": "number"
}
],
"format": "number"
},
"colSpan": 1,
"rowSpan": 1
}
],
"variables": [
{
"key": "string",
"label": "string",
"type": "text",
"defaultValue": "string",
"options": [
{
"label": "string",
"value": "string"
}
],
"optionsQuery": {
"sql": "string",
"valueKey": "string",
"labelKey": "string"
}
}
],
"layout": {
"columns": 1
},
"refreshSeconds": 5
}
},
"changedByAgentId": "string",
"createdAt": "string"
}
]
}{
"error": "string",
"property1": null,
"property2": null
}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
1 <= valueResponse Body
application/json
application/json
curl -X GET "http://localhost:3013/api/metrics/definitions/string/versions/1"{
"id": "string",
"metricId": "string",
"version": 1,
"snapshot": {
"title": "string",
"description": "string",
"definition": {
"version": 1,
"widgets": [
{
"id": "string",
"title": "string",
"description": "string",
"query": {
"sql": "string",
"params": [
"string"
],
"maxRows": 1
},
"viz": {
"type": "stat",
"x": "string",
"y": "string",
"series": [
"string"
],
"label": "string",
"value": "string",
"columns": [
{
"key": "string",
"label": "string",
"format": "number"
}
],
"format": "number"
},
"colSpan": 1,
"rowSpan": 1
}
],
"variables": [
{
"key": "string",
"label": "string",
"type": "text",
"defaultValue": "string",
"options": [
{
"label": "string",
"value": "string"
}
],
"optionsQuery": {
"sql": "string",
"valueKey": "string",
"labelKey": "string"
}
}
],
"layout": {
"columns": 1
},
"refreshSeconds": 5
}
},
"changedByAgentId": "string",
"createdAt": "string"
}{
"error": "string",
"property1": null,
"property2": null
}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Response Body
application/json
curl -X GET "http://localhost:3013/api/metrics/schema"{
"schema": {
"property1": null,
"property2": null
}
}