OBI service discovery
The executable_path, open_port, service_name, and service_namespace top-level fields are key settings that help you configure OBI to instrument either a single service or a group of related services.
In some deployments, such as running Coralogix as a Kubernetes DaemonSet, you may need to monitor a broad range of services. The discovery section in the YAML configuration provides fine-grained control over which services Coralogix instruments.
For example, you can override service names and namespaces for different types of services.
Select workloads by Pod annotation
By default, OBI instruments every eligible workload on the cluster, which can produce a large, sudden volume of telemetry, for example, during onboarding. On Kubernetes, the annotationFilter Helm preset lets you choose which workloads OBI instruments using a Pod annotation, without hand-writing a discovery configuration. This mirrors how the OpenTelemetry Operator selects workloads. For finer control, combine it with the discovery configuration described below.
To instrument only the Pods you opt in, add the preset to your values.yaml:
opentelemetry-ebpf-instrumentation:
presets:
annotationFilter:
enabled: true
OBI then instruments only the Pods annotated obi.coralogix.com/enabled: "true". Add the annotation to the workload's Pod template (spec.template.metadata.annotations), not to the Deployment metadata:
# On the workload (Deployment, StatefulSet, DaemonSet, ...)
spec:
template:
metadata:
annotations:
obi.coralogix.com/enabled: "true"
The preset accepts the following keys under presets.annotationFilter:
| YAML Key | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Turns the annotation filter on. |
mode | string | include | include (opt-in) instruments only the annotated Pods. exclude (opt-out) instruments every workload except the annotated Pods. |
annotations | map | obi.coralogix.com/enabled | Annotations that select the Pods, matched as globs. Defaults to "true" in include mode and "false" in exclude mode. A Pod missing the annotation never matches, and a supplied map replaces the default. |
Opt out instead of opt in
In exclude mode, OBI instruments every workload except the Pods you annotate obi.coralogix.com/enabled: "false":
opentelemetry-ebpf-instrumentation:
presets:
annotationFilter:
enabled: true
mode: exclude
Combine with a custom discovery configuration
The preset composes with a discovery configuration of your own instead of replacing it. In include mode, the annotations are added to each of your instrument selectors; in exclude mode, they are appended to your exclude_instrument list.
Internally, the preset renders as the k8s_pod_annotations selector. The same selector you can set by hand. Use the preset for the common opt-in or opt-out case, and the raw selector when you need to combine annotations with other selection criteria in a single entry.
The preset applies to application instrumentation. Enabling it together with the network preset fails the Helm template rather than taking effect silently.
Services selection
| YAML Key | Env Variable | Type | Default |
|---|---|---|---|
instrument | N/A | list of objects | (unset) |
Specify different selection rules for different services. You can also override metadata such as service name or namespace.
See the Discovery services example section for more details.
Exclude services
| YAML Key | Env Variable | Type | Default |
|---|---|---|---|
exclude_instrument | N/A | list of objects | (unset) |
Define services to exclude from instrumentation. This uses the same format as the services selection. Useful for skipping services like Prometheus.
Default excluded services
| YAML Key | Env Variable | Type | Default |
|---|---|---|---|
default_exclude_instrument | N/A | list of objects | `(?:^ | |
Skip Go-specific tracers
| YAML Key | Env Variable | Type | Default |
|---|---|---|---|
skip_go_specific_tracers | OTEL_EBPF_SKIP_GO_SPECIFIC_TRACERS | boolean | false |
Turns off detection of Go-specific telemetry. Coralogix falls back to generic instrumentation in this case.
Language selection
There is no top-level language key under discovery. Restrict instrumentation to specific programming languages in one of two ways:
- As a selector inside an
instrumententry: set thelanguagesglob on the entry. See Selector properties. - Globally via environment variable: set
OTEL_EBPF_AUTO_TARGET_LANGUAGE(glob). This applies to all discovered processes.
Supported values: go, java, dotnet, python, ruby, nodejs, c, cpp, rust. Use this to reduce overhead or limit instrumentation scope in mixed-language environments.
Filter by PID
| YAML Key | Env Variable | Type | Default |
|---|---|---|---|
target_pids | OTEL_EBPF_TARGET_PID | comma-separated list of integers or ranges (for example, 1234,5678,9000-9100) | (unset) |
Restrict OBI to instrument only specific processes by their process IDs (PIDs). This is useful for targeted debugging or when you want to instrument a single process without broader service discovery.
target_pids can be set at the top level of the OBI config (applies globally) or as a selector inside an instrument entry (applies only to that entry).
The PID selection list is evaluated dynamically: PIDs added to the configuration are picked up at runtime, and PIDs removed from the list are detached without restarting OBI.
Filter by command-line argument
| YAML Key | Env Variable | Type | Default |
|---|---|---|---|
cmd_args | – | string (glob) | (unset) |
Filter processes by their command-line arguments. Use this selector inside an instrument entry to distinguish between multiple instances of the same binary running with different arguments.
Exclude OpenTelemetry-instrumented services
| YAML Key | Env Variable | Type | Default |
|---|---|---|---|
exclude_otel_instrumented_services | OTEL_EBPF_EXCLUDE_OTEL_INSTRUMENTED_SERVICES | boolean | true |
exclude_otel_instrumented_services_span_metrics | OTEL_EBPF_EXCLUDE_OTEL_INSTRUMENTED_SERVICES_SPAN_METRICS | boolean | false |
Prevents Coralogix from monitoring services that already use OpenTelemetry SDKs to avoid duplicated telemetry. Turn this off if dual telemetry is acceptable.
Discovery services example
Example YAML selecting two service groups:
discovery:
instrument:
- exe_path: {worker,backend,frontend}
namespace: MyApplication
- exe_path: loadgen
namespace: testing
name: "TestLoadGenerator"
Coralogix instruments processes matching exe_path values. The name and namespace fields control the service's reported identity.
Service name and namespace overrides
Each service entry accepts properties grouped by purpose:
- Name and namespace overrides:
name,namespace - Selection criteria (selectors): everything else
Name override
| YAML Key | Env Variable | Type | Default |
|---|---|---|---|
name | – | string | (derived) |
Sets the service name in telemetry. Deprecated in favor of automatic metadata extraction.
Namespace override
| YAML Key | Env Variable | Type | Default |
|---|---|---|---|
namespace | – | string | (derived or empty) |
Sets the service namespace in telemetry. Deprecated.
Selector properties
| YAML Key | Env Variable | Type | Default |
|---|---|---|---|
open_ports | – | string (ports) | (unset) |
exe_path | – | string (glob) | (unset) |
languages | – | string (glob) | (unset) |
target_pids | – | list of integers | (unset) |
cmd_args | – | string (glob) | (unset) |
containers_only | – | boolean | false |
k8s_namespace | – | string (glob) | (unset) |
k8s_pod_name | – | string (glob) | (unset) |
k8s_deployment_name | – | string (glob) | (unset) |
k8s_replicaset_name | – | string (glob) | (unset) |
k8s_statefulset_name | – | string (glob) | (unset) |
k8s_daemonset_name | – | string (glob) | (unset) |
k8s_owner_name | – | string (glob) | (unset) |
k8s_pod_labels | – | map[string]string (glob) | (unset) |
k8s_pod_annotations | – | map[string]string (glob) | (unset) |
Selectors can be combined within an entry. All conditions must match for a process to be instrumented.
Selectors support numeric comparison operators for fields like open_ports. For example, you can use >8000 to match ports greater than 8000.
Example using labels:
discovery:
instrument:
- k8s_namespace: frontend
k8s_pod_labels:
instrument: obi
Kubernetes-specific name and namespace resolution
Coralogix automatically sets service name and namespace using Kubernetes metadata in this priority order:
OTEL_RESOURCE_ATTRIBUTESorOTEL_SERVICE_NAMEenvironment variables- Pod annotations:
resource.opentelemetry.io/service.nameresource.opentelemetry.io/service.namespace
- Pod labels:
app.kubernetes.io/nameapp.kubernetes.io/part-of
- Pod owner metadata (Deployment, ReplicaSet, StatefulSet, etc.)
- Executable name
You can override default labels with YAML. In the OBI config, kubernetes is nested under attributes:
attributes:
kubernetes:
resource_labels:
service.name:
- override-svc-name
- app.kubernetes.io/name
service.namespace:
- override-svc-ns
- app.kubernetes.io/part-of