src/platform/plugins/shared/telemetry/schema/README.md
This list of .json files describes the format of the payloads sent to the Remote Telemetry Service. All the files should follow the schema convention as defined in the usage_collection plugin and @kbn/telemetry-tools, with the addition of the type pass_through. This additional type indicates Kibana sends the payload as-is from the output of an external ES query.
There are currently 4 files:
oss_root.json: Defines the schema for the payload from the root keys.oss_plugins.json: The schema for the content that will be nested in stack_stats.kibana.plugins.@kbn/telemetry-tools based on the schema property provided by all the registered Usage Collectors via the usageCollection.makeUsageCollector API.kbn_packages.json: Same as oss_plugins but for collectors defined in <ROOT_DIR>/packages/*.oss_platform.json: Same as oss_plugins but for collectors defined in <ROOT_DIR>/src/platform/*.NOTE: Despite its similarities to ES mappings, the intention of these files is not to define any index mappings. They should be considered as a tool to understand the format of the payload that will be sent when reporting telemetry to the Remote Service.
Functional tests are defined at x-pack/platform/test/api_integration/apis/telemetry/telemetry_local.ts. They merge all files and the x-pack counterparts, and validates the actual output of the telemetry endpoint against the final schema.