OpenSearch-Dashboards
OpenSearch-Dashboards copied to clipboard
[RFC] Create a plugin for metric reporting
Is your feature request related to a problem? Please describe.
- We want to create a plugin to record metrics such as number of click event on an UI element, number of times a UI element is visible to user, the success rate of an API call etc.
- The metrics are better not be accumulated as we want to keep track of each reported metric.
- The metric storing solution can be customized so that we can publish them to AWS CloudWatch, or Kinesis, or simply output a log.
- We don't vend a stat API in OSD as metric data could be stored to all kinds of platform and handled/analyzed/visualized from other platforms.
- We don't want to store metrics to
.kibanaindex through savedobject by default as it could overextend.kibanaindex
Describe the solution you'd like
A clear and concise description of what you want to happen.
- Create a core plugin: MetricsRecorder
- Other plugins can depend on this plugin and use it to record a metric.
- The recorded metrics are batched locally and sent to node API to process every 1 minute (can be configured)
- The plugin vends a function to register a MetricsRecorderFactory so that users can customize the metric storing strategy.
- The node API will call MetricsRecorderFactory to process the metrics.
Describe alternatives you've considered
We've considered using usage_collection plugin, it's a legacy plugin marked as deprecated for quite a long time for some performance issues. Here are some other obvious downsides make it not a good solution:
- It relies on saved_object. By default, all metrics are stored to
.kibanaindex which as mentioned above is already overextended. Mixing metric data and other user's configuration such as index pattern, dashboard, visualization etc could bring down the performance. Switching to a new storage solution could cause missing data for existing user. - People can provide a customized implementation of saved_object, but the interface of it is both complex and not quite relevant to metrics reporting.
usage_collectionhas many logic built to provide thestat()API which is unnecessary for metric collection purpose and add additional burden to customization.
telemetry is a plugin replies on usage_collection and it doesn't store metrics, only fetch.
Additional context
Add any other context or screenshots about the feature request here.