Add /v3/metrics (get) endpoint to list all known metrics

This commit is contained in:
Ingo Oppermann
2022-09-08 13:50:53 +02:00
parent 2d754b4212
commit 285ef79716
17 changed files with 229 additions and 48 deletions

View File

@@ -839,6 +839,30 @@ const docTemplate = `{
}
},
"/api/v3/metrics": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "List all known metrics with their description and labels",
"produces": [
"application/json"
],
"summary": "List all known metrics with their description and labels",
"operationId": "metrics-3-describe",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/api.MetricsDescription"
}
}
}
}
},
"post": {
"security": [
{
@@ -2926,6 +2950,23 @@ const docTemplate = `{
}
}
},
"api.MetricsDescription": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"labels": {
"type": "array",
"items": {
"type": "string"
}
},
"name": {
"type": "string"
}
}
},
"api.MetricsQuery": {
"type": "object",
"properties": {

View File

@@ -831,6 +831,30 @@
}
},
"/api/v3/metrics": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "List all known metrics with their description and labels",
"produces": [
"application/json"
],
"summary": "List all known metrics with their description and labels",
"operationId": "metrics-3-describe",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/api.MetricsDescription"
}
}
}
}
},
"post": {
"security": [
{
@@ -2918,6 +2942,23 @@
}
}
},
"api.MetricsDescription": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"labels": {
"type": "array",
"items": {
"type": "string"
}
},
"name": {
"type": "string"
}
}
},
"api.MetricsQuery": {
"type": "object",
"properties": {

View File

@@ -462,6 +462,17 @@ definitions:
- password
- username
type: object
api.MetricsDescription:
properties:
description:
type: string
labels:
items:
type: string
type: array
name:
type: string
type: object
api.MetricsQuery:
properties:
interval_sec:
@@ -2264,6 +2275,21 @@ paths:
- ApiKeyAuth: []
summary: Add JSON metadata under the given key
/api/v3/metrics:
get:
description: List all known metrics with their description and labels
operationId: metrics-3-describe
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/api.MetricsDescription'
type: array
security:
- ApiKeyAuth: []
summary: List all known metrics with their description and labels
post:
consumes:
- application/json