mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-02 08:44:44 +00:00
get_metrics -> query_metrics
This commit is contained in:
parent
7073efede5
commit
471745fff3
4 changed files with 331 additions and 331 deletions
378
docs/_static/llama-stack-spec.html
vendored
378
docs/_static/llama-stack-spec.html
vendored
|
@ -1251,58 +1251,6 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/v1/telemetry/metrics/{metric_name}": {
|
|
||||||
"post": {
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "OK",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/GetMetricsResponse"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"$ref": "#/components/responses/BadRequest400"
|
|
||||||
},
|
|
||||||
"429": {
|
|
||||||
"$ref": "#/components/responses/TooManyRequests429"
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"$ref": "#/components/responses/InternalServerError500"
|
|
||||||
},
|
|
||||||
"default": {
|
|
||||||
"$ref": "#/components/responses/DefaultError"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tags": [
|
|
||||||
"Telemetry"
|
|
||||||
],
|
|
||||||
"description": "",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "metric_name",
|
|
||||||
"in": "path",
|
|
||||||
"required": true,
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/GetMetricsRequest"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/v1/models/{model_id}": {
|
"/v1/models/{model_id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"responses": {
|
"responses": {
|
||||||
|
@ -3490,6 +3438,58 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/v1/telemetry/metrics/{metric_name}": {
|
||||||
|
"post": {
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/QueryMetricsResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"$ref": "#/components/responses/BadRequest400"
|
||||||
|
},
|
||||||
|
"429": {
|
||||||
|
"$ref": "#/components/responses/TooManyRequests429"
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"$ref": "#/components/responses/InternalServerError500"
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"$ref": "#/components/responses/DefaultError"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Telemetry"
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "metric_name",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/QueryMetricsRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/v1/telemetry/spans": {
|
"/v1/telemetry/spans": {
|
||||||
"post": {
|
"post": {
|
||||||
"responses": {
|
"responses": {
|
||||||
|
@ -7611,143 +7611,6 @@
|
||||||
"title": "FileResponse",
|
"title": "FileResponse",
|
||||||
"description": "Response representing a file entry."
|
"description": "Response representing a file entry."
|
||||||
},
|
},
|
||||||
"GetMetricsRequest": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"start_time": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"end_time": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"granularity": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"query_type": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"range",
|
|
||||||
"instant"
|
|
||||||
],
|
|
||||||
"title": "MetricQueryType"
|
|
||||||
},
|
|
||||||
"label_matchers": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"value": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"operator": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"=",
|
|
||||||
"!=",
|
|
||||||
"=~",
|
|
||||||
"!~"
|
|
||||||
],
|
|
||||||
"title": "MetricLabelOperator",
|
|
||||||
"default": "="
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"name",
|
|
||||||
"value",
|
|
||||||
"operator"
|
|
||||||
],
|
|
||||||
"title": "MetricLabelMatcher"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"start_time",
|
|
||||||
"query_type"
|
|
||||||
],
|
|
||||||
"title": "GetMetricsRequest"
|
|
||||||
},
|
|
||||||
"MetricDataPoint": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"timestamp": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"value": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"timestamp",
|
|
||||||
"value"
|
|
||||||
],
|
|
||||||
"title": "MetricDataPoint"
|
|
||||||
},
|
|
||||||
"MetricLabel": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"value": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"name",
|
|
||||||
"value"
|
|
||||||
],
|
|
||||||
"title": "MetricLabel"
|
|
||||||
},
|
|
||||||
"MetricSeries": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"metric": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"labels": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/MetricLabel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"values": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/MetricDataPoint"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"metric",
|
|
||||||
"labels",
|
|
||||||
"values"
|
|
||||||
],
|
|
||||||
"title": "MetricSeries"
|
|
||||||
},
|
|
||||||
"GetMetricsResponse": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"data": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/MetricSeries"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"data"
|
|
||||||
],
|
|
||||||
"title": "GetMetricsResponse"
|
|
||||||
},
|
|
||||||
"Model": {
|
"Model": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -11249,6 +11112,143 @@
|
||||||
],
|
],
|
||||||
"title": "QueryChunksResponse"
|
"title": "QueryChunksResponse"
|
||||||
},
|
},
|
||||||
|
"QueryMetricsRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"start_time": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"end_time": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"granularity": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"query_type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"range",
|
||||||
|
"instant"
|
||||||
|
],
|
||||||
|
"title": "MetricQueryType"
|
||||||
|
},
|
||||||
|
"label_matchers": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"operator": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"=",
|
||||||
|
"!=",
|
||||||
|
"=~",
|
||||||
|
"!~"
|
||||||
|
],
|
||||||
|
"title": "MetricLabelOperator",
|
||||||
|
"default": "="
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"name",
|
||||||
|
"value",
|
||||||
|
"operator"
|
||||||
|
],
|
||||||
|
"title": "MetricLabelMatcher"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"start_time",
|
||||||
|
"query_type"
|
||||||
|
],
|
||||||
|
"title": "QueryMetricsRequest"
|
||||||
|
},
|
||||||
|
"MetricDataPoint": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"timestamp": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"timestamp",
|
||||||
|
"value"
|
||||||
|
],
|
||||||
|
"title": "MetricDataPoint"
|
||||||
|
},
|
||||||
|
"MetricLabel": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"name",
|
||||||
|
"value"
|
||||||
|
],
|
||||||
|
"title": "MetricLabel"
|
||||||
|
},
|
||||||
|
"MetricSeries": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"metric": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"labels": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/MetricLabel"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"values": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/MetricDataPoint"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"metric",
|
||||||
|
"labels",
|
||||||
|
"values"
|
||||||
|
],
|
||||||
|
"title": "MetricSeries"
|
||||||
|
},
|
||||||
|
"QueryMetricsResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/MetricSeries"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"data"
|
||||||
|
],
|
||||||
|
"title": "QueryMetricsResponse"
|
||||||
|
},
|
||||||
"QueryCondition": {
|
"QueryCondition": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
264
docs/_static/llama-stack-spec.yaml
vendored
264
docs/_static/llama-stack-spec.yaml
vendored
|
@ -857,40 +857,6 @@ paths:
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
/v1/telemetry/metrics/{metric_name}:
|
|
||||||
post:
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
description: OK
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/GetMetricsResponse'
|
|
||||||
'400':
|
|
||||||
$ref: '#/components/responses/BadRequest400'
|
|
||||||
'429':
|
|
||||||
$ref: >-
|
|
||||||
#/components/responses/TooManyRequests429
|
|
||||||
'500':
|
|
||||||
$ref: >-
|
|
||||||
#/components/responses/InternalServerError500
|
|
||||||
default:
|
|
||||||
$ref: '#/components/responses/DefaultError'
|
|
||||||
tags:
|
|
||||||
- Telemetry
|
|
||||||
description: ''
|
|
||||||
parameters:
|
|
||||||
- name: metric_name
|
|
||||||
in: path
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
requestBody:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/GetMetricsRequest'
|
|
||||||
required: true
|
|
||||||
/v1/models/{model_id}:
|
/v1/models/{model_id}:
|
||||||
get:
|
get:
|
||||||
responses:
|
responses:
|
||||||
|
@ -2405,6 +2371,40 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/QueryChunksRequest'
|
$ref: '#/components/schemas/QueryChunksRequest'
|
||||||
required: true
|
required: true
|
||||||
|
/v1/telemetry/metrics/{metric_name}:
|
||||||
|
post:
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/QueryMetricsResponse'
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/responses/BadRequest400'
|
||||||
|
'429':
|
||||||
|
$ref: >-
|
||||||
|
#/components/responses/TooManyRequests429
|
||||||
|
'500':
|
||||||
|
$ref: >-
|
||||||
|
#/components/responses/InternalServerError500
|
||||||
|
default:
|
||||||
|
$ref: '#/components/responses/DefaultError'
|
||||||
|
tags:
|
||||||
|
- Telemetry
|
||||||
|
description: ''
|
||||||
|
parameters:
|
||||||
|
- name: metric_name
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/QueryMetricsRequest'
|
||||||
|
required: true
|
||||||
/v1/telemetry/spans:
|
/v1/telemetry/spans:
|
||||||
post:
|
post:
|
||||||
responses:
|
responses:
|
||||||
|
@ -5307,104 +5307,6 @@ components:
|
||||||
- created_at
|
- created_at
|
||||||
title: FileResponse
|
title: FileResponse
|
||||||
description: Response representing a file entry.
|
description: Response representing a file entry.
|
||||||
GetMetricsRequest:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
start_time:
|
|
||||||
type: integer
|
|
||||||
end_time:
|
|
||||||
type: integer
|
|
||||||
granularity:
|
|
||||||
type: string
|
|
||||||
query_type:
|
|
||||||
type: string
|
|
||||||
enum:
|
|
||||||
- range
|
|
||||||
- instant
|
|
||||||
title: MetricQueryType
|
|
||||||
label_matchers:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
value:
|
|
||||||
type: string
|
|
||||||
operator:
|
|
||||||
type: string
|
|
||||||
enum:
|
|
||||||
- '='
|
|
||||||
- '!='
|
|
||||||
- =~
|
|
||||||
- '!~'
|
|
||||||
title: MetricLabelOperator
|
|
||||||
default: '='
|
|
||||||
additionalProperties: false
|
|
||||||
required:
|
|
||||||
- name
|
|
||||||
- value
|
|
||||||
- operator
|
|
||||||
title: MetricLabelMatcher
|
|
||||||
additionalProperties: false
|
|
||||||
required:
|
|
||||||
- start_time
|
|
||||||
- query_type
|
|
||||||
title: GetMetricsRequest
|
|
||||||
MetricDataPoint:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
timestamp:
|
|
||||||
type: integer
|
|
||||||
value:
|
|
||||||
type: number
|
|
||||||
additionalProperties: false
|
|
||||||
required:
|
|
||||||
- timestamp
|
|
||||||
- value
|
|
||||||
title: MetricDataPoint
|
|
||||||
MetricLabel:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
value:
|
|
||||||
type: string
|
|
||||||
additionalProperties: false
|
|
||||||
required:
|
|
||||||
- name
|
|
||||||
- value
|
|
||||||
title: MetricLabel
|
|
||||||
MetricSeries:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
metric:
|
|
||||||
type: string
|
|
||||||
labels:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/MetricLabel'
|
|
||||||
values:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/MetricDataPoint'
|
|
||||||
additionalProperties: false
|
|
||||||
required:
|
|
||||||
- metric
|
|
||||||
- labels
|
|
||||||
- values
|
|
||||||
title: MetricSeries
|
|
||||||
GetMetricsResponse:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
data:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/MetricSeries'
|
|
||||||
additionalProperties: false
|
|
||||||
required:
|
|
||||||
- data
|
|
||||||
title: GetMetricsResponse
|
|
||||||
Model:
|
Model:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
@ -7711,6 +7613,104 @@ components:
|
||||||
- chunks
|
- chunks
|
||||||
- scores
|
- scores
|
||||||
title: QueryChunksResponse
|
title: QueryChunksResponse
|
||||||
|
QueryMetricsRequest:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
start_time:
|
||||||
|
type: integer
|
||||||
|
end_time:
|
||||||
|
type: integer
|
||||||
|
granularity:
|
||||||
|
type: string
|
||||||
|
query_type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- range
|
||||||
|
- instant
|
||||||
|
title: MetricQueryType
|
||||||
|
label_matchers:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
type: string
|
||||||
|
operator:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- '='
|
||||||
|
- '!='
|
||||||
|
- =~
|
||||||
|
- '!~'
|
||||||
|
title: MetricLabelOperator
|
||||||
|
default: '='
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- value
|
||||||
|
- operator
|
||||||
|
title: MetricLabelMatcher
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- start_time
|
||||||
|
- query_type
|
||||||
|
title: QueryMetricsRequest
|
||||||
|
MetricDataPoint:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
timestamp:
|
||||||
|
type: integer
|
||||||
|
value:
|
||||||
|
type: number
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- timestamp
|
||||||
|
- value
|
||||||
|
title: MetricDataPoint
|
||||||
|
MetricLabel:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
type: string
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- value
|
||||||
|
title: MetricLabel
|
||||||
|
MetricSeries:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
metric:
|
||||||
|
type: string
|
||||||
|
labels:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/MetricLabel'
|
||||||
|
values:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/MetricDataPoint'
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- metric
|
||||||
|
- labels
|
||||||
|
- values
|
||||||
|
title: MetricSeries
|
||||||
|
QueryMetricsResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/MetricSeries'
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- data
|
||||||
|
title: QueryMetricsResponse
|
||||||
QueryCondition:
|
QueryCondition:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
|
@ -240,7 +240,7 @@ class MetricSeries(BaseModel):
|
||||||
values: list[MetricDataPoint]
|
values: list[MetricDataPoint]
|
||||||
|
|
||||||
|
|
||||||
class GetMetricsResponse(BaseModel):
|
class QueryMetricsResponse(BaseModel):
|
||||||
data: list[MetricSeries]
|
data: list[MetricSeries]
|
||||||
|
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ class Telemetry(Protocol):
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
||||||
@webmethod(route="/telemetry/metrics/{metric_name}", method="POST")
|
@webmethod(route="/telemetry/metrics/{metric_name}", method="POST")
|
||||||
async def get_metrics(
|
async def query_metrics(
|
||||||
self,
|
self,
|
||||||
metric_name: str,
|
metric_name: str,
|
||||||
start_time: int,
|
start_time: int,
|
||||||
|
@ -298,4 +298,4 @@ class Telemetry(Protocol):
|
||||||
granularity: str | None = "1d",
|
granularity: str | None = "1d",
|
||||||
query_type: MetricQueryType = MetricQueryType.RANGE,
|
query_type: MetricQueryType = MetricQueryType.RANGE,
|
||||||
label_matchers: list[MetricLabelMatcher] | None = None,
|
label_matchers: list[MetricLabelMatcher] | None = None,
|
||||||
) -> GetMetricsResponse: ...
|
) -> QueryMetricsResponse: ...
|
||||||
|
|
|
@ -19,11 +19,11 @@ from opentelemetry.semconv.resource import ResourceAttributes
|
||||||
|
|
||||||
from llama_stack.apis.telemetry import (
|
from llama_stack.apis.telemetry import (
|
||||||
Event,
|
Event,
|
||||||
GetMetricsResponse,
|
|
||||||
MetricEvent,
|
MetricEvent,
|
||||||
MetricLabelMatcher,
|
MetricLabelMatcher,
|
||||||
MetricQueryType,
|
MetricQueryType,
|
||||||
QueryCondition,
|
QueryCondition,
|
||||||
|
QueryMetricsResponse,
|
||||||
QuerySpanTreeResponse,
|
QuerySpanTreeResponse,
|
||||||
QueryTracesResponse,
|
QueryTracesResponse,
|
||||||
Span,
|
Span,
|
||||||
|
@ -126,16 +126,16 @@ class TelemetryAdapter(TelemetryDatasetMixin, Telemetry):
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unknown event type: {event}")
|
raise ValueError(f"Unknown event type: {event}")
|
||||||
|
|
||||||
async def get_metrics(
|
async def query_metrics(
|
||||||
self,
|
self,
|
||||||
metric_name: str,
|
metric_name: str,
|
||||||
start_time: int,
|
start_time: int,
|
||||||
end_time: Optional[int] = None,
|
end_time: int | None = None,
|
||||||
step: Optional[str] = "1d",
|
step: str | None = "1d",
|
||||||
query_type: MetricQueryType = MetricQueryType.RANGE,
|
query_type: MetricQueryType = MetricQueryType.RANGE,
|
||||||
label_matchers: Optional[List[MetricLabelMatcher]] = None,
|
label_matchers: list[MetricLabelMatcher] | None = None,
|
||||||
) -> GetMetricsResponse:
|
) -> QueryMetricsResponse:
|
||||||
pass
|
raise NotImplementedError("Querying metrics is not implemented")
|
||||||
|
|
||||||
def _log_unstructured(self, event: UnstructuredLogEvent, ttl_seconds: int) -> None:
|
def _log_unstructured(self, event: UnstructuredLogEvent, ttl_seconds: int) -> None:
|
||||||
with self._lock:
|
with self._lock:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue