v1alpha1

package
v0.23.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2026 License: AGPL-3.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package v1alpha1 contains the metrics.apoxy.dev API group: the metric catalog (Metric), the per-project schema registry (MetricSource), the time-series result of a catalog recipe (MetricSeriesSet), and the per-object snapshot kinds returned by the <owner>/<name>/metrics connect subresources. All kinds are cluster-scoped, because the apiserver serves exactly one project. Storage for this group is custom and is mounted by the deployment that owns the ClickHouse read model. See docs/design-plans/2026-08-20-project-metrics-api.mdx in the apoxy-cloud repository for the design.

Index

Constants

View Source
const (
	// ManagedLabel marks a recipe that the server compiled into the binary and
	// wrote to storage at startup. It is informational and is set by the
	// server; a client write of the label is stripped by admission.
	ManagedLabel = "metrics.apoxy.dev/managed"

	// ReservedNamePrefix is the name prefix admission reserves for built-in
	// recipes, so a user recipe cannot shadow one.
	ReservedNamePrefix = "http."

	// ReservedNameSeries is the one name a recipe may not take, because it
	// would collide with the series subresource path element.
	ReservedNameSeries = "series"
)
View Source
const (
	// MetricHTTPRequests is the built-in request-count recipe.
	MetricHTTPRequests = "http.requests"
	// MetricHTTPLatency is the built-in latency-percentile recipe.
	MetricHTTPLatency = "http.latency"

	// MeasureTotal is the request-count measure of http.requests.
	MeasureTotal = "total"
	// MeasureStatus5xx is the 5xx-count measure of http.requests.
	MeasureStatus5xx = "status_5xx"
	// MeasureP99 is the 99th-percentile measure of http.latency.
	MeasureP99 = "p99"
)

Built-in recipe and measure names the snapshot table columns read. A snapshot carries every applicable recipe; the table shows the three a human scans a list by.

View Source
const GroupName = "metrics.apoxy.dev"

GroupName specifies the group name used to register the objects.

View Source
const MetricConditionCompiled = "Compiled"

MetricConditionCompiled reports whether spec.prql compiles against the current schema registry. A recipe that stops compiling after a discovered attribute disappears is skipped by snapshots and is a 422 from series.

Variables

View Source
var (
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	// Deprecated: use Install instead
	AddToScheme = localSchemeBuilder.AddToScheme
	Install     = localSchemeBuilder.AddToScheme
)
View Source
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"}

GroupVersion specifies the group and the version used to register the objects.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects Deprecated: use GroupVersion instead.

Functions

func AllKinds

func AllKinds() []runtime.Object

AllKinds is every kind of the group, for a caller that must register the group in a scheme it does not own. The connect result kinds (MetricSeriesSet and the snapshot kinds) have no resource.Object of their own, so a builder that mounts custom storage cannot pick them up from a resource list.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type BackendMetrics

type BackendMetrics struct {
	// Kind is the backend kind, for example Backend or Service.
	Kind string `json:"kind,omitempty"`
	// Name is the backend name.
	Name string `json:"name,omitempty"`
	// Metrics is every evaluated recipe for the backend.
	Metrics MetricsMap `json:"metrics,omitempty"`
}

BackendMetrics is one backend's share of an HTTPRoute.

func (*BackendMetrics) DeepCopy

func (in *BackendMetrics) DeepCopy() *BackendMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendMetrics.

func (*BackendMetrics) DeepCopyInto

func (in *BackendMetrics) DeepCopyInto(out *BackendMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FieldRole

type FieldRole string

FieldRole says what a source field can be used for in a recipe.

const (
	// FieldRoleTime is the bucket column of the source.
	FieldRoleTime FieldRole = "time"
	// FieldRoleKey is a groupable dimension. The groupBy parameter accepts
	// exactly these fields.
	FieldRoleKey FieldRole = "key"
	// FieldRoleMeasure is a value column a recipe aggregates.
	FieldRoleMeasure FieldRole = "measure"
)

type GatewayMetrics

type GatewayMetrics struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	SnapshotMeta      `json:",inline"`

	// Metrics is the Gateway totals, one entry per evaluated recipe.
	Metrics MetricsMap `json:"metrics,omitempty"`
	// Units maps a measure name to its display unit, echoed from the catalog.
	Units map[string]string `json:"units,omitempty"`
	// Listeners is the first nesting level, always present.
	Listeners []ListenerMetrics `json:"listeners,omitempty"`
}

GatewayMetrics is the snapshot returned by gateways/<name>/metrics.

func (*GatewayMetrics) ConvertToTable

func (s *GatewayMetrics) ConvertToTable(_ context.Context, tableOptions runtime.Object) (*metav1.Table, error)

ConvertToTable renders the snapshot for kubectl get and apoxy get.

func (*GatewayMetrics) DeepCopy

func (in *GatewayMetrics) DeepCopy() *GatewayMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayMetrics.

func (*GatewayMetrics) DeepCopyInto

func (in *GatewayMetrics) DeepCopyInto(out *GatewayMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GatewayMetrics) DeepCopyObject

func (in *GatewayMetrics) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HTTPRouteMetrics

type HTTPRouteMetrics struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	SnapshotMeta      `json:",inline"`

	// Metrics is the route totals, one entry per evaluated recipe.
	Metrics MetricsMap `json:"metrics,omitempty"`
	// Units maps a measure name to its display unit.
	Units map[string]string `json:"units,omitempty"`
	// Rules is present only with include=rules.
	Rules []RuleMetrics `json:"rules,omitempty"`
	// Backends is present only with include=backends.
	Backends []BackendMetrics `json:"backends,omitempty"`
	// Truncated is set when top cut a leaf list.
	Truncated bool `json:"truncated,omitempty"`
	// TotalCount is how many leaf rows had traffic in the window.
	TotalCount int `json:"totalCount,omitempty"`
}

HTTPRouteMetrics is the snapshot returned by httproutes/<name>/metrics. It cuts its own leaf lists, so truncated and totalCount sit on it.

func (*HTTPRouteMetrics) ConvertToTable

func (s *HTTPRouteMetrics) ConvertToTable(_ context.Context, tableOptions runtime.Object) (*metav1.Table, error)

ConvertToTable renders the snapshot for kubectl get and apoxy get.

func (*HTTPRouteMetrics) DeepCopy

func (in *HTTPRouteMetrics) DeepCopy() *HTTPRouteMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRouteMetrics.

func (*HTTPRouteMetrics) DeepCopyInto

func (in *HTTPRouteMetrics) DeepCopyInto(out *HTTPRouteMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HTTPRouteMetrics) DeepCopyObject

func (in *HTTPRouteMetrics) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ListenerMetrics

type ListenerMetrics struct {
	// Name is the listener name.
	Name string `json:"name,omitempty"`
	// Metrics is every evaluated recipe for the listener.
	Metrics MetricsMap `json:"metrics,omitempty"`
	// Routes is present only with include=routes, ranked by orderBy.
	Routes []RouteMetrics `json:"routes,omitempty"`
	// Truncated is set when top cut the route list.
	Truncated bool `json:"truncated,omitempty"`
	// TotalCount is how many routes had traffic in the window.
	TotalCount int `json:"totalCount,omitempty"`
}

ListenerMetrics is one listener's share of a Gateway. It cuts its own route list, so truncated and totalCount sit here rather than on the Gateway.

func (*ListenerMetrics) DeepCopy

func (in *ListenerMetrics) DeepCopy() *ListenerMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenerMetrics.

func (*ListenerMetrics) DeepCopyInto

func (in *ListenerMetrics) DeepCopyInto(out *ListenerMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MeasureType

type MeasureType string

MeasureType is the value domain of one measure. A client formats an integer measure without a decimal part.

const (
	// MeasureTypeInteger is a whole-number measure, such as a request count.
	MeasureTypeInteger MeasureType = "integer"
	// MeasureTypeFloat is a fractional measure, such as a latency percentile.
	MeasureTypeFloat MeasureType = "float"
)

type Measures

type Measures map[string]float64

Measures is one recipe's output columns for a window. Values are plain JSON numbers, integral where the catalog declares the measure type as integer. Units are not encoded in the value: every snapshot and every MetricSeriesSet echoes a units map taken from the catalog.

func (Measures) DeepCopy

func (in Measures) DeepCopy() Measures

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Measures.

func (Measures) DeepCopyInto

func (in Measures) DeepCopyInto(out *Measures)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Metric

type Metric struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec is the recipe a person writes.
	// +required
	Spec MetricSpec `json:"spec,omitempty"`

	// Status is what the server derives by compiling the recipe.
	// +optional
	Status MetricStatus `json:"status,omitempty"`
}

Metric is a stored recipe: a PRQL aggregate fragment plus presentation preferences. It is the only typed query surface; there is no ad-hoc typed query endpoint. Its name is the path element of the series subresource.

func (*Metric) ConvertToTable

func (m *Metric) ConvertToTable(_ context.Context, tableOptions runtime.Object) (*metav1.Table, error)

ConvertToTable renders the catalog for kubectl get metrics.

func (*Metric) DeepCopy

func (in *Metric) DeepCopy() *Metric

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metric.

func (*Metric) DeepCopyInto

func (in *Metric) DeepCopyInto(out *Metric)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Metric) DeepCopyObject

func (in *Metric) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Metric) GetGroupVersionResource

func (m *Metric) GetGroupVersionResource() schema.GroupVersionResource

func (*Metric) GetObjectMeta

func (m *Metric) GetObjectMeta() *metav1.ObjectMeta

func (*Metric) GetSingularName

func (m *Metric) GetSingularName() string

func (*Metric) GetStatus

func (m *Metric) GetStatus() resource.StatusSubResource

func (*Metric) IsStorageVersion

func (m *Metric) IsStorageVersion() bool

func (*Metric) NamespaceScoped

func (m *Metric) NamespaceScoped() bool

func (*Metric) New

func (m *Metric) New() runtime.Object

func (*Metric) NewList

func (m *Metric) NewList() runtime.Object

func (*Metric) Validate

func (m *Metric) Validate(_ context.Context) field.ErrorList

Validate rejects a recipe that admission must never store. The compile step runs in the deployment that owns the PRQL engine; this covers the name rules and the one required field, which every deployment shares.

type MetricList

type MetricList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Metric `json:"items"`
}

MetricList is the catalog: every recipe this project can query.

func (*MetricList) ConvertToTable

func (l *MetricList) ConvertToTable(_ context.Context, tableOptions runtime.Object) (*metav1.Table, error)

ConvertToTable renders the catalog for kubectl get metrics.

func (*MetricList) DeepCopy

func (in *MetricList) DeepCopy() *MetricList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricList.

func (*MetricList) DeepCopyInto

func (in *MetricList) DeepCopyInto(out *MetricList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MetricList) DeepCopyObject

func (in *MetricList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*MetricList) GetListMeta

func (l *MetricList) GetListMeta() *metav1.ListMeta

type MetricMeasure

type MetricMeasure struct {
	// Name is the measure name, the key it takes in a Measures map.
	// +required
	Name string `json:"name"`

	// Type is the value domain of the measure.
	// +optional
	Type MeasureType `json:"type,omitempty"`

	// Unit is the display unit ("" for a plain count, By for bytes, ms for a
	// duration). It is echoed in the units map of every snapshot and series
	// response.
	// +optional
	Unit string `json:"unit,omitempty"`

	// Reaggregate reports whether the measure can be summed across buckets. It
	// is false for a percentile, which must be recomputed from the histogram.
	// +optional
	Reaggregate bool `json:"reaggregate,omitempty"`
}

MetricMeasure is one output column of a compiled recipe.

func (*MetricMeasure) DeepCopy

func (in *MetricMeasure) DeepCopy() *MetricMeasure

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricMeasure.

func (*MetricMeasure) DeepCopyInto

func (in *MetricMeasure) DeepCopyInto(out *MetricMeasure)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetricPoint

type MetricPoint struct {
	// Timestamp is the bucket start.
	Timestamp metav1.Time `json:"timestamp"`

	// Values are the recipe's measures for the bucket.
	Values Measures `json:"values"`
}

MetricPoint is one bucket of one series.

func (*MetricPoint) DeepCopy

func (in *MetricPoint) DeepCopy() *MetricPoint

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricPoint.

func (*MetricPoint) DeepCopyInto

func (in *MetricPoint) DeepCopyInto(out *MetricPoint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetricSeries

type MetricSeries struct {
	// Labels is the group key and value, for example {route: api}.
	Labels map[string]string `json:"labels,omitempty"`

	// Points are the buckets, ordered by timestamp.
	Points []MetricPoint `json:"points"`
}

MetricSeries is one labeled line. A read with no groupBy returns exactly one series with empty labels.

func (*MetricSeries) DeepCopy

func (in *MetricSeries) DeepCopy() *MetricSeries

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricSeries.

func (*MetricSeries) DeepCopyInto

func (in *MetricSeries) DeepCopyInto(out *MetricSeries)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetricSeriesSet

type MetricSeriesSet struct {
	metav1.TypeMeta `json:",inline"`

	// Metric echoes the queried recipe name.
	Metric string `json:"metric"`

	// ScopeKind and ScopeName echo the resolved scope. ScopeName is empty for
	// a whole-project read.
	ScopeKind string `json:"scopeKind,omitempty"`
	ScopeName string `json:"scopeName,omitempty"`

	// Since and Until are the resolved half-open [since, until) window bounds.
	Since metav1.Time `json:"since"`
	Until metav1.Time `json:"until"`

	// Step is the applied bucket width, rounded up to the source granularity.
	Step metav1.Duration `json:"step"`

	// DataUpTo is the end of the last complete bucket, so a client can tell a
	// partial trailing bucket from a drop in traffic.
	DataUpTo metav1.Time `json:"dataUpTo"`

	// Truncated is set when more groups matched than top returned.
	Truncated bool `json:"truncated"`

	// TotalCount is how many groups had data in the window.
	TotalCount int `json:"totalCount"`

	// Units maps a measure name to its display unit, echoed from the catalog.
	Units map[string]string `json:"units,omitempty"`

	// Series is the labeled lines.
	Series []MetricSeries `json:"series"`
}

MetricSeriesSet is the result of metrics/<name>/series: one labeled series per group value, each with one point per time bucket. It carries no ObjectMeta, because it is a query result rather than a stored object.

func (*MetricSeriesSet) DeepCopy

func (in *MetricSeriesSet) DeepCopy() *MetricSeriesSet

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricSeriesSet.

func (*MetricSeriesSet) DeepCopyInto

func (in *MetricSeriesSet) DeepCopyInto(out *MetricSeriesSet)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MetricSeriesSet) DeepCopyObject

func (in *MetricSeriesSet) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type MetricSource

type MetricSource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec is empty.
	// +optional
	Spec MetricSourceSpec `json:"spec,omitempty"`

	// Status is the derived description of the source.
	// +optional
	Status MetricSourceStatus `json:"status,omitempty"`
}

MetricSource is one entry of the per-project schema registry. It is derived on read and never stored, so a recipe author can see what a source keeps and what it can be grouped by.

func (*MetricSource) ConvertToTable

func (s *MetricSource) ConvertToTable(_ context.Context, tableOptions runtime.Object) (*metav1.Table, error)

ConvertToTable renders the registry for kubectl get metricsources.

func (*MetricSource) DeepCopy

func (in *MetricSource) DeepCopy() *MetricSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricSource.

func (*MetricSource) DeepCopyInto

func (in *MetricSource) DeepCopyInto(out *MetricSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MetricSource) DeepCopyObject

func (in *MetricSource) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*MetricSource) GetGroupVersionResource

func (s *MetricSource) GetGroupVersionResource() schema.GroupVersionResource

func (*MetricSource) GetObjectMeta

func (s *MetricSource) GetObjectMeta() *metav1.ObjectMeta

func (*MetricSource) GetSingularName

func (s *MetricSource) GetSingularName() string

func (*MetricSource) IsStorageVersion

func (s *MetricSource) IsStorageVersion() bool

func (*MetricSource) NamespaceScoped

func (s *MetricSource) NamespaceScoped() bool

func (*MetricSource) New

func (s *MetricSource) New() runtime.Object

func (*MetricSource) NewList

func (s *MetricSource) NewList() runtime.Object

type MetricSourceField

type MetricSourceField struct {
	// Name is the field name as a recipe writes it.
	// +required
	Name string `json:"name"`

	// Type is the field type: string, integer, float, timestamp, or histogram.
	// +optional
	Type string `json:"type,omitempty"`

	// Role says whether the field is the time bucket, a groupable key, or a
	// measure.
	// +optional
	Role FieldRole `json:"role,omitempty"`

	// Discovered is true for a field found by sampling log attributes, which
	// can therefore disappear, and false for a table column or a static field,
	// which cannot.
	// +optional
	Discovered bool `json:"discovered,omitempty"`

	// Reaggregate reports whether the measure can be summed across buckets. It
	// is false for a percentile.
	// +optional
	Reaggregate bool `json:"reaggregate,omitempty"`
}

MetricSourceField is one column or discovered attribute of a source.

func (*MetricSourceField) DeepCopy

func (in *MetricSourceField) DeepCopy() *MetricSourceField

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricSourceField.

func (*MetricSourceField) DeepCopyInto

func (in *MetricSourceField) DeepCopyInto(out *MetricSourceField)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetricSourceList

type MetricSourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []MetricSource `json:"items"`
}

MetricSourceList is every source this project can read.

func (*MetricSourceList) ConvertToTable

func (l *MetricSourceList) ConvertToTable(_ context.Context, tableOptions runtime.Object) (*metav1.Table, error)

ConvertToTable renders the registry for kubectl get metricsources.

func (*MetricSourceList) DeepCopy

func (in *MetricSourceList) DeepCopy() *MetricSourceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricSourceList.

func (*MetricSourceList) DeepCopyInto

func (in *MetricSourceList) DeepCopyInto(out *MetricSourceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MetricSourceList) DeepCopyObject

func (in *MetricSourceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*MetricSourceList) GetListMeta

func (l *MetricSourceList) GetListMeta() *metav1.ListMeta

type MetricSourceSpec

type MetricSourceSpec struct{}

MetricSourceSpec is empty. Granularity, retention, and the field list are facts about the table, not settings, so they live in status.

func (*MetricSourceSpec) DeepCopy

func (in *MetricSourceSpec) DeepCopy() *MetricSourceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricSourceSpec.

func (*MetricSourceSpec) DeepCopyInto

func (in *MetricSourceSpec) DeepCopyInto(out *MetricSourceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetricSourceStatus

type MetricSourceStatus struct {
	// Granularity is the bucket width of the source: row for raw logs, 1m or
	// 1h for a rollup. It is the minimum step a series read can ask for.
	// +optional
	Granularity string `json:"granularity,omitempty"`

	// Retention is how long the source keeps data.
	// +optional
	Retention string `json:"retention,omitempty"`

	// Scopes are the owner kinds a scopeKind parameter accepts for this
	// source.
	// +optional
	Scopes []string `json:"scopes,omitempty"`

	// Fields are the columns and discovered attributes of the source.
	// +optional
	Fields []MetricSourceField `json:"fields,omitempty"`

	// Metrics are the recipes that read this source.
	// +optional
	Metrics []string `json:"metrics,omitempty"`

	// DiscoveredAt is when the attribute sample last ran.
	// +optional
	DiscoveredAt *metav1.Time `json:"discoveredAt,omitempty"`
}

MetricSourceStatus is the derived description of one source.

func (*MetricSourceStatus) DeepCopy

func (in *MetricSourceStatus) DeepCopy() *MetricSourceStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricSourceStatus.

func (*MetricSourceStatus) DeepCopyInto

func (in *MetricSourceStatus) DeepCopyInto(out *MetricSourceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetricSpec

type MetricSpec struct {
	// PRQL is the aggregate-only recipe fragment: [filter|derive]* aggregate
	// {...}. It states no from, no group, and no time_bucket. The source comes
	// from spec.source, the grouping from the groupBy parameter, the bucket
	// from the step parameter, and the scope from the scope parameters.
	// +required
	PRQL string `json:"prql"`

	// Source is the table the fragment reads. When it is empty the server
	// resolves it on write from the fields the fragment uses.
	// +optional
	Source string `json:"source,omitempty"`

	// Type tells a client how to render the recipe.
	// +optional
	Type MetricType `json:"type,omitempty"`

	// Unit is the display unit of the recipe as a whole, when every measure
	// shares one. Per-measure units are in status.measures[].unit.
	// +optional
	Unit string `json:"unit,omitempty"`

	// Scopes are the owner kinds this recipe applies to. An empty list means
	// every kind the source supports.
	// +optional
	Scopes []string `json:"scopes,omitempty"`

	// DefaultDimension is the key a client groups by when it has no better
	// choice. It falls back to status.keys[0].
	// +optional
	DefaultDimension string `json:"defaultDimension,omitempty"`

	// DefaultColumns are the measures a client shows first. The first entry is
	// also the default orderBy.
	// +optional
	DefaultColumns []string `json:"defaultColumns,omitempty"`

	// Description is a one-line human summary.
	// +optional
	Description string `json:"description,omitempty"`
}

MetricSpec is what a person writes. Everything derived from the fragment lives in status.

func (*MetricSpec) DeepCopy

func (in *MetricSpec) DeepCopy() *MetricSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricSpec.

func (*MetricSpec) DeepCopyInto

func (in *MetricSpec) DeepCopyInto(out *MetricSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetricStatus

type MetricStatus struct {
	// Source is the resolved source table.
	// +optional
	Source string `json:"source,omitempty"`

	// Measures are the output columns of the compiled fragment.
	// +optional
	Measures []MetricMeasure `json:"measures,omitempty"`

	// Keys are the groupable dimensions: every role: key field of the resolved
	// source. A groupBy that is not in this list is a 400.
	// +optional
	Keys []string `json:"keys,omitempty"`

	// Conditions: Compiled.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty,omitzero"`
}

MetricStatus is what the server derives by compiling the fragment against the schema registry on create and update. A client cannot supply these fields; admission rejects a write that tries.

func (*MetricStatus) CopyTo

func (*MetricStatus) DeepCopy

func (in *MetricStatus) DeepCopy() *MetricStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricStatus.

func (*MetricStatus) DeepCopyInto

func (in *MetricStatus) DeepCopyInto(out *MetricStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MetricStatus) SubResourceName

func (s *MetricStatus) SubResourceName() string

type MetricType

type MetricType string

MetricType tells a client how to render a recipe.

const (
	// MetricTypeCounter is a monotonic count or sum aggregate.
	MetricTypeCounter MetricType = "counter"
	// MetricTypeGauge is a point-in-time value.
	MetricTypeGauge MetricType = "gauge"
	// MetricTypeHistogram is a distribution queried as quantile columns.
	MetricTypeHistogram MetricType = "histogram"
)

type MetricsMap

type MetricsMap map[string]Measures

MetricsMap is keyed by Metric name. Each value is that recipe's measures, so a snapshot entry and a series point carry the same measure names by construction.

func (MetricsMap) DeepCopy

func (in MetricsMap) DeepCopy() MetricsMap

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsMap.

func (MetricsMap) DeepCopyInto

func (in MetricsMap) DeepCopyInto(out *MetricsMap)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ProxyMetrics

type ProxyMetrics struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	SnapshotMeta      `json:",inline"`

	// Metrics is the Proxy totals, one entry per evaluated recipe.
	Metrics MetricsMap `json:"metrics,omitempty"`
	// Units maps a measure name to its display unit.
	Units map[string]string `json:"units,omitempty"`
	// Replicas comes from the owner status.
	Replicas ReplicaGauges `json:"replicas,omitempty,omitzero"`
	// PerReplica is the same recipes cut by replica. Empty when the metrics
	// carry no replica.
	PerReplica []ReplicaMetrics `json:"perReplica,omitempty"`
}

ProxyMetrics is the snapshot returned by proxies/<name>/metrics. It has no nested table, so it takes no include token.

func (*ProxyMetrics) ConvertToTable

func (s *ProxyMetrics) ConvertToTable(_ context.Context, tableOptions runtime.Object) (*metav1.Table, error)

ConvertToTable renders the snapshot for kubectl get and apoxy get.

func (*ProxyMetrics) DeepCopy

func (in *ProxyMetrics) DeepCopy() *ProxyMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyMetrics.

func (*ProxyMetrics) DeepCopyInto

func (in *ProxyMetrics) DeepCopyInto(out *ProxyMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ProxyMetrics) DeepCopyObject

func (in *ProxyMetrics) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ReplicaGauges

type ReplicaGauges struct {
	// Desired is the requested replica count.
	Desired int32 `json:"desired"`
	// Ready is how many replicas report ready.
	Ready int32 `json:"ready"`
	// Available is how many replicas serve traffic.
	Available int32 `json:"available"`
	// Connected is how many replicas are currently connected, counted from the
	// owner status. Desired, Ready, and Available stay zero until the Proxy
	// status carries them.
	Connected int32 `json:"connected"`
}

ReplicaGauges is the one non-telemetry field of a snapshot: it comes from the owner status, not from the read model.

func (*ReplicaGauges) DeepCopy

func (in *ReplicaGauges) DeepCopy() *ReplicaGauges

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaGauges.

func (*ReplicaGauges) DeepCopyInto

func (in *ReplicaGauges) DeepCopyInto(out *ReplicaGauges)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReplicaMetrics added in v0.23.1

type ReplicaMetrics struct {
	// Name is the replica name.
	Name string `json:"name,omitempty"`
	// Metrics is every evaluated recipe for the replica.
	Metrics MetricsMap `json:"metrics,omitempty"`
}

ReplicaMetrics is one replica's share of a Proxy.

func (*ReplicaMetrics) DeepCopy added in v0.23.1

func (in *ReplicaMetrics) DeepCopy() *ReplicaMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaMetrics.

func (*ReplicaMetrics) DeepCopyInto added in v0.23.1

func (in *ReplicaMetrics) DeepCopyInto(out *ReplicaMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RevisionMetrics

type RevisionMetrics struct {
	// Name is the revision name.
	Name string `json:"name,omitempty"`
	// Metrics is every evaluated recipe for the revision.
	Metrics MetricsMap `json:"metrics,omitempty"`
}

RevisionMetrics is one revision's share of a compute Service.

func (*RevisionMetrics) DeepCopy

func (in *RevisionMetrics) DeepCopy() *RevisionMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RevisionMetrics.

func (*RevisionMetrics) DeepCopyInto

func (in *RevisionMetrics) DeepCopyInto(out *RevisionMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RouteMetrics

type RouteMetrics struct {
	// Kind is the route kind, for example HTTPRoute.
	Kind string `json:"kind,omitempty"`
	// Name is the route name.
	Name string `json:"name,omitempty"`
	// Rule is the rule index inside the route, when the telemetry carries one.
	Rule *int32 `json:"rule,omitempty"`
	// Metrics is every evaluated recipe for the route.
	Metrics MetricsMap `json:"metrics,omitempty"`
}

RouteMetrics is one route's share of a listener.

func (*RouteMetrics) DeepCopy

func (in *RouteMetrics) DeepCopy() *RouteMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteMetrics.

func (*RouteMetrics) DeepCopyInto

func (in *RouteMetrics) DeepCopyInto(out *RouteMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuleMetrics

type RuleMetrics struct {
	// Rule is the rule index inside the route.
	Rule int32 `json:"rule"`
	// Metrics is every evaluated recipe for the rule.
	Metrics MetricsMap `json:"metrics,omitempty"`
}

RuleMetrics is one rule's share of an HTTPRoute.

func (*RuleMetrics) DeepCopy

func (in *RuleMetrics) DeepCopy() *RuleMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleMetrics.

func (*RuleMetrics) DeepCopyInto

func (in *RuleMetrics) DeepCopyInto(out *RuleMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceMetrics

type ServiceMetrics struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	SnapshotMeta      `json:",inline"`

	// Metrics is the Service totals, one entry per evaluated recipe.
	Metrics MetricsMap `json:"metrics,omitempty"`
	// Units maps a measure name to its display unit.
	Units map[string]string `json:"units,omitempty"`
	// Revisions is present only with include=revisions.
	Revisions []RevisionMetrics `json:"revisions,omitempty"`
	// Truncated is set when top cut the revision list.
	Truncated bool `json:"truncated,omitempty"`
	// TotalCount is how many revisions had traffic in the window.
	TotalCount int `json:"totalCount,omitempty"`
}

ServiceMetrics is the snapshot returned by services/<name>/metrics. It cuts its own revision list, so truncated and totalCount sit on it.

func (*ServiceMetrics) ConvertToTable

func (s *ServiceMetrics) ConvertToTable(_ context.Context, tableOptions runtime.Object) (*metav1.Table, error)

ConvertToTable renders the snapshot for kubectl get and apoxy get.

func (*ServiceMetrics) DeepCopy

func (in *ServiceMetrics) DeepCopy() *ServiceMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMetrics.

func (*ServiceMetrics) DeepCopyInto

func (in *ServiceMetrics) DeepCopyInto(out *ServiceMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceMetrics) DeepCopyObject

func (in *ServiceMetrics) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SnapshotMeta

type SnapshotMeta struct {
	// Timestamp is when the snapshot was computed.
	Timestamp metav1.Time `json:"timestamp"`

	// Window is until minus since.
	Window metav1.Duration `json:"window"`

	// Since and Until are the resolved half-open [since, until) window bounds.
	Since metav1.Time `json:"since"`
	Until metav1.Time `json:"until"`

	// DataUpTo is the end of the last complete bucket.
	DataUpTo metav1.Time `json:"dataUpTo"`
}

SnapshotMeta is the window every snapshot kind echoes. It is inlined rather than nested so the wire shape stays flat, as the design states.

func (*SnapshotMeta) DeepCopy

func (in *SnapshotMeta) DeepCopy() *SnapshotMeta

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnapshotMeta.

func (*SnapshotMeta) DeepCopyInto

func (in *SnapshotMeta) DeepCopyInto(out *SnapshotMeta)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TunnelMetrics

type TunnelMetrics struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	SnapshotMeta      `json:",inline"`

	// Metrics is the tunnel totals, one entry per evaluated recipe.
	Metrics MetricsMap `json:"metrics,omitempty"`
	// Units maps a measure name to its display unit.
	Units map[string]string `json:"units,omitempty"`
}

TunnelMetrics is the snapshot returned by tunnels/<name>/metrics. It has no nested table, so it takes no include token.

A Tunnel is one agent connection to a relay, so the snapshot covers that connection alone: an agent that reconnects gets a new Tunnel, and its history starts over with it.

func (*TunnelMetrics) ConvertToTable

func (s *TunnelMetrics) ConvertToTable(_ context.Context, tableOptions runtime.Object) (*metav1.Table, error)

ConvertToTable renders the snapshot for kubectl get and apoxy get. A tunnel carries no HTTP recipes, so the shared columns print an em dash for them.

func (*TunnelMetrics) DeepCopy

func (in *TunnelMetrics) DeepCopy() *TunnelMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TunnelMetrics.

func (*TunnelMetrics) DeepCopyInto

func (in *TunnelMetrics) DeepCopyInto(out *TunnelMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TunnelMetrics) DeepCopyObject

func (in *TunnelMetrics) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type VPCNetworkMetrics

type VPCNetworkMetrics struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	SnapshotMeta      `json:",inline"`

	// Metrics is the network totals, one entry per evaluated recipe.
	Metrics MetricsMap `json:"metrics,omitempty"`
	// Units maps a measure name to its display unit.
	Units map[string]string `json:"units,omitempty"`
	// Services is present only with include=services.
	Services []VPCServiceMetrics `json:"services,omitempty"`
	// Tunnels is present only with include=tunnels. A tunnel is one agent
	// connection, so a reconnect is a new tunnel with a history of its own.
	Tunnels []VPCTunnelMetrics `json:"tunnels,omitempty"`
	// Truncated is set when top cut a leaf list.
	Truncated bool `json:"truncated,omitempty"`
	// TotalCount is how many leaf rows had traffic in the window, counted
	// across every list the read asked for.
	TotalCount int `json:"totalCount,omitempty"`
}

VPCNetworkMetrics is the snapshot returned by vpcnetworks/<name>/metrics. It cuts its own leaf lists, so truncated and totalCount sit on it.

func (*VPCNetworkMetrics) ConvertToTable

func (s *VPCNetworkMetrics) ConvertToTable(_ context.Context, tableOptions runtime.Object) (*metav1.Table, error)

ConvertToTable renders the snapshot for kubectl get and apoxy get.

func (*VPCNetworkMetrics) DeepCopy

func (in *VPCNetworkMetrics) DeepCopy() *VPCNetworkMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCNetworkMetrics.

func (*VPCNetworkMetrics) DeepCopyInto

func (in *VPCNetworkMetrics) DeepCopyInto(out *VPCNetworkMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VPCNetworkMetrics) DeepCopyObject

func (in *VPCNetworkMetrics) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type VPCServiceMetrics

type VPCServiceMetrics struct {
	// Name is the VPCService name.
	Name string `json:"name,omitempty"`
	// Metrics is every evaluated recipe for the service.
	Metrics MetricsMap `json:"metrics,omitempty"`
}

VPCServiceMetrics is one VPC service's share of a VPCNetwork.

func (*VPCServiceMetrics) DeepCopy

func (in *VPCServiceMetrics) DeepCopy() *VPCServiceMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCServiceMetrics.

func (*VPCServiceMetrics) DeepCopyInto

func (in *VPCServiceMetrics) DeepCopyInto(out *VPCServiceMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VPCTunnelMetrics

type VPCTunnelMetrics struct {
	// Name is the Tunnel name, which is the connection the agent holds.
	Name string `json:"name,omitempty"`
	// Metrics is every evaluated recipe for the tunnel.
	Metrics MetricsMap `json:"metrics,omitempty"`
}

VPCTunnelMetrics is one tunnel's share of a VPCNetwork.

func (*VPCTunnelMetrics) DeepCopy

func (in *VPCTunnelMetrics) DeepCopy() *VPCTunnelMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCTunnelMetrics.

func (*VPCTunnelMetrics) DeepCopyInto

func (in *VPCTunnelMetrics) DeepCopyInto(out *VPCTunnelMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL