Skip to content

[connector/signaltometrics] Implement optional attribute filtering #38600

Closed
@lahsivjar

Description

@lahsivjar

Component(s)

connector/signaltometrics

Is your feature request related to a problem? Please describe.

Current attribute filtering performed by signal to metrics connector is:

  1. If default_value is specified then ALWAYS produce the metric for the defined configuration. If the attribute is not present in the incoming data then the default value is used else the attribute value from the incoming data is used.
  2. If default_value is NOT specified then only produce the metric for the defined configuration if the incoming data as all the attributes, without default_value, available in the incoming data.

There are cases when we want a third option i.e. an optional attribute. If the attribute is present in the incoming data then include it, else, don't include it. This basically means that there would be another possible classification bucket with that attribute missing.

Describe the solution you'd like

Introduce a boolean configuration option to the attributes called passthrough (better names welcomed), the attribute will be false by default and in this case, the behavior of the component will be identical to the current behavior. With the value set to true the attribute will be kept as read from the input signal i.e.:

  1. If the input signal has the attribute defined then that value will be used.
  2. If the input signal has the attribute missing then a new datapoint will be created with missing attribute.

The passthrough and default_value will be mutually exclusive i.e. only one of the value must be defined - we will validate this as part of config validation.

Describe alternatives you've considered

No response

Additional context

#38494

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions