inspectit-ocelot
inspectit-ocelot copied to clipboard
Add labels to selectively enable/disable groups of rules
This issue tries to solve the problem that the number of rules can easily explode and be hard to manage. For example, for each combination of functionality (tracing, servicegraph, http-metrics) and technology (servlet-api, jdbc, ..) there is an individual rule.
This makes it very hard to disable or enable rules based o na concern, e.g. "Disable all JDBC instrumentation", "disable the service-graph functionality".
In order to solve this, we propose the concept of "labeling" rules:
inspectit:
instrumentation:
rules:
servicegraph_jdbc:
labels:
jdbc : true
servicegraph: true
tracing_jdbc:
labels:
jdbc : true
tracing: true
servicegraph_servlet_api:
labels:
servletapi : true
servicegraph: true
A rule now only gets active if and only if it's enabled flag is true and all it's labels are "activated" (terminology needs to be discussed).
The enabling / dsiabling could look as follows:
inspectit:
enable:
servicegraph: true
jdbc: true
jdbc.mysql: false
Labels are hierachical. E.g. the label jdbc includes the labels jdbc.mysql and jdbc.oracle.
If both a "parent" and "child" label are specified in a single configuration source, the "child" has higher priority as shown in the example above.
Labels will need a special-case handling (a) for loading them and (b) when merging them from multiple files in the configuration server.
This problem was improved by introducing rule modularity. Several rules can be enabled or disabled within one rule. However, there is still no option to disable e.g. all javax rules with only one property. Labels would solve this.