-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Dashboards++] Usage counters enhancements #186530
Labels
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Comments
Pinging @elastic/kibana-core (Team:Core) |
gsoldevila
added a commit
that referenced
this issue
Jul 5, 2024
…87064) ## Summary Part of #186530. This PR sets the basis for allowing namespaced usage counters. It relocates `usage-counters` SO type from `.kibana` to a dedicated `.kibana_usage_counters`. Furthermore, the original SO type is removed, and replaced by 2 separate types: * `server-counters` * `ui-counters` Note that these 2 steps are necessary if we want to leverage `namespaces` property of the saved objects. We can't currently update the `namespaceType: 'agnostic'` without causing a migration. Thus, these two types will be defined as `namespaceType: single`. Up until now, UI counters were stored under a special `domainId: uiCounter`. This forced a workaround that consisted in storing `appName:eventName` in the `counterName` property of the SO. Having a dedicated SO type for them allows to store `appName` as `domainId`, avoiding the need for a [workaround](https://github.com/elastic/kibana/blob/main/src/plugins/usage_collection/common/ui_counters.ts). --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
gsoldevila
added a commit
that referenced
this issue
Aug 5, 2024
## Summary Part of #186530 Follow-up of #187064 The goal of this PR is to provide the necessary means to allow implementing the [Counting views](https://docs.google.com/document/d/1W77qoweixcjrq0sEKh_LjIk3j33Xyy9umod9mG9BlOM/edit) part of the _Dashboards++_ initiative. We do this by extending the capabilities of the _usage counters_ APIs: * We support custom retention periods. Currently data is only kept in SO indices for 5 days. Having 90 days worth of counting was required for Dashboards++. * We expose a Search API that will allow retrieving persisted counters. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This work is done - closing the issue |
@rayafratkina Is there a way to view dashboard usage with these counters in gui? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Introduction
The Dashboards++ initiative proposes using
usage-counters
as a means to easily add telemetry to monitor dashboard utilization. In the same lines, this document proposes further enhancements to the usage counters logic, which will benefit not only this particular use case, butusage-counters
in general.Proposed changes
Dedicated index
The first thing we propose is to use a dedicated index to store all the
usage-counters
saved objects. Seeing thatusage-counters
are going to be used more broadly, having a dedicated index to store them will help:The .kibana split, introduced in 8.8.0, started breaking down the
.kibana
index in multiple SO indices.This creates an opportunity to introduce new indices for certain SO types. Thus, we propose creating a .kibana_usage_counters index, and storing all
usage-counters
objects there.There’s a small challenge though: we cannot relocate existing documents to that index, as it would require a reindex migration, and that is currently not possible due to serverless constraints (no downtime).
Luckily, we have a couple of workarounds for that:
We can deprecate
usage-counters
SO type and use an alternative name, e.g.usage-counter
. The drawback is that we might lose half to 1 day worth of counted events during the upgrade.This seems like an acceptable trade off (see related thread).
Namespace type:
single
At the moment,
usage-counters
have a namespace typeagnostic
. In practice, this means that we are not storing any value for thenamespaces
property. Whilst this might be convenient for some general use cases, Dashboards++ requires per-namespace counting, e.g. how many visualizations did dashboard X have on workspace Y on the last 30 days?Now, this could be achieved by storing the namespace as one of the 2 different properties that shape the counters’ ids:
counterType, counterName
. But that means:namespaces
property that already exists for SOs.By changing the namespace type to
single
, we can leverage thenamespace
property and allow API users doing per-Space counting. Doing this change would usually require a reindexing migration, but switching to a dedicated index gives us an opportunity to make that change without reindexing.Counters that are currently workspace agnostic can be stored in the
default
namespace. Internally, the Saved Objects Repository omits thenamespace: string
property of the SO when using thedefault
namespace. For usage counters that are Space-aware, the API can provide a means to allow storing the desirednamespace
.Finally, in order to keep iso-functional, for Space-aware counters the
kibana_usage_collection
plugin will aggregate countings for eachnamespace
.Thus, from the Stack Telemetry standpoint, counters will be global.
Tasks
usage-counters
to a dedicated indexThe text was updated successfully, but these errors were encountered: