Skip to content

Commit 0f45381

Browse files
[Usage collection] Collect non-default kibana configs (elastic#97368)
Co-authored-by: Kibana Machine <[email protected]>
1 parent db7f279 commit 0f45381

31 files changed

+1026
-27
lines changed

.telemetryrc.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
{
33
"output": "src/plugins/telemetry/schema/oss_plugins.json",
44
"root": "src/plugins/",
5-
"exclude": []
5+
"exclude": [
6+
"src/plugins/kibana_usage_collection/server/collectors/config_usage/register_config_usage_collector.ts"
7+
]
68
}
79
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [MakeUsageFromSchema](./kibana-plugin-core-server.makeusagefromschema.md)
4+
5+
## MakeUsageFromSchema type
6+
7+
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\].
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export declare type MakeUsageFromSchema<T> = {
13+
[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;
14+
};
15+
```

docs/development/core/server/kibana-plugin-core-server.md

+1
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
272272
| [LegacyElasticsearchClientConfig](./kibana-plugin-core-server.legacyelasticsearchclientconfig.md) | |
273273
| [LifecycleResponseFactory](./kibana-plugin-core-server.lifecycleresponsefactory.md) | Creates an object containing redirection or error response with error details, HTTP headers, and other data transmitted to the client. |
274274
| [LoggerConfigType](./kibana-plugin-core-server.loggerconfigtype.md) | |
275+
| [MakeUsageFromSchema](./kibana-plugin-core-server.makeusagefromschema.md) | List of configuration values that will be exposed to usage collection. If parent node or actual config path is set to <code>true</code> then the actual value of these configs will be reoprted. If parent node or actual config path is set to <code>false</code> then the config will be reported as \[redacted\]. |
275276
| [MetricsServiceStart](./kibana-plugin-core-server.metricsservicestart.md) | APIs to retrieves metrics gathered and exposed by the core platform. |
276277
| [MIGRATION\_ASSISTANCE\_INDEX\_ACTION](./kibana-plugin-core-server.migration_assistance_index_action.md) | |
277278
| [MIGRATION\_DEPRECATION\_LEVEL](./kibana-plugin-core-server.migration_deprecation_level.md) | |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [PluginConfigDescriptor](./kibana-plugin-core-server.pluginconfigdescriptor.md) &gt; [exposeToUsage](./kibana-plugin-core-server.pluginconfigdescriptor.exposetousage.md)
4+
5+
## PluginConfigDescriptor.exposeToUsage property
6+
7+
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\].
8+
9+
All changed configs except booleans and numbers will be reported as \[redacted\] unless otherwise specified.
10+
11+
[MakeUsageFromSchema](./kibana-plugin-core-server.makeusagefromschema.md)
12+
13+
<b>Signature:</b>
14+
15+
```typescript
16+
exposeToUsage?: MakeUsageFromSchema<T>;
17+
```

docs/development/core/server/kibana-plugin-core-server.pluginconfigdescriptor.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@ export const config: PluginConfigDescriptor<ConfigType> = {
4646
| --- | --- | --- |
4747
| [deprecations](./kibana-plugin-core-server.pluginconfigdescriptor.deprecations.md) | <code>ConfigDeprecationProvider</code> | Provider for the to apply to the plugin configuration. |
4848
| [exposeToBrowser](./kibana-plugin-core-server.pluginconfigdescriptor.exposetobrowser.md) | <code>{</code><br/><code> [P in keyof T]?: boolean;</code><br/><code> }</code> | List of configuration properties that will be available on the client-side plugin. |
49+
| [exposeToUsage](./kibana-plugin-core-server.pluginconfigdescriptor.exposetousage.md) | <code>MakeUsageFromSchema&lt;T&gt;</code> | Expose non-default configs to usage collection to be sent via telemetry. set a config to <code>true</code> to report the actual changed config value. set a config to <code>false</code> 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) |
4950
| [schema](./kibana-plugin-core-server.pluginconfigdescriptor.schema.md) | <code>PluginConfigSchema&lt;T&gt;</code> | Schema to use to validate the plugin configuration.[PluginConfigSchema](./kibana-plugin-core-server.pluginconfigschema.md) |
5051

src/core/server/core_usage_data/core_usage_data_service.mock.ts

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ const createStartContractMock = () => {
139139
},
140140
})
141141
),
142+
getConfigsUsageData: jest.fn(),
142143
};
143144

144145
return startContract;

0 commit comments

Comments
 (0)