[YAML] Add SplunkIO write SchemaTransform and WriteToSplunk #40481
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 328 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.347
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #40481"
general
weight: 0.35
schizophrenicmaniac
Adds a SchemaTransform for SplunkIO writes and exposes it in Beam YAML as
WriteToSplunk. It follows the same approach as the Datadog one (#38362). SplunkIO in Java only supports writes, so there is noReadFromSplunkhere.Each input row becomes a
SplunkEvent.event(string) is required.time(int64),host,source,sourcetype,indexandfieldsare optional.fieldscan be a nested row or a JSON object string, and other columns are ignored. The config covers everythingSplunkIO.Writesupports (url, token, batch_count, parallelism, disable_certificate_validation, root_ca_certificate_path, enable_batch_logs, enable_gzip_http_compression) plus error_handling. The error output has the same shape as Datadog's: rows that can't be converted come back withfailed_rowand a 400, and HEC write failures come back with the HTTP status and the payload. Without error_handling, a failed write fails the pipeline.While testing this I found that
SplunkWriteErrorloses all of its values once it goes through a coder. It has@DefaultSchema(AutoValueSchema.class), but its accessors aren'tget-prefixed, so the inferred schema has no fields and every error decodes as null/null/null.SplunkEventWriterTestdoesn't catch this becausecontainsInAnyOrderdecodes both sides with the same coder. I replaced the annotation with a hand-writtenSplunkWriteErrorSchemaProvider, soSplunkWriteErroris still encoded as a row, now withstatusCode,statusMessageandpayloadfields. This changes the output coder ofSplunkIO.Write, so I listed it under bugfixes in CHANGES.md.The YAML test runs SplunkIO on the Python FnApiRunner, which failed on the stateful writer's timers: the runner length prefixes coders it doesn't know for PCollections but not for timer family coders, so it tried to decode the Java
VarIntCoderkeys itself. The runner now length prefixes timer coders the same way. This also makes thebeam:coders:javasdk:0.1registration in integration_tests.py unnecessary, so that's removed.Changes:
SplunkWriteSchemaTransformProvider/SplunkWriteSchemaTransformConfiguration, registered in the IO expansion serviceWriteToSplunkin standard_io.yaml and the matching entry in standard_external_transforms.yamlSplunkWriteErrorSchemaProvider, used as the default schema ofSplunkWriteErrorand for the fields of the error outputFixes #40470