All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| GetExemplarsQuery | Get /metrics/query_exemplars | Experimental: Exemplars for a specific time range |
| GetInstantQuery | Get /metrics/query | Instant query at a single point in time |
| GetLabelValues | Get /metrics/label/{label}/values | List of label values for a provided label name |
| GetLabels | Get /metrics/labels | List of label names |
| GetMetadata | Get /metrics/metadata | Metadata about metrics currently scraped from targets |
| GetRangeQuery | Get /metrics/query_range | Query over a range of time |
| GetSeries | Get /metrics/series | List of time series that match a certain label set |
| PostExemplarsQuery | Post /metrics/query_exemplars | Experimental: Exemplars for a specific time range |
| PostInstantQuery | Post /metrics/query | Instant query at a single point in time |
| PostLabelValues | Post /metrics/label/{label}/values | List of label values for a provided label name |
| PostLabels | Post /metrics/labels | List of label names |
| PostMetadata | Post /metrics/metadata | Metadata about metrics currently scraped from targets |
| PostRangeQuery | Post /metrics/query_range | Query over a range of time |
| PostSeries | Post /metrics/series | List of time series that match a certain label set |
PromExemplarEnvelope GetExemplarsQuery(ctx).Query(query).Start(start).End(end).Execute()
Experimental: Exemplars for a specific time range
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
query := "query_example" // string | Prometheus expression query string
start := "2015-07-01T20:10:51.781Z or 1660817432" // string | Start timestamp in rfc3339 format or unix format (optional)
end := "2015-07-01T20:10:51.781Z or 1660817432" // string | End timestamp in rfc3339 format or unix format (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.GetExemplarsQuery(context.Background()).Query(query).Start(start).End(end).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.GetExemplarsQuery``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetExemplarsQuery`: PromExemplarEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.GetExemplarsQuery`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetExemplarsQueryRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| query | string | Prometheus expression query string | |
| start | string | Start timestamp in rfc3339 format or unix format | |
| end | string | End timestamp in rfc3339 format or unix format |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromEnvelope GetInstantQuery(ctx).Query(query).Time(time).Timeout(timeout).Step(step).PostFilter(postFilter).Execute()
Instant query at a single point in time
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
query := "query_example" // string | Prometheus expression query string
time := "2015-07-01T20:10:51.781Z or 1660817432" // string | Evaluation timestamp in rfc3339 format or unix format (optional)
timeout := "timeout_example" // string | Evaluation timeout (optional)
step := "5m or 300" // string | Query resolution step width in duration format or float number of seconds. (optional)
postFilter := []string{"Inner_example"} // []string | Enforce additional label filters for queries (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.GetInstantQuery(context.Background()).Query(query).Time(time).Timeout(timeout).Step(step).PostFilter(postFilter).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.GetInstantQuery``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetInstantQuery`: PromEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.GetInstantQuery`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetInstantQueryRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| query | string | Prometheus expression query string | |
| time | string | Evaluation timestamp in rfc3339 format or unix format | |
| timeout | string | Evaluation timeout | |
| step | string | Query resolution step width in duration format or float number of seconds. | |
| postFilter | []string | Enforce additional label filters for queries |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromLabelsEnvelope GetLabelValues(ctx, label).Start(start).End(end).Match(match).Execute()
List of label values for a provided label name
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
label := "label_example" // string | Prometheus query label
start := "2015-07-01T20:10:51.781Z or 1660817432" // string | Start timestamp in rfc3339 format or unix format (optional)
end := "2015-07-01T20:10:51.781Z or 1660817432" // string | End timestamp in rfc3339 format or unix format (optional)
match := []string{"Inner_example"} // []string | Repeated series selector argument that selects the series from which to read the label names. Optional. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.GetLabelValues(context.Background(), label).Start(start).End(end).Match(match).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.GetLabelValues``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetLabelValues`: PromLabelsEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.GetLabelValues`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| label | string | Prometheus query label |
Other parameters are passed through a pointer to a apiGetLabelValuesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
start | string | Start timestamp in rfc3339 format or unix format | end | string | End timestamp in rfc3339 format or unix format | match | []string | Repeated series selector argument that selects the series from which to read the label names. Optional. |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromLabelsEnvelope GetLabels(ctx).Start(start).End(end).Match(match).Execute()
List of label names
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
start := "2015-07-01T20:10:51.781Z or 1660817432" // string | Start timestamp in rfc3339 format or unix format (optional)
end := "2015-07-01T20:10:51.781Z or 1660817432" // string | End timestamp in rfc3339 format or unix format (optional)
match := []string{"Inner_example"} // []string | Repeated series selector argument that selects the series from which to read the label names. Optional. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.GetLabels(context.Background()).Start(start).End(end).Match(match).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.GetLabels``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetLabels`: PromLabelsEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.GetLabels`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetLabelsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| start | string | Start timestamp in rfc3339 format or unix format | |
| end | string | End timestamp in rfc3339 format or unix format | |
| match | []string | Repeated series selector argument that selects the series from which to read the label names. Optional. |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromMetadataEnvelope GetMetadata(ctx).Limit(limit).Metric(metric).Execute()
Metadata about metrics currently scraped from targets
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
limit := int64(2) // int64 | Maximum number of metrics to return. (optional)
metric := "http_requests_total" // string | A metric name to filter metadata for. All metric metadata is retrieved if left empty. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.GetMetadata(context.Background()).Limit(limit).Metric(metric).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.GetMetadata``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetMetadata`: PromMetadataEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.GetMetadata`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetMetadataRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int64 | Maximum number of metrics to return. | |
| metric | string | A metric name to filter metadata for. All metric metadata is retrieved if left empty. |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromEnvelope GetRangeQuery(ctx).Query(query).Start(start).End(end).Step(step).Timeout(timeout).Aligned(aligned).MaxNumberOfDataPoints(maxNumberOfDataPoints).PostFilter(postFilter).Execute()
Query over a range of time
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
query := "query_example" // string | Prometheus expression query string
start := "2015-07-01T20:10:51.781Z or 1660817432" // string | Start timestamp in rfc3339 format or unix format
end := "2015-07-01T20:10:51.781Z or 1660817432" // string | End timestamp in rfc3339 format or unix format
step := "5m or 300" // string | Query resolution step width in duration format or float number of seconds.
timeout := "timeout_example" // string | Evaluation timeout (optional)
aligned := true // bool | Align start and end times with step size (optional)
maxNumberOfDataPoints := int64(2) // int64 | Maximum number of data points to return. (optional)
postFilter := []string{"Inner_example"} // []string | Enforce additional label filters for queries (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.GetRangeQuery(context.Background()).Query(query).Start(start).End(end).Step(step).Timeout(timeout).Aligned(aligned).MaxNumberOfDataPoints(maxNumberOfDataPoints).PostFilter(postFilter).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.GetRangeQuery``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetRangeQuery`: PromEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.GetRangeQuery`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetRangeQueryRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| query | string | Prometheus expression query string | |
| start | string | Start timestamp in rfc3339 format or unix format | |
| end | string | End timestamp in rfc3339 format or unix format | |
| step | string | Query resolution step width in duration format or float number of seconds. | |
| timeout | string | Evaluation timeout | |
| aligned | bool | Align start and end times with step size | |
| maxNumberOfDataPoints | int64 | Maximum number of data points to return. | |
| postFilter | []string | Enforce additional label filters for queries |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromSeriesEnvelope GetSeries(ctx).Match(match).Start(start).End(end).Execute()
List of time series that match a certain label set
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
match := []string{"Inner_example"} // []string | Repeated series selector argument that selects the series to return. At least one match[] argument must be provided.
start := "2015-07-01T20:10:51.781Z or 1660817432" // string | Start timestamp in rfc3339 format or unix format (optional)
end := "2015-07-01T20:10:51.781Z or 1660817432" // string | End timestamp in rfc3339 format or unix format (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.GetSeries(context.Background()).Match(match).Start(start).End(end).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.GetSeries``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetSeries`: PromSeriesEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.GetSeries`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetSeriesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| match | []string | Repeated series selector argument that selects the series to return. At least one match[] argument must be provided. | |
| start | string | Start timestamp in rfc3339 format or unix format | |
| end | string | End timestamp in rfc3339 format or unix format |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromExemplarEnvelope PostExemplarsQuery(ctx).Query(query).Start(start).End(end).Execute()
Experimental: Exemplars for a specific time range
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
query := "query_example" // string |
start := "start_example" // string | (optional)
end := "end_example" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.PostExemplarsQuery(context.Background()).Query(query).Start(start).End(end).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.PostExemplarsQuery``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostExemplarsQuery`: PromExemplarEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.PostExemplarsQuery`: %v\n", resp)
}Other parameters are passed through a pointer to a apiPostExemplarsQueryRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| query | string | ||
| start | string | ||
| end | string |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromEnvelope PostInstantQuery(ctx).Query(query).Time(time).Timeout(timeout).Step(step).PostFilter(postFilter).Execute()
Instant query at a single point in time
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
query := "query_example" // string |
time := "time_example" // string | (optional)
timeout := "timeout_example" // string | (optional)
step := "step_example" // string | (optional)
postFilter := []string{"Inner_example"} // []string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.PostInstantQuery(context.Background()).Query(query).Time(time).Timeout(timeout).Step(step).PostFilter(postFilter).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.PostInstantQuery``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostInstantQuery`: PromEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.PostInstantQuery`: %v\n", resp)
}Other parameters are passed through a pointer to a apiPostInstantQueryRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| query | string | ||
| time | string | ||
| timeout | string | ||
| step | string | ||
| postFilter | []string |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromLabelsEnvelope PostLabelValues(ctx, label).Start(start).End(end).Match(match).Execute()
List of label values for a provided label name
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
label := "label_example" // string | Prometheus query label
start := "start_example" // string | (optional)
end := "end_example" // string | (optional)
match := []string{"Inner_example"} // []string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.PostLabelValues(context.Background(), label).Start(start).End(end).Match(match).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.PostLabelValues``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostLabelValues`: PromLabelsEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.PostLabelValues`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| label | string | Prometheus query label |
Other parameters are passed through a pointer to a apiPostLabelValuesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
start | string | | end | string | | match | []string | |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromLabelsEnvelope PostLabels(ctx).Start(start).End(end).Match(match).Execute()
List of label names
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
start := "start_example" // string | (optional)
end := "end_example" // string | (optional)
match := []string{"Inner_example"} // []string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.PostLabels(context.Background()).Start(start).End(end).Match(match).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.PostLabels``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostLabels`: PromLabelsEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.PostLabels`: %v\n", resp)
}Other parameters are passed through a pointer to a apiPostLabelsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| start | string | ||
| end | string | ||
| match | []string |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromMetadataEnvelope PostMetadata(ctx).Limit(limit).Metric(metric).Execute()
Metadata about metrics currently scraped from targets
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
limit := int64(789) // int64 | (optional)
metric := "metric_example" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.PostMetadata(context.Background()).Limit(limit).Metric(metric).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.PostMetadata``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostMetadata`: PromMetadataEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.PostMetadata`: %v\n", resp)
}Other parameters are passed through a pointer to a apiPostMetadataRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int64 | ||
| metric | string |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromEnvelope PostRangeQuery(ctx).Query(query).Start(start).End(end).Step(step).Timeout(timeout).Aligned(aligned).MaxNumberOfDataPoints(maxNumberOfDataPoints).PostFilter(postFilter).Execute()
Query over a range of time
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
query := "query_example" // string |
start := "start_example" // string |
end := "end_example" // string |
step := "step_example" // string |
timeout := "timeout_example" // string | (optional)
aligned := true // bool | (optional)
maxNumberOfDataPoints := int64(789) // int64 | (optional)
postFilter := []string{"Inner_example"} // []string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.PostRangeQuery(context.Background()).Query(query).Start(start).End(end).Step(step).Timeout(timeout).Aligned(aligned).MaxNumberOfDataPoints(maxNumberOfDataPoints).PostFilter(postFilter).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.PostRangeQuery``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostRangeQuery`: PromEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.PostRangeQuery`: %v\n", resp)
}Other parameters are passed through a pointer to a apiPostRangeQueryRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| query | string | ||
| start | string | ||
| end | string | ||
| step | string | ||
| timeout | string | ||
| aligned | bool | ||
| maxNumberOfDataPoints | int64 | ||
| postFilter | []string |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PromSeriesEnvelope PostSeries(ctx).Match(match).Start(start).End(end).Execute()
List of time series that match a certain label set
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
match := []string{"Inner_example"} // []string |
start := "start_example" // string | (optional)
end := "end_example" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MetricApi.PostSeries(context.Background()).Match(match).Start(start).End(end).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.PostSeries``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostSeries`: PromSeriesEnvelope
fmt.Fprintf(os.Stdout, "Response from `MetricApi.PostSeries`: %v\n", resp)
}Other parameters are passed through a pointer to a apiPostSeriesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| match | []string | ||
| start | string | ||
| end | string |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]