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
[Usage collection] Collect non-default kibana configs #97368
Merged
Bamieh
merged 17 commits into
elastic:master
from
Bamieh:usage_collection/changed_config
Apr 20, 2021
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
18356ef
config usage service + collector
Bamieh e98a5fe
merge master + exclude schema
Bamieh 50d8ef0
add more tests
Bamieh de4c161
add api_integration tests
Bamieh 115736f
type check + docs
Bamieh 57d39eb
update snapshots
Bamieh 545412f
fix spacing
Bamieh bca8b7e
fix x-pack tests
Bamieh 466f4eb
Merge branch 'master' into usage_collection/changed_config
kibanamachine 365154c
Merge branch 'master' into usage_collection/changed_config
kibanamachine 0f1a3ae
Merge branch 'master' into usage_collection/changed_config
kibanamachine 6790635
Merge branch 'master' of github.com:elastic/kibana into usage_collect…
Bamieh 9fd517f
core review fixes
Bamieh 3c32db0
Merge branch 'master' of github.com:elastic/kibana into usage_collect…
Bamieh a324d29
update docs
Bamieh 46e3c43
type check
Bamieh c3a3e11
fix integration tests unit tests :sweat_smile:
Bamieh File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
docs/development/core/server/kibana-plugin-core-server.makeusagefromschema.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [MakeUsageFromSchema](./kibana-plugin-core-server.makeusagefromschema.md) | ||
|
||
## MakeUsageFromSchema type | ||
|
||
List of configuration values that will be exposed to usage collection. If parent node or actual config path is set to `true` then the actual value of these configs will be reoprted. If parent node or actual config path is set to `false` then the config will be reported as \[redacted\]. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare type MakeUsageFromSchema<T> = { | ||
[Key in keyof T]?: T[Key] extends Maybe<object[]> ? false : T[Key] extends Maybe<any[]> ? boolean : T[Key] extends Maybe<object> ? MakeUsageFromSchema<T[Key]> | boolean : boolean; | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...t/core/server/kibana-plugin-core-server.pluginconfigdescriptor.exposetousage.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [PluginConfigDescriptor](./kibana-plugin-core-server.pluginconfigdescriptor.md) > [exposeToUsage](./kibana-plugin-core-server.pluginconfigdescriptor.exposetousage.md) | ||
|
||
## PluginConfigDescriptor.exposeToUsage property | ||
|
||
Expose non-default configs to usage collection to be sent via telemetry. set a config to `true` to report the actual changed config value. set a config to `false` to report the changed config value as \[redacted\]. | ||
|
||
All changed configs except booleans and numbers will be reported as \[redacted\] unless otherwise specified. | ||
|
||
[MakeUsageFromSchema](./kibana-plugin-core-server.makeusagefromschema.md) | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
exposeToUsage?: MakeUsageFromSchema<T>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was that necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opened a follow up issue here: #97599.
TLDR;
Explicitly typing every config in the schema is not practical. We'll be experimenting with
flattened_type
ES type and runtime fields to query this collector. Both are not yet supported by the collectionschema
types.If we had to explicitly specify every kibana config in the schema we'd need to improve our telemetry tooling to automatically do this for devs. Although
flattened_type
seems promising enough for this use case.