Skip to content

Commit

Permalink
test: add batch-processors test
Browse files Browse the repository at this point in the history
Signed-off-by: Bence Csati <[email protected]>
  • Loading branch information
csatib02 committed Nov 13, 2024
1 parent 99358c9 commit 9aff62b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
13 changes: 7 additions & 6 deletions docs/examples/tenant-to-tenant-routing/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ metadata:
collector: cluster
name: shared
spec:
transform:
name: parse-nginx
logStatements:
- context: log
statements:
- set(resource.attributes["parsed"], ExtractPatterns(body, "(?P<method>(GET|PUT))"))
processors:
transform:
name: parse-nginx
logStatements:
- context: log
statements:
- set(resource.attributes["parsed"], ExtractPatterns(body, "(?P<method>(GET|PUT))"))
logSourceNamespaceSelectors:
- matchLabels:
tenant: shared
Expand Down
13 changes: 7 additions & 6 deletions e2e/testdata/tenants_with_bridges/tenants_with_bridges.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ metadata:
collector: cluster
name: shared
spec:
transform:
name: parse-nginx
logStatements:
- context: log
statements:
- set(resource.attributes["parsed"], ExtractPatterns(body, "(?P<method>(GET|PUT))"))
processors:
transform:
name: parse-nginx
logStatements:
- context: log
statements:
- set(resource.attributes["parsed"], ExtractPatterns(body, "(?P<method>(GET|PUT))"))
logSourceNamespaceSelectors:
- matchLabels:
tenant: shared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ processors:
- action: insert
key: tenant
value: example-tenant-b
batch/example-tenant-a:
send_batch_size: 8192
timeout: 200ms
batch/example-tenant-b:
send_batch_size: 8192
timeout: 200ms
deltatocumulative: {}
k8sattributes:
auth_type: serviceAccount
Expand Down Expand Up @@ -160,6 +166,7 @@ service:
processors:
- memory_limiter
- attributes/exporter_name_loki-test-output
- batch/example-tenant-a
receivers:
- routing/subscription_example-tenant-a-ns_subscription-example-1_outputs
logs/output_example-tenant-a-ns_subscription-example-1_collector_otlp-test-output:
Expand All @@ -169,6 +176,7 @@ service:
processors:
- memory_limiter
- attributes/exporter_name_otlp-test-output
- batch/example-tenant-a
receivers:
- routing/subscription_example-tenant-a-ns_subscription-example-1_outputs
logs/output_example-tenant-a-ns_subscription-example-2_collector_otlp-test-output-2:
Expand All @@ -178,6 +186,7 @@ service:
processors:
- memory_limiter
- attributes/exporter_name_otlp-test-output-2
- batch/example-tenant-a
receivers:
- routing/subscription_example-tenant-a-ns_subscription-example-2_outputs
logs/output_example-tenant-b-ns_subscription-example-3_collector_fluentforward-test-output:
Expand All @@ -187,6 +196,7 @@ service:
processors:
- memory_limiter
- attributes/exporter_name_fluentforward-test-output
- batch/example-tenant-b
receivers:
- routing/subscription_example-tenant-b-ns_subscription-example-3_outputs
logs/output_example-tenant-b-ns_subscription-example-3_collector_otlp-test-output-2:
Expand All @@ -196,6 +206,7 @@ service:
processors:
- memory_limiter
- attributes/exporter_name_otlp-test-output-2
- batch/example-tenant-b
receivers:
- routing/subscription_example-tenant-b-ns_subscription-example-3_outputs
logs/tenant_example-tenant-a:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ func TestOtelColConfComplex(t *testing.T) {
},
}

// Set Batch processor defaults
for i, tenant := range inputCfg.Tenants {
inputCfg.Tenants[i].Spec.SetDefaults(tenant.Name)
}

// Config

// The receiver and exporter entries are not serialized because of tags on the underlying data structure. The tests won't contain them, this is a known issue.
Expand Down

0 comments on commit 9aff62b

Please sign in to comment.