elastic / elastic/logstash

Update DLQ writer `writeEntry` to switch from plugin_type/plugin_id to elemenet_type/element_id

Open
#16,463 0 comments 0 reactions 0 assignees View on GitHub
enhancement status:needs-triage
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
1d 4h
Merged PRs (30d)
88

Description

The `DeadLetterQueueWriter.writeEntry` method https://github.com/elastic/logstash/blob/3e98cb16253b6135ed2cbd894ead3bed439f0185/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java#L397 accepts two parameters to identify which is the entity that generated the DLQ event.
As of today to identify that entity, the plugin type and plugin id was enough, for example (`output`, `123456`) but with the introduction of #16423 to enqueue also events that fails a conditional evaluation, becomes more meaningful the `element_type` (such as `output`, `input`, `if-statement`) and `element_id` (the id of plugin instance or could be the source reference for conditionals).

This means that the `@metadata` in DLQ input are not
```
"@metadata" => {
"dead_letter_queue" => {
"entry_time" => 2024-09-17T14:45:27.999153Z,
"plugin_id" => "if-statement",
"plugin_type" => "if-statement",
"reason" => "condition evaluation error, Unexpected conditional input combination of ':' (left) and 'class org.jruby.RubyFixnum:100' (right)"
}
}
```

but should become like:
```
"@metadata" => {
"dead_letter_queue" => {
"element_id" => ...
"element_type" => ...
...
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.