Skip to main content
GET
List the metrics of an application's connected source

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

authorization
string | null
x-ankra-organisation-id
string | null

Query Parameters

application
string<uuid>
required

The application whose namespace in your source is listed.

environment
string

An environment id or name, to pick one place when the application runs in several.

cluster
string<uuid>

A cluster id, to pick one place when the application runs in several.

starts_with
string

Lists only the metric names that start with this; not starting with __.

Maximum string length: 200
Pattern: ^[a-zA-Z_:][a-zA-Z0-9_:]*$
metric
string

A metric name whose labels are read too, so a card of it can be split by one; not starting with __.

Maximum string length: 200
Pattern: ^[a-zA-Z_:][a-zA-Z0-9_:]*$

Response

The list was answered. Its state says whether names came back: ok, empty (your source holds no metric for the application's namespace in the last 24 hours), unavailable (no source is connected, the cluster cannot be reached, or the source did not answer within 10 seconds; reason says why) or denied (reason names the missing permission).

state
enum<string>
required
Available options:
ok,
empty,
unavailable,
denied
observed_at
string<date-time> | null
required
source_flavour
enum<string> | null
required

The flavour the source was saved with. Null when none was saved, or when the saved word is not one of these.

Available options:
self_hosted,
grafana_cloud,
victoria_metrics
cluster_id
string<uuid> | null
required
namespace
string | null
required
window
CanvasSourceMetricsWindow · object | null
required
metrics
CanvasSourceMetric · object[]
required
Maximum array length: 500
metrics_truncated
boolean
required

True when the list may not hold every metric: Ankra cut it at metric_cap (reason_code over_cap), or the source sent exactly the metric_cap+1 names it is asked for at most and so may hold more (reason_code list_may_be_incomplete).

metric_cap
integer
required
metrics_left_out
integer
required

How many names the source sent that the list cannot offer (a dotted OpenTelemetry name, a name outside the Prometheus name pattern, a name starting __). Above 0, a reason says so with reason_code names_unusable; when no name could be listed the state is unavailable, never empty.

Required range: x >= 0
metadata_state
enum<string>
required
Available options:
read,
unread,
not_asked
labels
string[] | null
required

The labels a card of the named metric can be split by; null unless metric was given and they were read.

Maximum array length: 100
labels_state
enum<string>
required
Available options:
read,
unread,
not_asked
labels_truncated
boolean
required
label_cap
integer
required
reason
string
reason_code
enum<string>

Names, for a program, the case a reason sentence describes; the sentence is for people and may be reworded. A closed set: no_source, sandbox_cluster, source_kind_unreadable, credential_unreadable, cluster_offline, no_agent (the source cannot be reached); source_timeout; read_budget_spent (the organisation spent its reads against its metrics sources for this minute; try again shortly); source_refused; source_answer_unreadable; not_wired; platform_failed (a fault on Ankra's side, not the source's); denied; not_deployed; several_places; namespace_unusable; range_not_started; nothing_found; no_number; nothing_observed; not_a_histogram; over_cap; list_may_be_incomplete; names_unusable; answer_too_large; above_highest_bound; missing_samples; placements_unreadable (where the application runs could not be read); request_cancelled (the request was cancelled before the answer was read; nothing failed); source_flagged_answer (the source sent data but warned or said its answer is incomplete: the answer is ok, its reason quotes the source, and it may miss what the source could not read); source_flagged_empty (the source sent nothing but warned or said its answer is incomplete, so Ankra does not say there is none: the answer is unavailable). When a reason joins several sentences, the code names the first.

Available options:
no_source,
sandbox_cluster,
source_kind_unreadable,
credential_unreadable,
cluster_offline,
no_agent,
source_timeout,
read_budget_spent,
source_refused,
source_answer_unreadable,
not_wired,
platform_failed,
denied,
not_deployed,
several_places,
namespace_unusable,
range_not_started,
nothing_found,
no_number,
nothing_observed,
not_a_histogram,
over_cap,
list_may_be_incomplete,
names_unusable,
answer_too_large,
above_highest_bound,
missing_samples,
placements_unreadable,
request_cancelled,
source_flagged_answer,
source_flagged_empty
metadata_reason
string
metadata_reason_code
enum<string>

Names, for a program, the case a reason sentence describes; the sentence is for people and may be reworded. A closed set: no_source, sandbox_cluster, source_kind_unreadable, credential_unreadable, cluster_offline, no_agent (the source cannot be reached); source_timeout; read_budget_spent (the organisation spent its reads against its metrics sources for this minute; try again shortly); source_refused; source_answer_unreadable; not_wired; platform_failed (a fault on Ankra's side, not the source's); denied; not_deployed; several_places; namespace_unusable; range_not_started; nothing_found; no_number; nothing_observed; not_a_histogram; over_cap; list_may_be_incomplete; names_unusable; answer_too_large; above_highest_bound; missing_samples; placements_unreadable (where the application runs could not be read); request_cancelled (the request was cancelled before the answer was read; nothing failed); source_flagged_answer (the source sent data but warned or said its answer is incomplete: the answer is ok, its reason quotes the source, and it may miss what the source could not read); source_flagged_empty (the source sent nothing but warned or said its answer is incomplete, so Ankra does not say there is none: the answer is unavailable). When a reason joins several sentences, the code names the first.

Available options:
no_source,
sandbox_cluster,
source_kind_unreadable,
credential_unreadable,
cluster_offline,
no_agent,
source_timeout,
read_budget_spent,
source_refused,
source_answer_unreadable,
not_wired,
platform_failed,
denied,
not_deployed,
several_places,
namespace_unusable,
range_not_started,
nothing_found,
no_number,
nothing_observed,
not_a_histogram,
over_cap,
list_may_be_incomplete,
names_unusable,
answer_too_large,
above_highest_bound,
missing_samples,
placements_unreadable,
request_cancelled,
source_flagged_answer,
source_flagged_empty
labels_reason
string
labels_reason_code
enum<string>

Names, for a program, the case a reason sentence describes; the sentence is for people and may be reworded. A closed set: no_source, sandbox_cluster, source_kind_unreadable, credential_unreadable, cluster_offline, no_agent (the source cannot be reached); source_timeout; read_budget_spent (the organisation spent its reads against its metrics sources for this minute; try again shortly); source_refused; source_answer_unreadable; not_wired; platform_failed (a fault on Ankra's side, not the source's); denied; not_deployed; several_places; namespace_unusable; range_not_started; nothing_found; no_number; nothing_observed; not_a_histogram; over_cap; list_may_be_incomplete; names_unusable; answer_too_large; above_highest_bound; missing_samples; placements_unreadable (where the application runs could not be read); request_cancelled (the request was cancelled before the answer was read; nothing failed); source_flagged_answer (the source sent data but warned or said its answer is incomplete: the answer is ok, its reason quotes the source, and it may miss what the source could not read); source_flagged_empty (the source sent nothing but warned or said its answer is incomplete, so Ankra does not say there is none: the answer is unavailable). When a reason joins several sentences, the code names the first.

Available options:
no_source,
sandbox_cluster,
source_kind_unreadable,
credential_unreadable,
cluster_offline,
no_agent,
source_timeout,
read_budget_spent,
source_refused,
source_answer_unreadable,
not_wired,
platform_failed,
denied,
not_deployed,
several_places,
namespace_unusable,
range_not_started,
nothing_found,
no_number,
nothing_observed,
not_a_histogram,
over_cap,
list_may_be_incomplete,
names_unusable,
answer_too_large,
above_highest_bound,
missing_samples,
placements_unreadable,
request_cancelled,
source_flagged_answer,
source_flagged_empty