Skip to content

Commit

Permalink
[processor/transform] Update readme (#34268)
Browse files Browse the repository at this point in the history
Co-authored-by: Evan Bradley <[email protected]>
  • Loading branch information
TylerHelmuth and evan-bradley authored Jul 26, 2024
1 parent 8c25e9f commit 8de1e8f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions processor/transformprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ Each condition and statement can access and transform telemetry using functions

The transform processor allows configuring multiple context statements for traces, metrics, and logs.
The value of `context` specifies which [OTTL Context](#contexts) to use when interpreting the associated statements.
The conditions and statement strings, which must be OTTL compatible, will be passed to the OTTL and interpreted using the associated context. The conditions string should contain a string with a WHERE clause body without the `where` keyword at the beginning.
Each context will be processed in the order specified and each condition and statement for a context will be executed in the order specified. Conditions are executed first, if a context doesn't meet the conditions, the associated statement will be skipped.
The global conditions and statement strings, which must be OTTL compatible, will be passed to OTTL and interpreted using the associated context.
The condition string should contain a Where clause body without the `where` keyword at the beginning.

Each context will be processed in the order specified.
Within a context, each global condition is checked and if any evaluates to true, the statements are executed in order.
If a context doesn't meet any of the conditions, then the associated statement will be skipped.

Each statement may have a Where clause that acts as an additional check for whether to execute the statement.

The transform processor also allows configuring an optional field, `error_mode`, which will determine how the processor reacts to errors that occur while processing a statement.

Expand Down Expand Up @@ -71,7 +77,7 @@ Valid values for `context` are:
| metric_statements | `resource`, `scope`, `metric`, and `datapoint` |
| log_statements | `resource`, `scope`, and `log` |

`conditions` is a list comprised of multiple where clauses, which will be processed as global conditions for the accompanying set of statements.
`conditions` is a list comprised of multiple where clauses, which will be processed as global conditions for the accompanying set of statements. The conditions are ORed together, which means only one condition needs to evaluate to true in order for the statements (including their individual Where clauses) to be executed.

```yaml
transform:
Expand Down

0 comments on commit 8de1e8f

Please sign in to comment.