CRD Reference
Complete reference for the ObtraceInstrumentation custom resource — declarative configuration for GitOps workflows.
CRD Reference
The ObtraceInstrumentation custom resource defines how workloads in your cluster are instrumented. It is the primary configuration mechanism for Obtrace Zero and is fully compatible with GitOps tools like ArgoCD and Flux.
Resource definition
Short names for kubectl: oti, obtrace
Spec fields
apiKey
Direct API key for authenticating with ingest-edge.
For production, use apiKeySecretRef instead to avoid storing secrets in Git.
apiKeySecretRef
Reference to a Kubernetes Secret containing the API key.
The Secret must exist in a namespace accessible by the operator. The operator reads the Secret at injection time and injects the value as an environment variable.
ingestEndpoint
URL of the ingest-edge service.
Default (in-cluster): https://ingest-edge.obtrace.svc.cluster.local:8080
strategy
Global instrumentation strategy. See Strategies for details.
namespaces
List of namespaces to instrument. If empty or not set, all namespaces are targeted (excluding system namespaces).
Use "*" to explicitly instrument all namespaces:
excludeNames
List of workload names (Deployment, StatefulSet, DaemonSet) to skip.
selector
Kubernetes label selector to restrict which Pods are instrumented.
languageHints
Override detected language for specific workloads. The key is the Deployment/StatefulSet/DaemonSet name.
Valid values: nodejs, python, java, go, dotnet, php, ruby, rust, unknown.
Go and Rust hints force eBPF strategy. All other languages force SDK strategy.
sampling
Controls trace sampling rates.
| Field | Type | Description |
|---|---|---|
traceRatio | float (0.0-1.0) | Global sampling ratio. 1.0 = sample everything, 0.1 = 10% |
rulesPerService | map[string]float | Per-service override. Key is the resolved service name |
propagation
Controls trace context header injection and extraction.
When injectHeaders is true, agents add traceparent and X-Obtrace-Trace-Id to outbound HTTP requests. When extractHeaders is true, agents read these headers from inbound requests to continue distributed traces.
resourceAttributes
Custom key-value attributes added to every telemetry resource.
These are injected as OBTRACE_ATTR_* environment variables and included in the OTLP resource attributes of every span, log, and metric.
Status fields
The operator populates the status subresource with discovery and instrumentation state.
| Field | Description |
|---|---|
phase | Current operator phase |
instrumentedPods | Count of Pods with obtrace.io/instrumented=true |
discoveredWorkloads | Array of all detected workloads with language, framework, strategy |
conditions | Standard Kubernetes conditions |
Printer columns
kubectl get oti displays:
Complete example
Multiple CRDs
You can create multiple ObtraceInstrumentation resources for different scopes:
The operator matches Pods to the first ObtraceInstrumentation whose namespaces field includes the Pod's namespace.