This repository contains Kubernetes manifests for the data collection orchestration stack, split into three namespace-scoped parts:
observability/: theObservabilityGatewaycustom resource that defines the gold, silver, and bronze ingestion backendsobservability-ingress/: Gateway API resources in front of those backendsobservability-system/: shared control-plane and metrics services, including Prometheus and a metrics proxy API
The manifests are split across three namespaces:
observability: hosts theObservabilityGatewaycustom resource and the resulting ingestion servicesobservability-gateway: hosts the external Gateway API resources used for OTLP/HTTP ingress and rate limitingobservability-system: hosts Prometheus and the metrics-proxy service used for internal metrics access
Contains observability-gateway.yaml, which defines an ObservabilityGateway custom resource named prio-ingestion-gateway in the observability namespace. It declares three traffic classes:
- gold
- silver
- bronze
Each class is expected to expose a corresponding backend Service in the observability namespace:
prio-ingestion-gateway-goldprio-ingestion-gateway-silverprio-ingestion-gateway-bronze
Contains the external routing layer in the observability-gateway namespace:
gateway.yaml: threeGatewayresources using thekgatewayGatewayClasshttproute.yaml: threeHTTPRouteresources, one per traffic classrate-limiting.yaml: threeTrafficPolicyresources for class-specific local rate limitingreference-grant.yaml: aReferenceGrantthat allows routes inobservability-gatewayto target Services inobservabilitykustomization.yaml: packages the ingress resources and applies common labels
Contains shared control-plane and metrics infrastructure in the observability-system namespace.
The prometheus/ directory contains:
configmap.yaml: a Prometheus configuration that uses Kubernetes service discovery to scrape pods annotated withprometheus.io/scrape=truedeployment.yaml: a single-replica Prometheus deployment and aLoadBalancerService exposed on port9090rbac.yaml: the service account, cluster role, and bindings required for Kubernetes discovery
The current scrape configuration is focused on gateway-related pod metrics and adds useful labels such as namespace, pod name, and gateway name.
The metrics-proxy/ directory contains a small FastAPI service that provides a stable API in front of Prometheus:
- exposes
POST /observations - executes curated PromQL queries from
src/queries.yaml - aggregates the returned range-vector data into averaged numeric values
- reads Prometheus from
PROM_URL, which is set tohttp://prometheus:9090in the in-cluster deployment
Relevant files:
service.yaml: the KubernetesDeploymentandServiceformetrics-proxysrc/main.py: FastAPI app and request handlingsrc/prom_client.py: Prometheus HTTP clientsrc/aggregation.py: result aggregation helperssrc/config.py: query configuration loadingsrc/queries.yaml: curated PromQL query definitionsDockerfile,requirements.txt,Makefile: image build and packaging assetsREADME.md: component-level usage and development notes
The observability-system/kustomization.yaml file deploys the Prometheus resources, the metrics-proxy deployment/service, and a generated ConfigMap named metrics-proxy-queries from metrics-proxy/src/queries.yaml.
At a high level, the repository defines this flow:
- External OTLP/HTTP traffic enters through one of the
Gatewayresources inobservability-gateway. - An
HTTPRouteforwards the request to the matchingprio-ingestion-gateway-<class>Service inobservability. - A
TrafficPolicyapplies the per-class rate limit. - Prometheus in
observability-systemscrapes annotated cluster workloads for metrics. - The metrics-proxy service exposes curated Prometheus-backed observations through a simplified HTTP API.
Create the required namespaces first:
kubectl create ns observability
kubectl create ns observability-gateway
kubectl create ns observability-systemIf you are also using Istio ambient mode in your cluster, apply any namespace labels separately. Those labels are not created by the manifests in this repository.
Deploy Prometheus, the metrics-proxy service, and the generated queries ConfigMap:
kubectl apply -k observability-systemThis step creates:
- Prometheus deployment, service, and RBAC
- metrics-proxy deployment and service
metrics-proxy-queriesConfigMap
Deploy the external Gateway API layer:
kubectl apply -k observability-ingressThis step creates:
- three
Gatewayresources - three
HTTPRouteresources - three
TrafficPolicyresources - one
ReferenceGrant
Deploy the telemetry ingestion backend definition:
kubectl apply -f observability/observability-gateway.yamlBefore applying the custom resource, make sure the ObservabilityGateway CRD and its controller are already installed in the cluster.
The repository currently defines one gateway listener per traffic class:
- gold on port
4318 - silver on port
4319 - bronze on port
4320
Each route forwards to the matching backend Service in the observability namespace on port 4317:
prio-ingestion-gateway-goldprio-ingestion-gateway-silverprio-ingestion-gateway-bronze
Prometheus is exposed as a LoadBalancer Service on port 9090 in the observability-system namespace.
The metrics-proxy Service is exposed internally as a ClusterIP Service on port 8000 and is intended to provide a smaller, curated API surface over Prometheus rather than exposing PromQL directly to callers.
- The ingress design uses one
Gatewayand oneHTTPRouteper traffic class. - The
ReferenceGrantis created in theobservabilitynamespace even though it is packaged underobservability-ingress/, because that is the namespace where the target Services live. - The top-level README describes the overall data collection orchestration deployment. For local development and API examples for the proxy, see
observability-system/metrics-proxy/README.md.