Skip to content

Filtering on pod via environment variables when running OBI as a sidecar #1240

@NimrodAvni78

Description

@NimrodAvni78

when running OBI in sidecar mode, the example shows matching the process to instrument either via port (OTEL_EBPF_OPEN_PORT) or executable path (OTEL_EBPF_AUTO_TARGET_EXE). that can work until you duplicate this configuration many times across many pods

ideally you would want the OBI sidecar to instrument only processes on the current pod, OBI supports this via config map in discovery.instrument.[0].k8s_pod_name, but not via environment variable like port and path

my suggestion is to add something similar to OTEL_EBPF_OPEN_PORT and OTEL_EBPF_AUTO_TARGET_EXE for pod name, for example OTEL_EBPF_K8S_POD_NAME. which will allow to define repeatable configuration for sidecar deployments

for example:

apiVersion: v1
kind: Pod
metadata:
  name: test-pod
spec:
  containers:
    - name: obi
      image: otel/ebpf-instrument
      env:
        - name: OTEL_EBPF_K8S_POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions