Configure AutoI to instrument selected Kubernetes namespaces and workload types.

Application instrumentation requires two policies:

  • Cluster-level policy (WaveClusterAutoInstrumentationPolicy): Defines the namespaces eligible for instrumentation using spec.namespaceScoping.include and spec.namespaceScoping.exclude.

  • Namespace-level policy (WaveAutoInstrumentationPolicy): Enables instrumentation in each selected namespace using spec.enableNamespace: true and specifies workload kinds through autoInstrumentWorkloads.

The cluster policy is a namespaced resource. AutoI uses the instance deployed in its own release namespace as the cluster-wide policy.

An empty cluster include and exclude list selects no namespaces. Keep one cluster instrumentation policy in the AutoI release namespace and avoid duplicate namespace policies.

Before you begin

  • Set autoInstrumentation.enabled: true in the maintained AutoI values file.
  • Identify the application namespaces to instrument.
  • Confirm the supported application languages and workload kinds.
  • Inspect existing policies before creating or editing resources.
  • Plan controlled restarts for Java and Python workloads when required.

Inspect existing policies

kubectl get wcai-pol -n opsramp-autoi
kubectl get wai-pol -n team-a

Inspect the installed schema when necessary:

kubectl explain wcai-pol.spec --recursive
kubectl explain wai-pol.spec --recursive

Configure AutoI instrumentation policies

AutoI uses two policies to determine which Kubernetes namespaces and workloads are eligible for instrumentation:

1. Configure the cluster policy

The cluster policy defines the namespace scope for AutoI instrumentation. Update the existing WaveClusterAutoInstrumentationPolicy resource instead of creating a second policy. Preserve any existing settings required for your environment.

The following example includes the qa-bank-app namespace and does not exclude any namespaces:

apiVersion: autoi.config.opsramp.com/v1
kind: WaveClusterAutoInstrumentationPolicy
metadata:
  name: cluster-instrumentation-policy
  namespace: opsramp-autoi # Replace with the AutoI release namespace
spec:
  namespaceScoping:
    include:
      - qa-bank-app
    exclude: []

Apply the cluster policy

Save the cluster configuration as cluster-policy.yaml. Replace opsramp-autoi with the namespace where AutoI is installed, and update the namespace lists as required.

kubectl apply -f cluster-policy.yaml

2. Configure the namespace policy

A namespace must have a WaveAutoInstrumentationPolicy resource to opt in to AutoI instrumentation. Before creating the policy, check whether one already exists in the namespace. If it exists, update the existing resource instead of creating a duplicate.

The following example enables instrumentation for Deployments and StatefulSets in the qa-bank-app namespace:

apiVersion: autoi.config.opsramp.com/v1
kind: WaveAutoInstrumentationPolicy
metadata:
  name: bank-app-policy
  namespace: qa-bank-app
spec:
  enableNamespace: true
  autoInstrumentWorkloads:
    - DEPLOYMENT
    - STATEFULSET

Apply the namespace policy

Save the namespace configuration as namespace-policy.yaml. Replace qa-bank-app with the target namespace and update the workload kinds as required.

kubectl apply -f namespace-policy.yaml

Understand the policy configuration

The following table describes how the cluster-level and namespace-level settings work together.

Policy / FieldConfiguration LevelDescription
namespaceScoping.includeCluster-levelSpecifies the namespaces eligible for instrumentation. Add the required namespace names to this list.
namespaceScoping.excludeCluster-levelSpecifies namespaces excluded from instrumentation, even if they are listed in the include list. Use an empty list ([]) when no namespaces need to be excluded.
enableNamespaceNamespace-levelEnables or disables AutoI instrumentation for the namespace. Set to true to opt in. The namespace must also be included in the cluster-level policy scope and must not be excluded.
autoInstrumentWorkloadsNamespace-levelSpecifies the workload kinds eligible for automatic instrumentation in the namespace. Only the listed workload kinds are selected.

Supported workload kinds:

  • DEPLOYMENT
  • STATEFULSET
  • DAEMONSET
  • JOB
  • CRONJOB
  • ROLLOUT

Restart requirements

Go probes can attach to supported processes that are already running. Java and Python injection occurs when pods start. If existing Java or Python workloads must be instrumented, coordinate a controlled rollout after applying the policy.

Configure per-workload and per-container instrumentation

Use WaveAutoInstrumentationUserServiceConfig (wai-usvc) to configure a workload or its individual containers. WaveAutoInstrumentationServiceConfig (wai-svc) is system-managed state that reports detected languages and whether instrumentation is enabled for each container; inspect it, but do not edit it as user configuration. Check for an existing user service config before creating one.

apiVersion: autoi.config.opsramp.com/v1
kind: WaveAutoInstrumentationUserServiceConfig
metadata:
  name: bank-api-instrumentation
  namespace: qa-bank-app
spec:
  resources:
    - kind: Deployment
      resourceName: bank-api
      enabled: true
      containerInstrumentationSpecs:
        - containerName: api
          enabled: true
          userLanguageSpec:
            language: java
        - containerName: metrics-sidecar
          enabled: false

Update Go instrumentation offsets

AutoI uses Go instrumentation offsets to support instrumentation across Go application versions. It downloads the offsets from the following locations:

  • /version.json

  • //offset_results.json

When Go application versions change and require updated instrumentation offsets, use Refresh Go Offsets in the AutoI UI to retrieve the latest offsets.

The refresh operation uses the /api/v1/go-offsets API. AutoI stores the retrieved offsets in the WaveClusterAutoInstrumentationGoOffsets resource, which eworker consumes during instrumentation.

Configure Go offset settings

You can optionally use the following Helm settings to customize how AutoI retrieves and manages Go instrumentation offsets:

Helm settingPurpose
autoInstrumentation.goOffsetsBaseURLOverrides the default base URL used to download Go instrumentation offsets.
autoInstrumentation.goOffsetsVersionSpecifies the Go offsets version to use.
autoInstrumentation.goOffsetsLockVersionPrevents automatic changes to the configured offsets version.

Verify instrumentation

kubectl get wai-svc -n qa-bank-app
kubectl get wai-svc -n qa-bank-app -l wave.io/workload-name=bank-api -o yaml
kubectl get wai-usvc -n qa-bank-app

Generate application traffic and verify traces and metrics in OpsRamp.

A wai-svc resource represents system-managed workload state, including detected language and per-container instrumentation status. Use wai-usvc for user-managed workload and container settings.

If instrumentation is missing, check:

  • Cluster namespace scope
  • Namespace policy
  • Workload kind
  • Detected application language
  • radiance readiness
  • Existing workload override
  • Whether a Java or Python rollout is required