OpenTelemetry Configuration

Configure OpenTelemetry metrics, traces, and pprof profiling for Porch components

Overview

Porch supports OpenTelemetry observability through the autoexport package, which provides automatic configuration of metrics and traces exporters via environment variables. This enables seamless integration with various observability backends including OTLP collectors, Prometheus, and Jaeger.

All Porch components (porch-server, porch-controllers, function-runner, and wrapper-server) support OpenTelemetry configuration through standardized environment variables as defined by the OpenTelemetry specification.

Porch also exposes Go pprof endpoints for continuous profiling. Grafana Alloy can scrape those endpoints into Pyroscope when the pod annotations and PORCH_PPROF_PORT environment variable described in Pprof Configuration are set.

Default Kind deployments already export Prometheus metrics on port 9464 (OTEL_METRICS_EXPORTER=prometheus) and declare a container port named pprof. Trace export and the pprof HTTP server stay disabled until you set the corresponding environment variables.

For a local Prometheus, Grafana, Jaeger, Pyroscope, and Grafana Alloy stack, see Local Performance Monitoring Deployment. For load-test metrics emitted by the test process, see Performance Tests.

Traces Configuration

Quick Start with Jaeger

Porch includes a ready-to-use Jaeger manifest for a quick OTLP-compatible trace backend. Apply it to your cluster:

kubectl apply -f - <<'EOF'
kind: ServiceAccount
apiVersion: v1
metadata:
  name: jaeger
  namespace: porch-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: jaeger
  namespace: porch-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: jaeger
  template:
    metadata:
      labels:
        app: jaeger
    spec:
      serviceAccountName: jaeger
      containers:
        - name: jaeger
          image: jaegertracing/all-in-one:latest
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              memory: "1024Mi"
              cpu: "250m"
            limits:
              memory: "1024Mi"
---
apiVersion: v1
kind: Service
metadata:
  name: jaeger-otlp
  namespace: porch-system
spec:
  ports:
    - port: 4317
      protocol: TCP
      targetPort: 4317
  selector:
    app: jaeger
---
apiVersion: v1
kind: Service
metadata:
  name: jaeger-http
  namespace: porch-system
spec:
  ports:
    - port: 16686
      protocol: TCP
      targetPort: 16686
  selector:
    app: jaeger
EOF

Then enable trace export on Porch Server, Function Runner, and Porch Controllers:

kubectl set env deployment/porch-server -n porch-system \
  OTEL_TRACES_EXPORTER=otlp \
  OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://jaeger-otlp:4317 \
  OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc

kubectl set env deployment/function-runner -n porch-system \
  OTEL_TRACES_EXPORTER=otlp \
  OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://jaeger-otlp:4317 \
  OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc

kubectl set env deployment/porch-controllers -n porch-system \
  OTEL_TRACES_EXPORTER=otlp \
  OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://jaeger-otlp:4317 \
  OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc

Access the Jaeger UI:

kubectl port-forward -n porch-system service/jaeger-http 16686

Open http://localhost:16686 and you should see porch-server, porch-function-runner, and porch-controllers in the service dropdown.

To deploy Jaeger as part of the local monitoring stack (namespace porch-monitoring) instead of applying the manifest above, see Local Performance Monitoring Deployment.

OTLP Trace Export

Export traces to an OpenTelemetry Protocol (OTLP) collector using either HTTP or gRPC protocols.

HTTP Protocol

env:
  - name: OTEL_TRACES_EXPORTER
    value: "otlp"
  - name: OTEL_EXPORTER_OTLP_ENDPOINT
    value: "http://otel-collector:4318"
  - name: OTEL_EXPORTER_OTLP_PROTOCOL
    value: "http/protobuf"

gRPC Protocol

env:
  - name: OTEL_TRACES_EXPORTER
    value: "otlp"
  - name: OTEL_EXPORTER_OTLP_ENDPOINT
    value: "http://otel-collector:4317"
  - name: OTEL_EXPORTER_OTLP_PROTOCOL
    value: "grpc"

Disable Traces

To disable trace export entirely:

env:
  - name: OTEL_TRACES_EXPORTER
    value: "none"

Trace Environment Variables

All environment variables apply to all Porch components: porch-server, porch-controllers, function-runner, and wrapper-server.

VariableDescriptionDefaultExamples
OTEL_TRACES_EXPORTERTrace exporter typeotlpotlp, console, none
OTEL_EXPORTER_OTLP_ENDPOINTOTLP collector endpoint (applies to all signals)-http://localhost:4318, https://otel-collector.example.com
OTEL_EXPORTER_OTLP_PROTOCOLProtocol for OTLP export (applies to all signals)http/protobufhttp/protobuf, grpc
OTEL_EXPORTER_OTLP_TRACES_ENDPOINTTraces-specific endpoint (overrides general endpoint)-http://localhost:4318/v1/traces
OTEL_EXPORTER_OTLP_TRACES_PROTOCOLTraces-specific protocol (overrides general protocol)-http/protobuf, grpc

Pprof Configuration

Porch components start a pprof HTTP server when PORCH_PPROF_PORT is set. Grafana Alloy uses profiles.grafana.com/* pod annotations to discover those endpoints and ship profiles to Pyroscope.

Pprof applies to porch-server, function-runner, and porch-controllers. wrapper-server does not expose a pprof server.

Environment Variable

VariableDescriptionDefault
PORCH_PPROF_PORTTCP port for the pprof HTTP server. If unset, the server does not start.unset (disabled)

Set it to match the named container port (typically 8080):

env:
  - name: PORCH_PPROF_PORT
    value: "8080"

Container Port

The container must expose a port named pprof so Alloy can resolve profiles.grafana.com/*/port_name: pprof. Default Kind manifests already declare this port in deployments/porch/3-porch-server.yaml, deployments/porch/2-function-runner.yaml, and deployments/porch/9-controllers.yaml:

ports:
  - containerPort: 9464
    name: metrics
    protocol: TCP
  - containerPort: 8080
    name: pprof
    protocol: TCP

Pod Annotations for Pyroscope

Add these annotations on the pod template so Grafana Alloy scrapes the pprof port:

metadata:
  annotations:
    profiles.grafana.com/service_name: "porch-server"   # or porch-function-runner / porch-controllers
    profiles.grafana.com/cpu.scrape: "true"
    profiles.grafana.com/cpu.port_name: "pprof"
    profiles.grafana.com/memory.scrape: "true"
    profiles.grafana.com/memory.port_name: "pprof"
    profiles.grafana.com/goroutine.scrape: "true"
    profiles.grafana.com/goroutine.port_name: "pprof"
    profiles.grafana.com/block.scrape: "true"
    profiles.grafana.com/block.port_name: "pprof"
    profiles.grafana.com/mutex.scrape: "true"
    profiles.grafana.com/mutex.port_name: "pprof"
AnnotationPurpose
profiles.grafana.com/service_nameService name in Pyroscope (porch-server, porch-function-runner, or porch-controllers)
profiles.grafana.com/cpu.scrapeScrape CPU profiles (/debug/pprof/profile)
profiles.grafana.com/memory.scrapeScrape heap profiles (/debug/pprof/heap)
profiles.grafana.com/goroutine.scrapeScrape goroutine profiles (/debug/pprof/goroutine)
profiles.grafana.com/block.scrapeScrape block profiles (/debug/pprof/block)
profiles.grafana.com/mutex.scrapeScrape mutex profiles (/debug/pprof/mutex)
profiles.grafana.com/*/port_nameNamed container port to scrape (pprof)

Profiles Available from the Pprof Server

EndpointProfileScraped by Alloy
/debug/pprof/profileCPUyes (cpu)
/debug/pprof/heapHeap memoryyes (memory)
/debug/pprof/goroutineGoroutine stacksyes (goroutine)
/debug/pprof/blockBlocking (off-CPU)yes (block)
/debug/pprof/mutexMutex contentionyes (mutex)
/debug/pprof/allocsMemory allocationsno (available via HTTP)
/debug/pprof/threadcreateThread creationno (available via HTTP)
/debug/pprof/traceExecution traceno (available via HTTP)
/debug/pprof/cmdlineProcess command lineno (available via HTTP)
/debug/pprof/symbolSymbol lookupno (available via HTTP)
/debug/pprof/Index of all profilesno (available via HTTP)

Alloy writes the five scraped profile types into Pyroscope. View flame graphs in the Pyroscope UI (http://localhost:4040 when using the local stack) or the Pyroscope – Porch profiling Grafana dashboard. See Local Performance Monitoring Deployment for URLs and dashboards.

Complete Pprof Example

apiVersion: apps/v1
kind: Deployment
metadata:
  name: porch-server
  namespace: porch-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: porch-server
  template:
    metadata:
      labels:
        app: porch-server
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9464"
        prometheus.io/path: "/metrics"
        profiles.grafana.com/service_name: "porch-server"
        profiles.grafana.com/cpu.scrape: "true"
        profiles.grafana.com/cpu.port_name: "pprof"
        profiles.grafana.com/memory.scrape: "true"
        profiles.grafana.com/memory.port_name: "pprof"
        profiles.grafana.com/goroutine.scrape: "true"
        profiles.grafana.com/goroutine.port_name: "pprof"
        profiles.grafana.com/block.scrape: "true"
        profiles.grafana.com/block.port_name: "pprof"
        profiles.grafana.com/mutex.scrape: "true"
        profiles.grafana.com/mutex.port_name: "pprof"
    spec:
      containers:
      - name: porch-server
        image: porch-server:latest
        env:
        - name: OTEL_METRICS_EXPORTER
          value: "prometheus"
        - name: OTEL_EXPORTER_PROMETHEUS_HOST
          value: "0.0.0.0"
        - name: OTEL_EXPORTER_PROMETHEUS_PORT
          value: "9464"
        - name: PORCH_PPROF_PORT
          value: "8080"
        ports:
        - name: metrics
          containerPort: 9464
          protocol: TCP
        - name: pprof
          containerPort: 8080
          protocol: TCP

Repeat the same PORCH_PPROF_PORT, named pprof port, and profiles.grafana.com/* annotations on function-runner (service name porch-function-runner) and porch-controllers (service name porch-controllers).

Metrics Configuration

OTLP Metrics Export

Export metrics to an OTLP collector using HTTP or gRPC protocols.

HTTP Protocol

env:
  - name: OTEL_METRICS_EXPORTER
    value: "otlp"
  - name: OTEL_EXPORTER_OTLP_ENDPOINT
    value: "http://otel-collector:4318"
  - name: OTEL_EXPORTER_OTLP_PROTOCOL
    value: "http/protobuf"

gRPC Protocol

env:
  - name: OTEL_METRICS_EXPORTER
    value: "otlp"
  - name: OTEL_EXPORTER_OTLP_ENDPOINT
    value: "http://otel-collector:4317"
  - name: OTEL_EXPORTER_OTLP_PROTOCOL
    value: "grpc"

Prometheus Metrics Export

Porch supports native Prometheus metrics export through an HTTP endpoint. This is the recommended approach for Kubernetes environments with Prometheus-based monitoring. Default Kind manifests already set these variables on porch-server, function-runner, and porch-controllers.

Basic Prometheus Configuration

env:
  - name: OTEL_METRICS_EXPORTER
    value: "prometheus"
  - name: OTEL_EXPORTER_PROMETHEUS_HOST
    value: "0.0.0.0"
  - name: OTEL_EXPORTER_PROMETHEUS_PORT
    value: "9464"

The metrics endpoint will be available at http://<pod-ip>:9464/metrics.

Metrics Environment Variables

All environment variables apply to all Porch components: porch-server, porch-controllers, function-runner, and wrapper-server.

VariableDescriptionDefaultExamples
OTEL_METRICS_EXPORTERMetrics exporter typeotlpotlp, prometheus, console, none
OTEL_EXPORTER_OTLP_ENDPOINTOTLP collector endpoint (applies to all signals)-http://localhost:4318
OTEL_EXPORTER_OTLP_PROTOCOLProtocol for OTLP export (applies to all signals)http/protobufhttp/protobuf, grpc
OTEL_EXPORTER_OTLP_METRICS_ENDPOINTMetrics-specific endpoint (overrides general endpoint)-http://localhost:4318/v1/metrics
OTEL_EXPORTER_OTLP_METRICS_PROTOCOLMetrics-specific protocol (overrides general protocol)-http/protobuf, grpc
OTEL_EXPORTER_PROMETHEUS_HOSTPrometheus endpoint hostlocalhost0.0.0.0, 127.0.0.1
OTEL_EXPORTER_PROMETHEUS_PORTPrometheus endpoint port94649090, 8080

Prometheus Auto-Discovery

Pod Annotations (Prometheus Kubernetes SD)

For Prometheus using Kubernetes service discovery with pod annotations:

apiVersion: v1
kind: Pod
metadata:
  name: porch-server
  namespace: porch-system
  annotations:
    prometheus.io/scrape: "true"
    prometheus.io/port: "9464"
    prometheus.io/path: "/metrics"
spec:
  containers:
  - name: porch-server
    image: porch-server:latest
    env:
    - name: OTEL_METRICS_EXPORTER
      value: "prometheus"
    - name: OTEL_EXPORTER_PROMETHEUS_HOST
      value: "0.0.0.0"
    - name: OTEL_EXPORTER_PROMETHEUS_PORT
      value: "9464"
    ports:
    - name: metrics
      containerPort: 9464
      protocol: TCP

The local monitoring stack scrapes Porch Services on port 9464 directly rather than relying on these annotations. See What Prometheus Scrapes.

Complete Deployment Examples

The examples below combine Prometheus metrics, optional OTLP traces, Prometheus scrape annotations, and pprof/Pyroscope annotations. Adjust exporters to match your backend.

Porch Server with Prometheus, OTLP traces, and pprof

apiVersion: apps/v1
kind: Deployment
metadata:
  name: porch-server
  namespace: porch-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: porch-server
  template:
    metadata:
      labels:
        app: porch-server
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9464"
        prometheus.io/path: "/metrics"
        profiles.grafana.com/service_name: "porch-server"
        profiles.grafana.com/cpu.scrape: "true"
        profiles.grafana.com/cpu.port_name: "pprof"
        profiles.grafana.com/memory.scrape: "true"
        profiles.grafana.com/memory.port_name: "pprof"
        profiles.grafana.com/goroutine.scrape: "true"
        profiles.grafana.com/goroutine.port_name: "pprof"
        profiles.grafana.com/block.scrape: "true"
        profiles.grafana.com/block.port_name: "pprof"
        profiles.grafana.com/mutex.scrape: "true"
        profiles.grafana.com/mutex.port_name: "pprof"
    spec:
      containers:
      - name: porch-server
        image: porch-server:latest
        env:
        - name: OTEL_SERVICE_NAME
          value: "porch-server"
        - name: OTEL_METRICS_EXPORTER
          value: "prometheus"
        - name: OTEL_EXPORTER_PROMETHEUS_HOST
          value: "0.0.0.0"
        - name: OTEL_EXPORTER_PROMETHEUS_PORT
          value: "9464"
        - name: OTEL_TRACES_EXPORTER
          value: "otlp"
        - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
          value: "http://otel-collector.observability:4318"
        - name: OTEL_EXPORTER_OTLP_TRACES_PROTOCOL
          value: "http/protobuf"
        - name: PORCH_PPROF_PORT
          value: "8080"
        ports:
        - name: metrics
          containerPort: 9464
          protocol: TCP
        - name: pprof
          containerPort: 8080
          protocol: TCP

Porch Controllers with Prometheus Metrics, OTLP Traces, and pprof

apiVersion: apps/v1
kind: Deployment
metadata:
  name: porch-controllers
  namespace: porch-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: porch-controllers
  template:
    metadata:
      labels:
        app: porch-controllers
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9464"
        prometheus.io/path: "/metrics"
        profiles.grafana.com/service_name: "porch-controllers"
        profiles.grafana.com/cpu.scrape: "true"
        profiles.grafana.com/cpu.port_name: "pprof"
        profiles.grafana.com/memory.scrape: "true"
        profiles.grafana.com/memory.port_name: "pprof"
        profiles.grafana.com/goroutine.scrape: "true"
        profiles.grafana.com/goroutine.port_name: "pprof"
        profiles.grafana.com/block.scrape: "true"
        profiles.grafana.com/block.port_name: "pprof"
        profiles.grafana.com/mutex.scrape: "true"
        profiles.grafana.com/mutex.port_name: "pprof"
    spec:
      containers:
      - name: porch-controllers
        image: porch-controllers:latest
        env:
        # Prometheus for metrics
        - name: OTEL_METRICS_EXPORTER
          value: "prometheus"
        - name: OTEL_EXPORTER_PROMETHEUS_HOST
          value: "0.0.0.0"
        - name: OTEL_EXPORTER_PROMETHEUS_PORT
          value: "9464"
        # OTLP for traces
        - name: OTEL_TRACES_EXPORTER
          value: "otlp"
        - name: OTEL_EXPORTER_OTLP_ENDPOINT
          value: "http://otel-collector.observability:4318"
        - name: OTEL_EXPORTER_OTLP_PROTOCOL
          value: "http/protobuf"
        - name: PORCH_PPROF_PORT
          value: "8080"
        ports:
        - name: metrics
          containerPort: 9464
          protocol: TCP
        - name: pprof
          containerPort: 8080
          protocol: TCP

Function Runner with Mixed Configuration

apiVersion: apps/v1
kind: Deployment
metadata:
  name: function-runner
  namespace: porch-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: function-runner
  template:
    metadata:
      labels:
        app: function-runner
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9464"
        prometheus.io/path: "/metrics"
        profiles.grafana.com/service_name: "porch-function-runner"
        profiles.grafana.com/cpu.scrape: "true"
        profiles.grafana.com/cpu.port_name: "pprof"
        profiles.grafana.com/memory.scrape: "true"
        profiles.grafana.com/memory.port_name: "pprof"
        profiles.grafana.com/goroutine.scrape: "true"
        profiles.grafana.com/goroutine.port_name: "pprof"
        profiles.grafana.com/block.scrape: "true"
        profiles.grafana.com/block.port_name: "pprof"
        profiles.grafana.com/mutex.scrape: "true"
        profiles.grafana.com/mutex.port_name: "pprof"
    spec:
      containers:
      - name: function-runner
        image: function-runner:latest
        env:
        # Prometheus for metrics
        - name: OTEL_METRICS_EXPORTER
          value: "prometheus"
        - name: OTEL_EXPORTER_PROMETHEUS_HOST
          value: "0.0.0.0"
        - name: OTEL_EXPORTER_PROMETHEUS_PORT
          value: "9464"
        # OTLP for traces
        - name: OTEL_TRACES_EXPORTER
          value: "otlp"
        - name: OTEL_EXPORTER_OTLP_ENDPOINT
          value: "http://otel-collector.observability:4318"
        - name: OTEL_EXPORTER_OTLP_PROTOCOL
          value: "http/protobuf"
        - name: PORCH_PPROF_PORT
          value: "8080"
        ports:
        - name: metrics
          containerPort: 9464
        - name: pprof
          containerPort: 8080

Wrapper Server Configuration via Pod Templating

The wrapper-server component can be configured with OpenTelemetry settings through the pod templating mechanism used by the function runner. This is done by creating a ConfigMap with a pod template that includes the necessary environment variables.

wrapper-server does not expose pprof. Configure Prometheus metrics and optional OTLP traces only.

ConfigMap Pod Template with OpenTelemetry Configuration

apiVersion: v1
kind: ConfigMap
metadata:
  name: kpt-function-eval-pod-template
  namespace: porch-system
data:
  template: |
    apiVersion: v1
    kind: Pod
    metadata:
      annotations:
        cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
        prometheus.io/scrape: "true"
        prometheus.io/port: "9464"
        prometheus.io/path: "/metrics"
    spec:
      initContainers:
        - name: copy-wrapper-server
          image: ghcr.io/kptdev/porch-wrapper-server:latest
          command: 
            - cp
            - -a
            - /home/nonroot/wrapper-server/.
            - /wrapper-server-tools
          volumeMounts:
            - name: wrapper-server-tools
              mountPath: /wrapper-server-tools
      containers:
        - name: function
          image: image-replaced-by-kpt-func-image
          command: 
            - /wrapper-server-tools/wrapper-server
          env:
            - name: OTEL_METRICS_EXPORTER
              value: "prometheus"
            - name: OTEL_EXPORTER_PROMETHEUS_HOST
              value: "0.0.0.0"
            - name: OTEL_EXPORTER_PROMETHEUS_PORT
              value: "9464"
            - name: OTEL_TRACES_EXPORTER
              value: "otlp"
            - name: OTEL_EXPORTER_OTLP_ENDPOINT
              value: "http://otel-collector.observability:4318"
            - name: OTEL_EXPORTER_OTLP_PROTOCOL
              value: "http/protobuf"
          ports:
            - name: metrics
              containerPort: 9464
              protocol: TCP
          volumeMounts:
            - name: wrapper-server-tools
              mountPath: /wrapper-server-tools
      volumes:
        - name: wrapper-server-tools
          emptyDir: {}

The function runner must be configured to use this template by specifying the --function-pod-template argument:

command:
  - /server
  - --config=/config.yaml
  - --functions=/functions
  - --pod-namespace=porch-fn-system
  - --function-pod-template=kpt-function-eval-pod-template

Context Propagation

Porch automatically configures context propagation using the autoprop package, which supports multiple propagation formats:

  • W3C Trace Context (default)
  • W3C Baggage
  • B3 (Zipkin)
  • Jaeger
  • AWS X-Ray
  • OpenTracing

The propagator is automatically selected based on the OTEL_PROPAGATORS environment variable. If not set, W3C Trace Context is used by default.

env:
  - name: OTEL_PROPAGATORS
    value: "tracecontext,baggage,b3"

HTTP Instrumentation

All Porch components automatically instrument HTTP clients and servers using otelhttp, providing:

  • Automatic span creation for HTTP requests
  • Request/response metrics
  • Error tracking
  • Distributed tracing across service boundaries

Signal-Specific Endpoints

You can configure different endpoints for each signal type using signal-specific environment variables. These variables apply to all Porch components.

env:
  # Base endpoint (used as fallback for all signals)
  - name: OTEL_EXPORTER_OTLP_ENDPOINT
    value: "http://otel-collector:4318"
  # Signal-specific endpoints (override base endpoint)
  - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
    value: "http://jaeger-collector:4318/v1/traces"
  - name: OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
    value: "http://prometheus-gateway:4318/v1/metrics"

This allows routing different telemetry signals to specialized backends.

Available Metrics

Porch records the following metrics via OpenTelemetry. They are emitted by porch-server and porch-controllers (and, where applicable, function-runner). View them on the Porch API and Porch File-system Resources Grafana dashboards when using the local monitoring stack.

Load-test process metrics (porch_perf_*) are documented separately in Performance Tests.

API Call Duration

Metric NameTypeUnitDescription
porch_api_call_duration_secondsHistogramsecondsDuration of Porch API calls and related operations
AttributeDescription
resourceResource kind (see table below)
verbOperation name (see table below)
api_versionv1alpha1 or v1alpha2. Omitted for ExternalRepo operations, which are shared infrastructure

Histogram buckets start at 0.001 seconds and double for 16 boundaries (up to 32.768 seconds).

Request Counts

Metric NameTypeUnitDescription
porch_api_requests_by_userCounterTotal number of requests, broken down by resource, operation, and user
AttributeDescription
resourceResource kind (see table below)
opOperation name (same values as verb on the duration histogram)
userKubernetes user from the request context. v1alpha2 controller operations use packagerevision-controller
api_versionv1alpha1 or v1alpha2. Omitted for ExternalRepo operations

Resources and Operations

resourceComponentverb / op valuesapi_version
PackageRevisionporch-serverLIST, GET, CREATE, UPDATE, DELETEv1alpha1
PackageRevisionporch-controllersCREATE, UPDATE, DELETEv1alpha2
PackageRevisionResourcesporch-serverLIST, GET, UPDATEv1alpha1
PackageRevisionResourcesporch-controllersUPDATEv1alpha2
PackageRevisionApprovalporch-serverGET, UPDATEv1alpha1
ExternalRepoporch-server (git)FETCH, PUSHomitted

Package Size Metrics

Metric NameTypeUnitDescription
porch_package_size_bytesHistogramBytesFile size of a package’s resources expressed as a histogram
porch_package_size_bytes_totalGaugeBytesTotal file size of a package’s resources

Package size metrics are recorded with the following attributes from the relevant package:

AttributeDescription
namespaceKubernetes namespace of the package revision
repositoryName of the repository containing the package
packagePath and name of the package
workspace_nameWorkspaceName of the package revision - short, unique description of the changes

These metrics are recorded as part of every flow that updates package revision resources:

  • Create package revision
  • Delete package revision
  • Discover/sync package revisions from a registered repository
  • Delete package revisions on unregistering a repository
  • Direct update of PackageRevisionResources (e.g. rpkg push)

Histogram buckets start at 0, then 1024 bytes, doubling for 21 further boundaries.

Prometheus Metric Names

When using the Prometheus exporter, these are made available under the metric names:

API call duration

  • porch_api_call_duration_seconds_bucket
  • porch_api_call_duration_seconds_count
  • porch_api_call_duration_seconds_sum

Request counts

  • porch_api_requests_by_user_total

Package size

  • porch_package_size_bytes_bucket
  • porch_package_size_bytes_count
  • porch_package_size_bytes_sum
  • porch_package_size_bytes_total

Troubleshooting

Verify Metrics Endpoint

For Prometheus exporters, verify the metrics endpoint is accessible:

kubectl port-forward -n porch-system deployment/porch-server 9464:9464
curl http://localhost:9464/metrics

Verify Pprof Endpoint

The pprof server listens only when PORCH_PPROF_PORT is set:

kubectl port-forward -n porch-system deployment/porch-server 8080:8080
curl http://localhost:8080/debug/pprof/

Additional Resources

See Also


Last modified August 31, 2026: First iteration of perf docs (408da4b5)