elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.71k stars 8.12k forks source link

[Telemetry] Improve telemetry_check failure message #97435

Closed Bamieh closed 1 month ago

Bamieh commented 3 years ago

Currently if the schema is missing from the json mapping files the telemtery_check tool shows an error like this:

ValidationError: The telemetry schemas in 'x-pack/plugins/telemetry_collection_xpack/schema/' are out-of-date, please update it as required: [stack_stats.kibana.plugins.maps.layerTypes]: definition for this key is missing. Received `{}`
    at ObjectType.validate (/dev/shm/workspace/parallel/18/kibana/packages/kbn-config-schema/src/types/type.ts:70:13)
    at assertTelemetryPayload (/dev/shm/workspace/parallel/18/kibana/test/api_integration/apis/telemetry/utils/schema_to_config_schema.ts:137:34)
    at Context.apply (test/api_integration/apis/telemetry/telemetry.ts:119:11)
    at Object.apply (/dev/shm/workspace/parallel/18/kibana/node_modules/@kbn/test/src/functional_test_runner/lib/mocha/wrap_function.js:73:30) {
  cause: SchemaTypeError: definition for this key is missing

We can improve this by:

  1. Remove the error stack from the message
  2. Show a link to the telemetry-tools docs
  3. Show collector file path that needs fixing.
  4. Show the command for auto fix node scripts/telemetry_check --fix
elasticmachine commented 3 years ago

Pinging @elastic/kibana-telemetry (Team:KibanaTelemetry)

elasticmachine commented 3 years ago

Pinging @elastic/kibana-core (Team:Core)

afharo commented 1 month ago

Do we need this? I can see a few places in the code where we already provide the recommendations (even as part of the error), and it's been a while since we haven't had any team reaching out asking what to do when the CI check fails.

It's probably clear enough now?

Tentatively closing it. Feel free to reopen if this is still an issue.