opentelemetry-collector/processor/processorhelper
Daniel Jaglowski 49339e80cc
[chore] Reduce complexity in processorhelper obsreport (#10693)
This PR removes the `recordData` method, which I believe is an unhelpful
abstraction for reporting internal processor metrics.

The drawbacks of the function are minor, but briefly:
1. Recording any metric requires passing in zeros for _all other
metrics_. This is cumbersome to extend because any new metric requires
updating the call to `recordData` for all metrics. It's also fragile
because if we have more than a few metrics it is easy to position the
intended metric incorrectly.
2. Every metric describes one data type, which is passed into
`recordData` but then just used as a switch to get back to code that is
specific to that data type.
3. Every call to `recordData` instantiates N variables, where N is the
number of metrics for each data type.

All of this seems unnecessary as we can just report each metric in one
unambiguous line of code.
2024-07-22 12:54:30 -07:00
..
internal/metadata [processorhelper] update units for metrics (#10647) 2024-07-22 09:55:31 -07:00
documentation.md [processorhelper] update units for metrics (#10647) 2024-07-22 09:55:31 -07:00
generated_component_telemetry_test.go [processor] deprecate CreateSettings -> Settings (#10336) 2024-06-06 09:34:53 -07:00
generated_package_test.go [chore] use mdatagen for processorhelper (#10122) 2024-05-09 07:03:07 -07:00
logs.go [processor] deprecate CreateSettings -> Settings (#10336) 2024-06-06 09:34:53 -07:00
logs_test.go [processor] deprecate CreateSettings -> Settings (#10336) 2024-06-06 09:34:53 -07:00
metadata.yaml [processorhelper] update units for metrics (#10647) 2024-07-22 09:55:31 -07:00
metrics.go [processor] deprecate CreateSettings -> Settings (#10336) 2024-06-06 09:34:53 -07:00
metrics_test.go [processor] deprecate CreateSettings -> Settings (#10336) 2024-06-06 09:34:53 -07:00
obsreport.go [chore] Reduce complexity in processorhelper obsreport (#10693) 2024-07-22 12:54:30 -07:00
obsreport_test.go Add "inserted" metrics to processors (#10372) 2024-06-19 12:15:42 +02:00
processor.go [chore] use mdatagen for processorhelper (#10122) 2024-05-09 07:03:07 -07:00
traces.go [processor] deprecate CreateSettings -> Settings (#10336) 2024-06-06 09:34:53 -07:00
traces_test.go [processor] deprecate CreateSettings -> Settings (#10336) 2024-06-06 09:34:53 -07:00