Skip to content
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] Add telemetry.sendUsageTo config #107396

Merged
merged 10 commits into from
Aug 5, 2021

Conversation

Bamieh
Copy link
Member

@Bamieh Bamieh commented Aug 2, 2021

Draft until CI passes and I self-review the code.

  • Add telemetry.sendUsageTo: staging | prod to allow specifying which telemetry endpoint the cluster should be reporting to. This is only needed for testing clusters and other internal Elastic uses cases.

Deprecation notice will appear in addition to automatically updating telemetry.sendUsageTo if the url is pointing to staging.

  • Deprecate telemetry.url.
  • Deprecate telemetry.optInStatusUrl.
  • Update all telemetry related code to use the new getTelemetryChannelEndpoint common function. This is inline with the other config getters we have in the common file.
  • Added unit tests and updated relevant test files.
  • Updated functional test configs to use the new config flag.

Closes #96761

@Bamieh Bamieh added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed v7.15.0 labels Aug 2, 2021
@Bamieh Bamieh marked this pull request as ready for review August 5, 2021 12:17
@Bamieh Bamieh requested review from a team as code owners August 5, 2021 12:17
Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I just added 2 NITs as potential improvements.


it('sets "telemetryConfig.sendUsageTo: prod" if "telemetry.url" uses the non-staging endpoint', () => {
const rawConfig = createMockRawConfig({
url: 'random-endpoint',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: should we add a warning in this case?

Something like Dismissing random-endpoint, and using Elastic's production URL.

statsGetterConfig
).catch((err) => {
// The server is likely behind a firewall and can't reach the remote service
logger.warn(
`Failed to notify "${optInStatusUrl}" from the server about the opt-in selection. Possibly blocked by a firewall? - Error: ${err.message}`
`Failed to notify the telemetry endpoint about the opt-in selection. Possibly blocked by a firewall? - Error: ${err.message}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: I'd detail the URL here. If an admin finds this message annoying, they have the details in the error to fix the firewall rules.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is shown first this in the err payload so I removed it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! In that case, please dismiss the comment :)

@kibanamachine
Copy link
Contributor

⏳ Build in-progress, with failures

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Telemetry] Deprecate telemetry url configs
4 participants