Traffic Processing with Plugins
Understanding Stacks and Plugins
In Qtap's configuration, traffic processing is organized using two key concepts:
Stacks: Named collections of plugins that work together to process traffic
Plugins: Individual components that perform specific functions on captured traffic
This structure allows you to create different processing configurations for different types of traffic.
New to plugins? Follow the Complete Guide for hands-on examples progressing through all 4 levels of plugin configuration (from basic to production-ready).
Want centralized management? Qplane provides visual configuration for stacks and plugins with automatic propagation to all agents. See the POC Kick Off Guide to get started.
Stack Configuration
Stacks are defined in the stacks section of your qpoint.yaml file. Each stack has a unique name and contains one or more plugins:
stacks:
default_stack: # Stack name
plugins: # List of plugins in this stack
- type: http_capture
config:
# Plugin-specific configurationYou can create multiple stacks for different purposes, each with its own set of plugins and configurations.
Available Plugins
Qtap includes several plugins that provide different processing capabilities. Rules use Rulekit - Qpoint's flexible expression-based rules engine for evaluating conditions against HTTP traffic.
HTTP Capture Plugin
The http_capture plugin provides comprehensive HTTP traffic capture with flexible logging levels and the ability to upload payloads to object storage.
Basic Configuration
Level Options
none: No capture (effectively disables the plugin)summary: Basic information (method, path, status code)headers: Includes headersfull: Complete information including request/response bodies
Example with Rules
This configuration:
Uses summary level by default
Captures full details for all traffic to
httpbin.orgCaptures detailed information for server errors (5xx)
Captures full information for client errors (4xx)
Container and Pod-based Filtering
You can also create rules based on container or Kubernetes pod attributes:
The http_capture plugin uploads captured data to the configured object store at all capture levels. At summary level, the stored object contains metadata only (method, URL, status, duration). At headers level, request and response headers are included. At full level, both headers and bodies are captured and stored.
Access Logs Plugin
The access_logs plugin provides formatted logging of HTTP traffic to stdout. It does not upload to the object store.
Basic Configuration
Mode Options
summary: Basic information (method, path, status code)details: Includes headers and timing informationfull: Complete information including request/response bodies
Example with Rules
HTTP Metrics Plugin
The http_metrics plugin exposes Prometheus-style metrics for HTTP traffic. It tracks request and response counts, durations, and payload sizes — useful for dashboards, alerting, and capacity planning.
Configuration
No additional configuration is needed. Once included in a stack, the plugin automatically records the following metrics:
Exported Metrics
requests_total
Counter
Total number of requests
requests_duration_ms
Histogram
Request duration in milliseconds
requests_size_bytes
Histogram
Request payload size in bytes
responses_total
Counter
Total number of responses
responses_duration_ms
Histogram
Response duration in milliseconds
responses_size_bytes
Histogram
Response payload size in bytes
duration_ms
Histogram
Combined request + response duration
All counter and histogram metrics include labels for method, host, status_code, and protocol.
Example
This gives you both Prometheus metrics and console logging in the same stack.
Report Usage Plugin
The report_usage plugin sends anonymized usage metrics to Pulse. This is mainly useful when using Qplane. It works alongside other plugins and doesn't affect traffic capture.
You can also use report_usage to promote specific HTTP headers into your OTel event store as custom attributes. Add a headers list to extract headers from observed traffic:
Promoted headers appear as customHeaders.req.<name> and customHeaders.res.<name> attributes in your OTel backend. See the full guide: Exporting HTTP Headers to OpenTelemetry.
This plugin is optional and can be included in any stack.
Error Detection Plugin
The detect_errors plugin captures detailed information when HTTP responses meet specific error criteria. It provides granular control over what gets recorded — you can independently toggle request headers, request body, response headers, and response body per rule.
This is especially useful when you need to capture request payloads without storing potentially massive response bodies (e.g., API calls that return large datasets).
Basic Configuration
Rule Options
name
string
Rule name for identification
trigger_status_codes
list
Status code patterns to match (e.g., '5xx', '404', '4xx')
trigger_empty_body
bool
Trigger when response body is empty
trigger_duration
duration
Trigger when request exceeds this duration (e.g., '5s', '500ms')
trigger_contains
string
Trigger when response body contains this string
only_categories
list
Only match specific MIME categories
only_urls
list
Only match specific URL patterns
exclude_urls
list
Exclude specific URL patterns
with_tags
list
Only match connections with specific tags
report_as_issue
bool
Flag matched requests as issues in the event store
record_req_headers
bool
Record request headers
record_req_body
bool
Record request body
record_res_headers
bool
Record response headers
record_res_body
bool
Record response body
Example: Capture requests but skip large response bodies
Example: Slow query detection with full capture
Debug Plugin (Deprecated)
DEPRECATED: The debug plugin is deprecated and will be removed in a future version.
Migration: Use access_logs plugin for console output, or http_capture for more flexible capture.
Why deprecated: The access_logs plugin provides better formatting and more features, making this plugin redundant.
The debug plugin provides basic logging of HTTP traffic.
Example of OLD (deprecated) approach:
NEW approach using access_logs:
Migration benefits:
Better formatted output (Apache-style logs)
Support for both console and JSON formats
Rule-based selective logging
Consistent with other plugins
Rule Expressions with Rulekit
Both the http_capture and access_logs plugins use Rulekit for rule evaluation. Rulekit is Qpoint's expression-based rules engine that evaluates conditions against key-value data from HTTP traffic.
Expression Syntax
Rule expressions follow a straightforward pattern:
Multiple conditions can be combined using logical operators:
Available Fields for Rule Expressions
Request Fields
http.req.method
http.req.method == "POST"
HTTP method (GET, POST, etc.)
http.req.path
http.req.path contains "/api/"
Request path
http.req.host
http.req.host == "api.example.com"
Host header value
http.req.url
http.req.url contains "search"
Full URL
http.req.headers.<name>
http.req.headers.content-type == "application/json"
Request header by name
Response Fields
http.res.status
http.res.status >= 400
HTTP status code
http.res.headers.<name>
http.res.headers.content-type contains "json"
Response header by name
Source Context Fields
src.container.name
src.container.name == "my-app"
Container name
src.container.labels.<key>
src.container.labels.app == "frontend"
Container label value
src.pod.name
src.pod.name == "frontend-abc123"
Kubernetes pod name
src.pod.labels.<key>
src.pod.labels.version == "v2"
Pod label value
Operators for Rule Expressions
Rulekit supports various operators for building expressions:
Comparison Operators
==
eq
Equal to
http.req.method == "GET"
!=
ne
Not equal to
http.req.host != "internal.example.com"
>
gt
Greater than
http.res.status > 200
>=
ge
Greater than or equal to
http.res.status >= 400
<
lt
Less than
http.res.status < 300
<=
le
Less than or equal to
http.res.status <= 399
=~
matches
Matches regex pattern
http.req.path matches /^\/api\/v\d+\//
contains
Contains substring
http.req.url contains "search"
in
Is contained in array
http.req.method in ["GET", "HEAD"]
Logical Operators
and
&&
Logical AND
http.req.method == "POST" and http.res.status >= 400
or
||
Logical OR
http.req.path contains "/admin" or http.req.path contains "/auth"
not
!
Logical NOT
not http.req.host == "public.example.com"
Value Types
Rulekit expressions support various value types:
Boolean:
true,falseNumber: Integer or floating-point values (e.g.,
200,1.5)String: Text enclosed in double quotes (e.g.,
"example.com")Regex Pattern: Patterns enclosed in slashes
/pattern/or vertical bars|pattern|Array: Values in square brackets (e.g.,
[200, 201, 204])
Using Rulekit Macros
You can define reusable expression macros in the rulekit section of your configuration:
Known Limitation: The not operator does not currently work in rule expressions or macros. Use explicit negation with != and && operators instead.
For example, instead of:
Use:
Complete Configuration Example
Here's a comprehensive example that demonstrates various plugin features:
Additional Resources
Rulekit Documentation: For detailed information about rule expressions, operators, and advanced features, visit the Rulekit GitHub repository
Rulekit Examples: The repository includes an interactive CLI demo tool for testing rule expressions
Last updated