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

Remove the use of Option in telemetry code #3968

Merged
merged 8 commits into from
Oct 6, 2023

Conversation

BrynCooke
Copy link
Contributor

@BrynCooke BrynCooke commented Oct 4, 2023

Removed the use of Option in config and related consuming code. This significantly simplifies the codebase.

This isn't nearly as scary as it looks, as each code change is mostly just the removal of dealing with optional values.

Going forward we should use Option as a last resort in config structures, and instead prefer using defaults.

Part of #3226


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Tests added and passing3
    • Unit Tests
    • Integration Tests
    • Manual Tests

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

@BrynCooke, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

@router-perf
Copy link

router-perf bot commented Oct 4, 2023

CI performance tests

  • events_big_cap_high_rate - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity
  • events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
  • events - Stress test for events with a lot of users and deduplication ENABLED
  • large-request - Stress test with a 1 MB request payload
  • step - Basic stress test that steps up the number of users over time
  • xlarge-request - Stress test with 10 MB request payload
  • reload - Reload test over a long period of time at a constant rate of users
  • no-graphos - Basic stress test, no GraphOS.
  • xxlarge-request - Stress test with 100 MB request payload
  • step-jemalloc-tuning - Clone of the basic stress test for jemalloc tuning
  • const - Basic stress test that runs with a constant number of users

@BrynCooke BrynCooke force-pushed the bryn/remove-telemetry-option branch from 31d9fe1 to db8a3c2 Compare October 4, 2023 11:36
…ig and related code. This significantly simplifies the codebase.

 Part of #3226
@BrynCooke BrynCooke force-pushed the bryn/remove-telemetry-option branch from db8a3c2 to 594b593 Compare October 4, 2023 12:58
@BrynCooke BrynCooke changed the title Remove the use of Option telemetry code Remove the use of Option in telemetry code Oct 4, 2023
Previously prom was enabled by default?
In addition, there was no need to guard committing new prometheus as it is internally guarded.
@BrynCooke BrynCooke force-pushed the bryn/remove-telemetry-option branch from 08aa535 to c001c5e Compare October 5, 2023 10:02
@BrynCooke BrynCooke requested review from a team, Geal, lrlna, o0Ignition0o and bnjjj October 5, 2023 10:21
@BrynCooke BrynCooke force-pushed the bryn/remove-telemetry-option branch from d001927 to 61b41cb Compare October 5, 2023 15:58
@BrynCooke BrynCooke requested a review from garypen October 6, 2023 10:43
Copy link
Contributor

@garypen garypen left a comment

Choose a reason for hiding this comment

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

Nice cleanup. I have a few questions.

pub(crate) apollo_key: Option<String>,

/// The Apollo Studio graph reference.
#[schemars(skip)]
#[serde(skip)]
#[serde(default = "apollo_graph_reference")]
pub(crate) apollo_graph_ref: Option<String>,

/// The name of the header to extract from requests when populating 'client nane' for traces and metrics in Apollo Studio.
#[schemars(with = "Option<String>", default = "client_name_header_default_str")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it still an Option in schemars? I find that odd anyway with a default, but that was already there I guess...

Copy link
Contributor Author

@BrynCooke BrynCooke Oct 6, 2023

Choose a reason for hiding this comment

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

It won't have been listed in schemars as it was previously serde skip. I think we should follow up with a way of passing in apollo_key and apollo_graph ref in plugin init rather than config.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please raise that issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

apollo-router/src/plugins/telemetry/apollo.rs Show resolved Hide resolved
apollo-router/src/plugins/telemetry/apollo.rs Show resolved Hide resolved
apollo-router/src/plugins/telemetry/config.rs Outdated Show resolved Hide resolved
@BrynCooke BrynCooke requested a review from garypen October 6, 2023 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants