How to customize the Astra Traffic collector
Last updated: August 28, 2025
Overview
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.
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.yamlunder installation directory of astra-traffic-collector. Edit theconfig_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*")
Step 2: Restart the Astra Traffic Collector
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}}).
Step 1: Apply customization
Locate the
config_custom.yamlunder installation directory of astra-traffic-collector. Edit theconfig_custom.yamlprocessors: transform/custom: error_mode: ignore trace_statements: - context: span statements: ## Templatize url path regex pattern by keyword: "slug". Following will templatize the url Path: /api/v1/products/details/prod-12r4ty -> /api/v1/products/details/{{product_id}} - replace_pattern(attributes["url.template"], "prod-*", "{{product_id}}")Step 2: Restart the Astra Traffic Collector
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
Step1: Apply customization
Locate the
config_custom.yamlunder installation directory of astra-traffic-collector. Edit theconfig_custom.yamlprocessors: transform/custom: error_mode: ignore trace_statements: - context: span statements: ## Redact MasterCard credit card number - replace_all_patterns(attributes, "value", "^5[1-5][0-9]{14}$", "{{CreditCard}}")Step2: Restart the astra-traffic-collector
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
If Astra Traffic Collector is installed on a Linux VM, refer here to know how to restart
If Astra Traffic Collector is installed on Kubernetes, refer here to know how to restart
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