This guide is specific to the OpenTelemetry Transformation Language. All guidelines in Collector Contrib's CONTRIBUTING.MD must also be followed.
When adding new values to the grammar you must:
Value
struct with the new value. This may also mean adding new token(s) to the lexer.NewFunctionCall
to be able to handle calling functions with this new value.NewGetter
to be able to handle the new value.All new functions must be added via a new file. Function files must start with func_
. Functions must be placed in ottlfuncs
.
Unit tests must be added for all new functions. Unit test files must start with func_
and end in _test
. Unit tests must be placed in the same directory as the function. Functions that are not specific to a pipeline should be tested independently of any specific pipeline. Functions that are specific to a pipeline should be tests against that pipeline.
Function names should follow the Function Syntax Guidelines