-
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
[Telemetry] Make telemetry
plugin non-disableable
#133205
Conversation
7f8c000
to
532f94a
Compare
532f94a
to
bd8bc03
Compare
[[telemetry-enabled]] `telemetry.enabled`:: | ||
Set to `true` to send cluster statistics to Elastic. Reporting your | ||
cluster statistics helps us improve your user experience. Your data is never | ||
shared with anyone. Set to `false` to disable statistics reporting from any | ||
browser connected to the {kib} instance. Defaults to `true`. |
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.
Removing documentation for telemetry.enabled
so users are not tempted to use it. Even when we are not "officially" deprecating them and it will work if they set it.
Is this OK?
"optionalPlugins": [ | ||
"telemetry" | ||
] |
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.
The workaround is no-longer needed 😇
import { plugin } from '.'; | ||
|
||
describe('kibana_usage_collection/public', () => { | ||
const pluginInstance = plugin(); | ||
|
||
describe('optIn fallback from telemetry', () => { | ||
test('should call optIn(false) when telemetry is disabled', () => { | ||
describe('EBT stats -> UI Counters', () => { |
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 didn't want to leave this test file empty, so I repurposed the tests to validate another piece of logic in the plugin.
(cfg) => { | ||
if (cfg.telemetry?.enabled === false) { | ||
return { | ||
set: [ | ||
{ path: 'telemetry.optIn', value: false }, | ||
{ path: 'telemetry.allowChangingOptInStatus', value: false }, | ||
], | ||
unset: [{ path: 'telemetry.enabled' }], | ||
}; | ||
} | ||
}, |
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.
Using a custom config deprecation provider to be able to set 2 values out of 1 and to avoid logging any deprecation warning (hence not showing the warning in the Upgrade Assistant).
Pinging @elastic/kibana-core (Team:Core) |
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.
Changes in expectedExposedConfigKeys
LGTM.
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
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.
Got a question, apart that LGTM
if (!telemetry) { | ||
// If the telemetry plugin is disabled, let's set optIn false to flush the queues. | ||
coreSetup.analytics.optIn({ global: { enabled: false } }); | ||
} |
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.
Shouldn't we base this on telemetry.optIn
now?
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.
This was a fallback to overcome that telemetry
was disabled and wouldn't call analytics.optIn(false)
so that EBT would stop holding the events until an optIn response was provided.
Since the telemetry
plugin cannot be disabled now, it will always call analytics.optIn(true|false)
so we don't need this workaround anymore.
if (!telemetry) { | ||
// If the telemetry plugin is disabled, let's set optIn false to flush the queues. | ||
coreSetup.analytics.optIn({ global: { enabled: false } }); | ||
} |
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.
Same question here?
Summary
Resolves #129015.
Some conversations around #129015 led to highlight the reasons for deprecating
telemetry.enabled: false
are purely technical and they shouldn't affect how the feature works from the users' POV.This PR internally converts
telemetry.enabled: false
totelemetry.optIn: false + telemetry.allowChangingOptInStatus: false
without actually disabling thetelemetry
plugin. Both flags should provide feature parity without disabling the plugin.Why do we not want to disable the plugin?
The reasoning is already explained in #129015, but the main reasons are:
optIn(false)
in EBT.Checklist
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
telemetry.enabled: false
telemetry.optIn: false
doesn't send any data to Elastic should address those concerns.POST /api/telemetry/v2/clusters/_stats
may generate a high loadFor maintainers