Skip to content

OBI Service Discovery

The executable_name, open_port, service_name, and service_namespace 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.

Services selection

YAML KeyEnv VariableTypeDefault
instrumentN/Alist 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 KeyEnv VariableTypeDefault
exclude_instrumentN/Alist 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 KeyEnv VariableTypeDefault
default_exclude_instrumentN/Alist of objects`(?:^

Skip Go-specific tracers

YAML KeyEnv VariableTypeDefault
skip_go_specific_tracersOTEL_EBPF_SKIP_GO_SPECIFIC_TRACERSbooleanfalse

Turns off detection of Go-specific telemetry. Coralogix falls back to generic instrumentation in this case.

Exclude OpenTelemetry-instrumented services

YAML KeyEnv VariableTypeDefault
exclude_otel_instrumented_servicesOBI_EXCLUDE_OTEL_INSTRUMENTED_SERVICESbooleantrue
exclude_otel_instrumented_services_span_metricsOTEL_EBPF_EXCLUDE_OTEL_INSTRUMENTED_SERVICES_SPAN_METRICSbooleanfalse

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:

  1. Name and namespace overrides: name, namespace
  2. Selection criteria (selectors): everything else

Name override

YAML KeyEnv VariableTypeDefault
namestring(derived)

Sets the service name in telemetry. Deprecated in favor of automatic metadata extraction.

Namespace override

YAML KeyEnv VariableTypeDefault
namespacestring(derived or empty)

Sets the service namespace in telemetry. Deprecated.

Selector properties

YAML KeyEnv VariableTypeDefault
open_portsstring (ports)(unset)
exe_pathstring (glob)(unset)
containers_onlybooleanfalse
k8s_namespacestring (glob)(unset)
k8s_pod_namestring (glob)(unset)
k8s_deployment_namestring (glob)(unset)
k8s_replicaset_namestring (glob)(unset)
k8s_statefulset_namestring (glob)(unset)
k8s_daemonset_namestring (glob)(unset)
k8s_owner_namestring (glob)(unset)
k8s_pod_labelsmap[string]string (glob)(unset)
k8s_pod_annotationsmap[string]string (glob)(unset)

Selectors can be combined within a service entry. All conditions must match for a process to be instrumented.

Example using labels:

discovery:
  services:
    - 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:

  1. OTEL_RESOURCE_ATTRIBUTES or OTEL_SERVICE_NAME environment variables
  2. Pod annotations:
    • resource.opentelemetry.io/service.name
    • resource.opentelemetry.io/service.namespace
  3. Pod labels:
    • app.kubernetes.io/name
    • app.kubernetes.io/part-of
  4. Pod owner metadata (Deployment, ReplicaSet, StatefulSet, etc.)
  5. Executable name

You can override default labels with YAML:

kubernetes:
  resource_labels:
    service.name:
      - override-svc-name
      - app.kubernetes.io/name
    service.namespace:
      - override-svc-ns
      - app.kubernetes.io/part-of