-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[processor/filter] Ensure OTTL configuration provides same features as existing configuration #16413
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
The filterprocessor configuration for spans, metrics, and logs allows for From the README:
The OTTL implementation acts like OTTL Conditions can be written in such a way that processors:
filter:
spans:
include:
match_type: strict
services:
- app_3
exclude:
match_type: regexp
services:
- app_1
- app_2
span_names:
- hello_world
- hello/world
attributes:
- Key: container.name
Value: app_container_1
libraries:
- Name: opentelemetry
Version: 0.0-beta
resources:
- Key: container.host
Value: 127.0.0.1 The filter processor will drop any span that does not have a service name of This would be written as OTTL statements like: processors:
filter:
traces:
span:
- 'resource.attributes["service.name"] != "app_3"'
- name == "hello_world"
- name == "hello/world"
- attributes["container.name"] == "app_container_1"
- scope.version == "0.0-beta"
- resource.attributes["container.host"] == "127.0.0.1")' |
When filtering span, the filterprocessor configuration allows matching by service name, span name, attributes, scopes, resource attributes, and span kind. Both strict and regex is supported. When checking attributes, converting attribute values from bool, double, and int to string is supported The OTTL has access to each of these properties. The Factory Function, OTTL needs to be able to perform regex where the input is converted to the string if it is a bool, int, or double. There are other situations in the transformprocessor where type conversion is needed, so adding a |
When filtering logs, the filterprocessor configuration allows matching by resource attributes, attributes, severity text, body, and severity number. Both strict and regex is supported. When checking attributes, converting attribute values from bool, double, and int to string is supported. When matching severity number, a minimum log severity can be used and any values equal to or greater than the severity match. You can also specify if an undefined severity number can be match. The OTTL has access to all of these fields for logs. Like before, regex matching will need to be improved to handle type conversion. The OTTL supports inequalities and the severity number ENUMS so it can handle the existing severity number logic. |
When filtering metrics the filter processor configuration allows matching by metric name, resource attributes and datapoint attributes via expressions. When checking attributes, converting attribute values from bool, double, and int to string is supported. The expression allows for checking a datapoint's attribute value or the presence of an attribute. If any datapoint within a metric matches then the entire metric is dropped. The OTTL has access to all of these fields. Like before, regex matching will need to be improved to handle type conversion. The OTTL metric context has access to the datapoints for the metric, but there are not any functions that can check the attributes of these data points. The datapoint context has access to the datapoint attributes, but there is no way to drop the entire metric if a single datapoint matches. The OTTL will need to be able to handle an ottlmetric condition that can check individual attributes. |
I agree about the "OTTL needs to be able to perform regex where the input is converted to the string if it is a bool, int, or double.". I do understand the difference between include/exclude which were added because we could not do "!=" in the filters language. But we the current OTTL this seem reasonable to me "The OTTL will need to be able to handle an ottlmetric condition that can check individual attributes." this may be very hard, let's focus on the first 2 first. |
@bogdandrutu with negation and the IsMatch updates I believe we've covered the first 2 gaps. How do you want to handle the third? A function could be made specifically for the metric context that can use the datapoints accessor and loop through looking for the specified attributes. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
All gaps have been addressed. Old configs can now be deprecated. |
Component(s)
processor/filter
Is your feature request related to a problem? Please describe.
The OTTL package is being added to the filterprocessor to support generic filtering of spans, span events, metrics, data points, and log records. To simplify the filterprocessor and its config, I propose that only the OTTL is needed, but before any existing configuration can be deprecated and removed the existing feature set of the processor must be reviewed to ensure that OTTL can handle all existing user situations. Any missing features must be added to the OTTL before this issue can be closed.
Describe the solution you'd like
Filterprocessor feature set is reviewed and it is confirmed that OTTL can handle all existing features.
Feature gaps:
include
statementsDescribe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: