API Reference
Query metrics
- Community
- Roadmap
- Feature Request
- Alerty API
- Inventory
- Resource
- Monitor
- Incident
- Integration
- Organization
- User
- POSTQuery logs
- POSTQuery metrics
- POSTQuery traces
API Documentation
API Reference
API Reference
Query metrics
Retrieve metrics based on the specified filters.
POST
/
query
/
metrics
Authorization
string
*
Bearer
Authorization
Required
string
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
object
*
start_time
string
start_time
string
Start time for the query.
Add Example Value
end_time
string
end_time
string
End time for the query.
Add Example Value
service_name
string
service_name
string
Filter metrics by service name.
metric_name
string
metric_name
string
Filter metrics by name.
limit
integer
limit
integer
Limit the number of results.
curl --request POST \
--url https://localhost:7001/query/metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"start_time": "2023-01-01T00:00:00Z",
"end_time": "2023-01-02T00:00:00Z",
"service_name": "<string>",
"metric_name": "<string>",
"limit": 123
}'
{
"exponential_histograms": [
{
"resource_attributes": {},
"resource_schema_url": "<string>",
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"scope_dropped_attr_count": 123,
"scope_schema_url": "<string>",
"metric_name": "<string>",
"metric_description": "<string>",
"metric_unit": "<string>",
"attributes": {},
"start_time_unix": "2023-11-07T05:31:56Z",
"time_unix": "2023-11-07T05:31:56Z",
"count": 123,
"sum": 123,
"scale": 123,
"zero_count": 123,
"positive_offset": 123,
"positive_bucket_counts": [
123
],
"negative_offset": 123,
"negative_bucket_counts": [
123
],
"exemplars": [
{
"filtered_attributes": {},
"time_unix": "2023-11-07T05:31:56Z",
"value": 123,
"span_id": "<string>",
"trace_id": "<string>"
}
],
"flags": 123,
"min": 123,
"max": 123
}
],
"gauges": [
{
"resource_attributes": {},
"resource_schema_url": "<string>",
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"scope_dropped_attr_count": 123,
"scope_schema_url": "<string>",
"metric_name": "<string>",
"metric_description": "<string>",
"metric_unit": "<string>",
"attributes": {},
"start_time_unix": "2023-11-07T05:31:56Z",
"time_unix": "2023-11-07T05:31:56Z",
"value": 123,
"flags": 123,
"exemplars": [
{
"filtered_attributes": {},
"time_unix": "2023-11-07T05:31:56Z",
"value": 123,
"span_id": "<string>",
"trace_id": "<string>"
}
]
}
],
"histograms": [
{
"resource_attributes": {},
"resource_schema_url": "<string>",
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"scope_dropped_attr_count": 123,
"scope_schema_url": "<string>",
"metric_name": "<string>",
"metric_description": "<string>",
"metric_unit": "<string>",
"attributes": {},
"start_time_unix": "2023-11-07T05:31:56Z",
"time_unix": "2023-11-07T05:31:56Z",
"count": 123,
"sum": 123,
"bucket_counts": [
123
],
"explicit_bounds": [
123
],
"exemplars": [
{
"filtered_attributes": {},
"time_unix": "2023-11-07T05:31:56Z",
"value": 123,
"span_id": "<string>",
"trace_id": "<string>"
}
],
"flags": 123,
"min": 123,
"max": 123
}
],
"sums": [
{
"resource_attributes": {},
"resource_schema_url": "<string>",
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"scope_dropped_attr_count": 123,
"scope_schema_url": "<string>",
"metric_name": "<string>",
"metric_description": "<string>",
"metric_unit": "<string>",
"attributes": {},
"start_time_unix": "2023-11-07T05:31:56Z",
"time_unix": "2023-11-07T05:31:56Z",
"value": 123,
"flags": 123,
"exemplars": [
{
"filtered_attributes": {},
"time_unix": "2023-11-07T05:31:56Z",
"value": 123,
"span_id": "<string>",
"trace_id": "<string>"
}
],
"agg_temp": 123,
"is_monotonic": true
}
],
"summaries": [
{
"resource_attributes": {},
"resource_schema_url": "<string>",
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"scope_dropped_attr_count": 123,
"scope_schema_url": "<string>",
"metric_name": "<string>",
"metric_description": "<string>",
"metric_unit": "<string>",
"attributes": {},
"start_time_unix": "2023-11-07T05:31:56Z",
"time_unix": "2023-11-07T05:31:56Z",
"count": 123,
"sum": 123,
"value_at_quantiles": [
{
"quantile": 123,
"value": 123
}
],
"flags": 123
}
]
}
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
start_time
string
Start time for the query.
end_time
string
End time for the query.
service_name
string
Filter metrics by service name.
metric_name
string
Filter metrics by name.
limit
integer
default: 100Limit the number of results.
Response
200 - application/json
exponential_histograms
object[]
exponential_histograms.resource_attributes
object
exponential_histograms.resource_schema_url
string
exponential_histograms.scope_name
string
exponential_histograms.scope_version
string
exponential_histograms.scope_attributes
object
exponential_histograms.scope_dropped_attr_count
integer
exponential_histograms.scope_schema_url
string
exponential_histograms.metric_name
string
exponential_histograms.metric_description
string
exponential_histograms.metric_unit
string
exponential_histograms.attributes
object
exponential_histograms.start_time_unix
string
exponential_histograms.time_unix
string
exponential_histograms.count
integer
exponential_histograms.sum
number
exponential_histograms.scale
integer
exponential_histograms.zero_count
integer
exponential_histograms.positive_offset
integer
exponential_histograms.positive_bucket_counts
integer[]
exponential_histograms.negative_offset
integer
exponential_histograms.negative_bucket_counts
integer[]
exponential_histograms.exemplars
object[]
exponential_histograms.exemplars.filtered_attributes
object
exponential_histograms.exemplars.time_unix
string
exponential_histograms.exemplars.value
number
exponential_histograms.exemplars.span_id
string
exponential_histograms.exemplars.trace_id
string
exponential_histograms.flags
integer
exponential_histograms.min
number
exponential_histograms.max
number
gauges
object[]
gauges.resource_attributes
object
gauges.resource_schema_url
string
gauges.scope_name
string
gauges.scope_version
string
gauges.scope_attributes
object
gauges.scope_dropped_attr_count
integer
gauges.scope_schema_url
string
gauges.metric_name
string
gauges.metric_description
string
gauges.metric_unit
string
gauges.attributes
object
gauges.start_time_unix
string
gauges.time_unix
string
gauges.value
number
gauges.flags
integer
gauges.exemplars
object[]
gauges.exemplars.filtered_attributes
object
gauges.exemplars.time_unix
string
gauges.exemplars.value
number
gauges.exemplars.span_id
string
gauges.exemplars.trace_id
string
histograms
object[]
histograms.resource_attributes
object
histograms.resource_schema_url
string
histograms.scope_name
string
histograms.scope_version
string
histograms.scope_attributes
object
histograms.scope_dropped_attr_count
integer
histograms.scope_schema_url
string
histograms.metric_name
string
histograms.metric_description
string
histograms.metric_unit
string
histograms.attributes
object
histograms.start_time_unix
string
histograms.time_unix
string
histograms.count
integer
histograms.sum
number
histograms.bucket_counts
integer[]
histograms.explicit_bounds
number[]
histograms.exemplars
object[]
histograms.exemplars.filtered_attributes
object
histograms.exemplars.time_unix
string
histograms.exemplars.value
number
histograms.exemplars.span_id
string
histograms.exemplars.trace_id
string
histograms.flags
integer
histograms.min
number
histograms.max
number
sums
object[]
sums.resource_attributes
object
sums.resource_schema_url
string
sums.scope_name
string
sums.scope_version
string
sums.scope_attributes
object
sums.scope_dropped_attr_count
integer
sums.scope_schema_url
string
sums.metric_name
string
sums.metric_description
string
sums.metric_unit
string
sums.attributes
object
sums.start_time_unix
string
sums.time_unix
string
sums.value
number
sums.flags
integer
sums.exemplars
object[]
sums.exemplars.filtered_attributes
object
sums.exemplars.time_unix
string
sums.exemplars.value
number
sums.exemplars.span_id
string
sums.exemplars.trace_id
string
sums.agg_temp
integer
sums.is_monotonic
boolean
summaries
object[]
summaries.resource_attributes
object
summaries.resource_schema_url
string
summaries.scope_name
string
summaries.scope_version
string
summaries.scope_attributes
object
summaries.scope_dropped_attr_count
integer
summaries.scope_schema_url
string
summaries.metric_name
string
summaries.metric_description
string
summaries.metric_unit
string
summaries.attributes
object
summaries.start_time_unix
string
summaries.time_unix
string
summaries.count
integer
summaries.sum
number
summaries.value_at_quantiles
object[]
summaries.value_at_quantiles.quantile
number
summaries.value_at_quantiles.value
number
summaries.flags
integer
curl --request POST \
--url https://localhost:7001/query/metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"start_time": "2023-01-01T00:00:00Z",
"end_time": "2023-01-02T00:00:00Z",
"service_name": "<string>",
"metric_name": "<string>",
"limit": 123
}'
{
"exponential_histograms": [
{
"resource_attributes": {},
"resource_schema_url": "<string>",
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"scope_dropped_attr_count": 123,
"scope_schema_url": "<string>",
"metric_name": "<string>",
"metric_description": "<string>",
"metric_unit": "<string>",
"attributes": {},
"start_time_unix": "2023-11-07T05:31:56Z",
"time_unix": "2023-11-07T05:31:56Z",
"count": 123,
"sum": 123,
"scale": 123,
"zero_count": 123,
"positive_offset": 123,
"positive_bucket_counts": [
123
],
"negative_offset": 123,
"negative_bucket_counts": [
123
],
"exemplars": [
{
"filtered_attributes": {},
"time_unix": "2023-11-07T05:31:56Z",
"value": 123,
"span_id": "<string>",
"trace_id": "<string>"
}
],
"flags": 123,
"min": 123,
"max": 123
}
],
"gauges": [
{
"resource_attributes": {},
"resource_schema_url": "<string>",
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"scope_dropped_attr_count": 123,
"scope_schema_url": "<string>",
"metric_name": "<string>",
"metric_description": "<string>",
"metric_unit": "<string>",
"attributes": {},
"start_time_unix": "2023-11-07T05:31:56Z",
"time_unix": "2023-11-07T05:31:56Z",
"value": 123,
"flags": 123,
"exemplars": [
{
"filtered_attributes": {},
"time_unix": "2023-11-07T05:31:56Z",
"value": 123,
"span_id": "<string>",
"trace_id": "<string>"
}
]
}
],
"histograms": [
{
"resource_attributes": {},
"resource_schema_url": "<string>",
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"scope_dropped_attr_count": 123,
"scope_schema_url": "<string>",
"metric_name": "<string>",
"metric_description": "<string>",
"metric_unit": "<string>",
"attributes": {},
"start_time_unix": "2023-11-07T05:31:56Z",
"time_unix": "2023-11-07T05:31:56Z",
"count": 123,
"sum": 123,
"bucket_counts": [
123
],
"explicit_bounds": [
123
],
"exemplars": [
{
"filtered_attributes": {},
"time_unix": "2023-11-07T05:31:56Z",
"value": 123,
"span_id": "<string>",
"trace_id": "<string>"
}
],
"flags": 123,
"min": 123,
"max": 123
}
],
"sums": [
{
"resource_attributes": {},
"resource_schema_url": "<string>",
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"scope_dropped_attr_count": 123,
"scope_schema_url": "<string>",
"metric_name": "<string>",
"metric_description": "<string>",
"metric_unit": "<string>",
"attributes": {},
"start_time_unix": "2023-11-07T05:31:56Z",
"time_unix": "2023-11-07T05:31:56Z",
"value": 123,
"flags": 123,
"exemplars": [
{
"filtered_attributes": {},
"time_unix": "2023-11-07T05:31:56Z",
"value": 123,
"span_id": "<string>",
"trace_id": "<string>"
}
],
"agg_temp": 123,
"is_monotonic": true
}
],
"summaries": [
{
"resource_attributes": {},
"resource_schema_url": "<string>",
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"scope_dropped_attr_count": 123,
"scope_schema_url": "<string>",
"metric_name": "<string>",
"metric_description": "<string>",
"metric_unit": "<string>",
"attributes": {},
"start_time_unix": "2023-11-07T05:31:56Z",
"time_unix": "2023-11-07T05:31:56Z",
"count": 123,
"sum": 123,
"value_at_quantiles": [
{
"quantile": 123,
"value": 123
}
],
"flags": 123
}
]
}