How to customize the Astra Traffic collector

Last updated: June 12, 2026

Introduction

Astra Traffic Collector supports customization to filter, templatize, and redact traces before sending them to Astra’s backend. This gives you full control over what telemetry data leaves your environment and ensures sensitive data (like PII or financial information) is protected.

Instructions

Customizing the behavior of Astra Traffic Collector

Step 1 — Edit Custom Configuration

Modify /opt/astra-traffic-collector/config_custom.yaml to add filtering, redaction, or URL templating.

📄 How to customize the Astra Traffic collector

Step 2 - Apply Updated ConfigMap

kubectl create configmap astra-collector-custom-config --from-file=/opt/astra-traffic-collector/config_custom.yaml -n astra-collector --dry-run=client -o yaml | kubectl apply -f -
kubectl delete po astra-traffic-collector -n astra-collector

Upgrade

Step 1 — Update the Helm repository:

helm repo update

Step 2 — Upgrade to the latest chart:

helm upgrade --install traffic-collector getastra/traffic-collector-chart --namespace astra-collector --debug --values values.yaml

Filtering

Filtering allows you to define AllowLists (only allow specific traces) or ExcludeLists (exclude specific traces).

  • AllowListing → permits traces from specific hosts or patterns.

  • ExcludeListing → drops traces matching a specific host or pattern.

Example: Filtering based on host or template

  • Step 1: Apply customization

    Locate the config_custom.yaml under installation directory of astra-traffic-collector. Edit the config_custom.yaml

processors:
  filter/custom:
      error_mode: ignore
      traces:
        span:
          ## allowing traces based on hostname regex pattern. Following will drop all traces originated from host other than: localhost*
          - IsMatch(attributes["url.host"], "localhost*") == false
          ## excluding traces based on hostname regex pattern. Following will drop all traces originated from host: localhost*
          - IsMatch(attributes["url.host"], "localhost*")
          ## excluding traces based on template regex pattern. Following will drop all traces having the API path: _wdt*
          - IsMatch(attributes["url.template"], "_wdt*")

Templatizing

Templatizing normalizes dynamic values (IDs, UUIDs, product codes, etc.) into templates. Astra automatically handles common values like integers and UUIDs, but you can define additional patterns.

Example: Replace dynamic product IDs

/api/v1/products/details/prod-12r4ty  
/api/v1/products/details/prod-qw34tg  
/api/v1/products/details/prod-gy78fg

These dynamic values (prod-12r4ty, prod-qw34tg , etc.) represent product IDs. To replace dynamic segments with a template (e.g., {{product_id}}).

Redacting

Redaction ensures sensitive data such as credit card numbers, SSNs, or other PII never leaves your environment. You can redact using regex patterns.

Example: Redact MasterCard numbers

Redaction will be applied to every part of the trace including request body/header, response body/header, query parameters etc

Verify the traces before sending them to Astra

Before exporting traces to Astra, verify filtering, redaction, and templatization locally.

Step 1: Remove the otlp exporter

Locate the config_custom.yaml under installation directory of astra-traffic-collector. Edit the config_custom.yaml

processors:
  #your custom processing including redacting, filtering and templatizing....

service:
    pipelines:
      traces:
        processors: [probabilistic_sampler, transform, transform/custom, filter, filter/custom, batch]
        exporters: [debug]

Take a look at service.pipelines.exporters in the above YAML. It only shows debug as the value. This means that the traces will not be exported to Astra backend and thus be confined only with local.
Under such setting, inventory will not be populated from this sensor because no trace is being exported to Astra.

Ensure to set back service.pipelines.exporters to [debug, otlp] as soon as your troubleshooting is over. See Step 4

Step 2: Restart the astra-traffic-collector

Step 3: Verify the traces by inspecting astra-traffic-collector logs

📄 Verifying Traces in Astra Traffic Collector

Step 4: After the verification is over, please add the otlp exporter back

processors:
  #your custom processing including redacting, filtering and templatizing....

service:
    pipelines:
      traces:
        processors: [probabilistic_sampler, transform, transform/custom, filter, filter/custom, batch]
        exporters: [debug, otlp]

Step 5: Restart the Astra Traffic Collector