-
Notifications
You must be signed in to change notification settings - Fork 885
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
[RFC] Create a plugin for metric reporting #8625
Comments
If the storage medium is the issue lets change that to something else. The saved object client should now support adapters to different storage mediums. Lets repurpose that logic to write to a non opensearch index if thats the concern. SQLite is a good option. But open to other ideas.
Can you elaborate a little more about this? Im not sure i unerstand this limitation. We were able to add many new fields without an issue to the useage collection report and didnt have to make any new mapping changes. e.g. #8345
Why is this an additional burden? If anything this simplifies the usage. We get all metric data from a single API. This is much better for collectors since we can get all the data in a single request. Today many plugins unfortunately expose their own stats API's flooding the request logs because they arent using this common API. I see having a single API as a benefit, not a drawback Also what you are proposeing is exactly what im calling for in the first point. You want to be able to store the metrics in a place thats not the Kibana index. Just for that we dont need to reinvent the wheel. Just make the sotrage medium for the useage collector configurable. .kiaban is only a place to persist the data. We can persist the data to file or SQLite or any other persistent storage medium on the server side and the saved object service should already have the capability now. |
I'm afraid we can't simply change the storage to somewhere else as if users are already using this feature and storing their usage data in .kinana, they will find their data are missing with new update.
Sorry, my bad. The saved_object allows us to customize an internal repository implementation and usage_collection uses that internal repository to retrieve/store metric data. I meant the interface of repository is complex and not quite relevant to a metric collection. Another issue is the customized internal repository is not only used by usage_collection but other plugins as well for different purposes.
I fully understood the merits of the API. I mean if uses want to use another platform to store and analyze their metrics, they do not need to be exposed in OSD through stats(). The contract of usage_collection is that it stores through |
For usage_collection, currently we're using SavedObjects for persistence. Similarly, we can have a API client, something called Just an idea: interface MetricPublisher {
publish(metrics: Metric | Metric[]): Promise<void>
}
class OpenSearchPublisher implements MetricPublisher {
consctructor(private repository: ISavedObjectsRepository) {}
publish(metrics: Metric | Metric[]) {
// implement something like the current storeReport function
this.repository.create(...)
this.repository.bulkCreate(...)
this.repository.incrementCounter(...)
}
}
class CloudWatchPublisher implements MetricPublisher {
consctructor(private repository: ISavedObjectsRepository) {}
publish(metrics: Metric | Metric[]) {
// call cloud watch API to store metrics
}
} Then we don't need to abandon usage_collection plugin, but refactor it so that it can support different persistence layers. @chishui @ashwin-pc |
We are not using this today. And if we suspect someone might be. we can make it dynamic so that the default storagestill remains to be saved objects, but can be changed to something else
Thats fair. But thats not a reason to introduce a new way to track metrics without a plan for the old one. We cant have 2 different ways to track metrics in the platform. Thats a duplicative effort. If we want a new way to collect metrics when an existing method exists, we need a much better reasonsing. I havent seen a clear reason here on why the problems you called out in the usage collector is not fixable. @ruanyl's suggestion is precicely what i excpected we would be using to get around the limitations of storing using saved objects. As for vending the data, again, while the stats command can vend the data, it needs url params to expose that information. So there are ways there too to fetch the data in a similar fashion. |
@chishui can you convert this into an RFC so that we can invite the rest of the community to weigh in on your proposal. I dont think this qualifies as a feature request given the existence of the existing usage collector |
Is your feature request related to a problem? Please describe.
.kibana
index through savedobject by default as it could overextend.kibana
indexDescribe the solution you'd like
A clear and concise description of what you want to happen.
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:.kibana
index 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.usage_collection
has 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.
The text was updated successfully, but these errors were encountered: