opentelemetry-collector-contrib icon indicating copy to clipboard operation
opentelemetry-collector-contrib copied to clipboard

[pkg/telemetryquerylanguage] Add support for passing Getter slices to functions

Open evan-bradley opened this issue 3 years ago • 3 comments

Description:

This allows TQL functions to receive an array of Getters as a parameter.

Link to tracking Issue:

This is a prerequisite for #12476, which will need to concatenate strings and path references to strings and therefore requires the ability to receive an array containing more than one primitive type.

Testing:

  • [x] Unit tests

Documentation:

There doesn't appear to be a good place to document these changes, but I'd be happy to add docs if there is.

evan-bradley avatar Jul 25 '22 20:07 evan-bradley

There doesn't appear to be a good place to document these changes, but I'd be happy to add docs if there is.

Good callout. I didn't specify well in the tql README that some Value types could be used as slices in function called. Can you update the Invocations section to specify the parameter types that the TQL understands?

TylerHelmuth avatar Jul 25 '22 20:07 TylerHelmuth

I've updated the docs to specify what types are supported from a function author's perspective, and to add some context around that I updated the Value types to include slices and added in a description for accessing telemetry data, mainly to discuss the Getter interface.

I also fixed a few typos and put the changes in separate commits. I can break those out into a separate PR, but I figured they weren't too distracting.

evan-bradley avatar Jul 26 '22 18:07 evan-bradley

@open-telemetry/collector-contrib-maintainer can we merge this?

TylerHelmuth avatar Aug 05 '22 15:08 TylerHelmuth