-
Notifications
You must be signed in to change notification settings - Fork 275
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
Conversation
@BrynCooke, please consider creating a changeset entry in |
CI performance tests
|
31d9fe1
to
db8a3c2
Compare
…ig and related code. This significantly simplifies the codebase. Part of #3226
db8a3c2
to
594b593
Compare
Previously prom was enabled by default? In addition, there was no need to guard committing new prometheus as it is internally guarded.
08aa535
to
c001c5e
Compare
d001927
to
61b41cb
Compare
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.
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")] |
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.
Is it still an Option in schemars? I find that odd anyway with a default, but that was already there I guess...
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.
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.
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.
Please raise that issue.
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.
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.
Exceptions
Note any exceptions here
Notes
Footnotes
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. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩