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

Refactor diagnostics into Feedback, replace ours with detsys-ids-client #1414

Merged
merged 5 commits into from
Feb 7, 2025

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Feb 7, 2025

This replaces the Diagnosticdata and pervasive feature-checking with a trait with a null implementation by default.

The null implementation is more ergonomic for a couple reasons

  1. needing to feature-check everywhere made it harder to write correct code for both cases.
  2. Option's can't be map()'d and other combinators with async closures.

This also introduces the possibility of feature flagging behavior. The feature flags come from the feedback provider, and the null version has none.

If you specify a --diagnostic-endpoint of file://.... the diagnostics are sent to that path. The format of this output has changed.
With a file endpoint, you can set the DETSYS_IDS_CHECKIN_FILE environment variable to a file to provide the feature flag data.

If you specify a --diagnostic-endpoint of an HTTP(S) address, the specific path is truncated and replaced with /check-in and /events/batch.

Note the default endpoint is now set to None, which means use the default backend. This is because the specific host used for diagnostics is identified using an SRV record for failover and traffic shaping purposes.

Overall, this change replaces the initial and ad-hoc IDS client with a crate dedicated to the task.

Description
Checklist
  • Formatted with cargo fmt
  • Built with nix build
  • Ran flake checks with nix flake check
  • Added or updated relevant tests (leave unchecked if not applicable)
  • Added or updated relevant documentation (leave unchecked if not applicable)
  • Linked to related issues (leave unchecked if not applicable)
Validating with install.determinate.systems

If a maintainer has added the upload to s3 label to this PR, it will become available for installation via install.determinate.systems:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/pr/$PR_NUMBER | sh -s -- install

@grahamc grahamc requested a review from cole-h February 7, 2025 00:43
@grahamc grahamc added the upload to s3 The labeled PR is allowed to upload its artifacts to S3 for easy testing label Feb 7, 2025
This replaces the Diagnosticdata and pervasive feature-checking with a trait with a null implementation by default.

The null implementation is more ergonomic for a couple reasons

1. needing to feature-check everywhere made it harder to write correct code for both cases.
2. Option's can't be map()'d and other combinators with async closures.

This also introduces the possibility of feature flagging behavior.
The feature flags come from the `feedback` provider, and the null version has none.

If you specify a `--diagnostic-endpoint` of `file://....` the diagnostics are sent to that path.
The format of this output has changed.
With a file endpoint, you can set the `DETSYS_IDS_CHECKIN_FILE` environment variable to a file to provide the feature flag data.

If you specify a `--diagnostic-endpoint` of an HTTP(S) address, the specific path is truncated and replaced with `/check-in` and `/events/batch`.

Note the default endpoint is now set to None, which means use the default backend.
This is because the specific host used for diagnostics is identified using an SRV record for failover and traffic shaping purposes.

Overall, this change replaces the initial and ad-hoc IDS client with a crate dedicated to the task.
@grahamc grahamc merged commit 18a6949 into main Feb 7, 2025
22 checks passed
@grahamc grahamc deleted the ids-client branch February 7, 2025 16:43
@cole-h cole-h added this to the 0.36.0 milestone Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upload to s3 The labeled PR is allowed to upload its artifacts to S3 for easy testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants