Skip to main content

Telemetry

Integration with Prometheus

Collecting telemetry directly from isolated Nitro Enclaves requires a bridge to transform enclave‑pushed OTLP data into a format Prometheus can scrape. The OpenTelemetry Collector serves as that bridge: it receives metrics over OTLP, batches and processes them, and exposes a Prometheus‑compatible endpoint. Integrating the OTEL Collector with Prometheus lets you to build dashboards, set alerts, and drive autoscaling based on real‑time enclave performance.

Here is the guide to installing prometheus stack.

1
Update the Collector Configuration:
apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector-config
namespace: monitoring
data:
collector-config.yaml: |
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
exporters:
debug:
verbosity: detailed
prometheus: # pull based exporter
endpoint: 0.0.0.0:8889
send_timestamps: true
service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug]
metrics:
receivers: [otlp]
exporters: [debug, prometheus]
logs:
receivers: [otlp]
exporters: [debug]
2
Deploy the Collector:

Apply a Deployment that mounts this config and runs the collector:

apiVersion: apps/v1
kind: Deployment
metadata:
name: otel-collector
namespace: monitoring
spec:
replicas: 1
selector:
matchLabels:
app: otel-collector
template:
metadata:
labels:
app: otel-collector
spec:
containers:
- name: otel-collector
image: otel/opentelemetry-collector:0.94.0
resources:
limits:
memory: "256Mi"
cpu: "0.5"
requests:
memory: "128Mi"
cpu: "0.25"
ports:
- containerPort: 4317
name: otlp-grpc
- containerPort: 4318
name: otlp-http
- containerPort: 8889
name: prom-exp-http
command:
- "/otelcol"
- "--config=/etc/otel/collector-config.yaml"
volumeMounts:
- name: otel-collector-config-vol
mountPath: /etc/otel
volumes:
- name: otel-collector-config-vol
configMap:
name: otel-collector-config
items:
- key: collector-config.yaml
path: collector-config.yaml
3
Expose the Metrics Endpoint
apiVersion: v1
kind: Service
metadata:
name: otel-collector
namespace: monitoring
labels:
app: otel-collector
spec:
clusterIP: None
selector:
app: otel-collector
ports:
- name: otlp-grpc
port: 4317
targetPort: 4317
- name: otlp-http
port: 4318
targetPort: 4318
- name: prom-exp-http
port: 8889
targetPort: 8889
4
Create a ServiceMonitor:
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: otel-collector-sm
namespace: monitoring
labels:
release: kube-prometheus-stack
spec:
selector:
matchLabels:
app: otel-collector
endpoints:
- targetPort: 8889
interval: 15s
path: /metrics
5
Verify in Prometheus

Visit the Prometheus web UI at /targets and confirm otel-collector-sm is UP.