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

enhancement(config api): Add graphql field to toggle graphql endpoint #19645

Merged

Conversation

sebastiantia
Copy link
Contributor

No description provided.

Copy link

Your preview site for the Rust Doc will be ready in a few minutes, please allow time for it to build.

Heres your preview link:
Rust Doc preview

Copy link

Your preview site for the VRL Playground will be ready in a few minutes, please allow time for it to build.

Heres your preview link:
VRL Playground preview

Copy link

Your preview site for the vector.dev will be ready in a few minutes, please allow time for it to build.

Heres your preview link:
vector.dev preview

src/api/server.rs Outdated Show resolved Hide resolved
@github-actions github-actions bot added the domain: external docs Anything related to Vector's external, public documentation label Jan 18, 2024
@sebastiantia sebastiantia requested a review from bruceg January 18, 2024 18:16
@sebastiantia sebastiantia marked this pull request as ready for review January 18, 2024 18:19
@sebastiantia sebastiantia requested review from a team as code owners January 18, 2024 18:19
@sebastiantia sebastiantia requested a review from a team January 18, 2024 18:19
@datadog-vectordotdev
Copy link

datadog-vectordotdev bot commented Jan 18, 2024

Datadog Report

Branch report: sebtia/OPW-195_graphql-field-to-toggle-graphql-endpoint
Commit report: d6712b7
Test service: vector

✅ 0 Failed, 2094 Passed, 0 Skipped, 1m 24.82s Wall Time

@sebastiantia
Copy link
Contributor Author

Datadog Report

Branch report: sebtia/OPW-195_graphql-field-to-toggle-graphql-endpoint Commit report: 5577362 Test service: vector

❌ 1 Failed (0 Known Flaky), 2092 Passed, 0 Skipped, 1m 24.66s Wall Time

❌ Failed Tests (1)

  • config::builder::tests::version_hash_match - vector - Details

    Expand for error

     thread 'config::builder::tests::version_hash_match' panicked at src/config/builder.rs:481:9:
     assertion \`left == right\` failed
       left: "6c98bea9d9e2f3133e2d39ba04592d17f96340a9bc4c8d697b09f5af388a76bd"
      right: "9bc035fa506e00403e479451dc8bf1e566a44f7ac83ccde349bd6c5a9bd18384"
     stack backtrace:
        0:     0x56285d2017fc - std::backtrace_rs::backtrace::libunwind::trace::ha637c64ce894333a
                                    at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
        1:     0x56285d2017fc - std::backtrace_rs::backtrace::trace_unsynchronized::h47f62dea28e0c88d
                                    at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
        2:     0x56285d2017fc - std::sys_common::backtrace::_print_fmt::h9eef0abe20ede486
     ...
    

investigating...

Copy link
Member

@bruceg bruceg left a comment

Choose a reason for hiding this comment

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

Mostly wording changes, no function changes suggested.

changelog.d/graphql_endpoint_toggle.enhancement.md Outdated Show resolved Hide resolved
changelog.d/graphql_endpoint_toggle.enhancement.md Outdated Show resolved Hide resolved
website/cue/reference/api.cue Outdated Show resolved Hide resolved
src/api/server.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@aliciascott aliciascott left a comment

Choose a reason for hiding this comment

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

looks good for docs

@@ -473,7 +473,7 @@ mod tests {
/// the `ConfigBuilder` has changed what it serializes, or the implementation of `serde_json` has changed.
/// If this test fails, we should ideally be able to fix so that the original hash passes!
fn version_hash_match() {
let expected_hash = "6c98bea9d9e2f3133e2d39ba04592d17f96340a9bc4c8d697b09f5af388a76bd";
let expected_hash = "9bc035fa506e00403e479451dc8bf1e566a44f7ac83ccde349bd6c5a9bd18384";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we have now added a new field to api which is a field of theConfigBuilder struct, the serialization of the ConfigBuilder results in a different hash. I have not yet found a way to remove the added graphql field from the serialization without composing a replica without the graphql field. Input would be greatly appreciated!

Copy link
Member

Choose a reason for hiding this comment

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

Ah, yes, I saw this too. You'll need to add a #[serde(skip_serializing_if = "…")] notation to the new field.

src/api/server.rs Outdated Show resolved Hide resolved
@@ -473,7 +473,7 @@ mod tests {
/// the `ConfigBuilder` has changed what it serializes, or the implementation of `serde_json` has changed.
/// If this test fails, we should ideally be able to fix so that the original hash passes!
fn version_hash_match() {
let expected_hash = "6c98bea9d9e2f3133e2d39ba04592d17f96340a9bc4c8d697b09f5af388a76bd";
let expected_hash = "9bc035fa506e00403e479451dc8bf1e566a44f7ac83ccde349bd6c5a9bd18384";
Copy link
Member

Choose a reason for hiding this comment

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

Ah, yes, I saw this too. You'll need to add a #[serde(skip_serializing_if = "…")] notation to the new field.

@@ -19,6 +19,10 @@ pub struct Options {
/// Whether or not to expose the GraphQL playground on the API endpoint.
#[serde(default = "default_playground")]
pub playground: bool,

/// Whether or not the GraphQL endpoint is enabled
#[serde(default = "default_graphql")]
Copy link
Member

Choose a reason for hiding this comment

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

Since this default is not the type-level default, and we depend on that not being changing the serialized form, this needs an additional attribute:

Suggested change
#[serde(default = "default_graphql")]
#[serde(default = "default_graphql", skip_serializing_if = "is_true")]

along with an additional function of:

fn is_true(field: &bool) -> bool {
    *field
}

(Normally, you could use just #[serde(skip_serializing_if = "vector_lib::serde::is_default")], but that only works if the default value is the type default, which here it is not. See also https://serde.rs/field-attrs.html#skip_serializing_if

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesome, thanks for the detail! Not super familiar with the serde framework so I appreciate the help!

@sebastiantia sebastiantia added this pull request to the merge queue Jan 22, 2024
Copy link

Regression Detector Results

Run ID: 6fbe62cd-42b5-4190-b573-95bbfe652288
Baseline: 8283217
Comparison: fe0609b
Total CPUs: 7

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

No significant changes in experiment optimization goals

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI
file_to_blackhole egress throughput +2.72 [+0.29, +5.15]
datadog_agent_remap_blackhole_acks ingress throughput +2.35 [+2.24, +2.46]
datadog_agent_remap_blackhole ingress throughput +1.08 [+0.98, +1.17]
http_elasticsearch ingress throughput +1.03 [+0.96, +1.09]
datadog_agent_remap_datadog_logs ingress throughput +0.91 [+0.81, +1.01]
syslog_log2metric_tag_cardinality_limit_blackhole ingress throughput +0.73 [+0.61, +0.85]
fluent_elasticsearch ingress throughput +0.72 [+0.25, +1.19]
datadog_agent_remap_datadog_logs_acks ingress throughput +0.56 [+0.47, +0.65]
http_to_http_noack ingress throughput +0.19 [+0.10, +0.29]
http_to_s3 ingress throughput +0.15 [-0.13, +0.43]
syslog_splunk_hec_logs ingress throughput +0.10 [+0.03, +0.18]
http_to_http_json ingress throughput +0.02 [-0.05, +0.09]
splunk_hec_indexer_ack_blackhole ingress throughput -0.00 [-0.14, +0.14]
splunk_hec_to_splunk_hec_logs_acks ingress throughput -0.00 [-0.16, +0.16]
http_text_to_http_json ingress throughput -0.01 [-0.13, +0.11]
splunk_hec_to_splunk_hec_logs_noack ingress throughput -0.05 [-0.16, +0.07]
enterprise_http_to_http ingress throughput -0.14 [-0.22, -0.07]
http_to_http_acks ingress throughput -0.25 [-1.55, +1.05]
otlp_grpc_to_blackhole ingress throughput -0.58 [-0.67, -0.50]
syslog_log2metric_splunk_hec_metrics ingress throughput -0.67 [-0.80, -0.54]
syslog_loki ingress throughput -0.73 [-0.78, -0.69]
syslog_regex_logs2metric_ddmetrics ingress throughput -0.78 [-0.92, -0.64]
syslog_log2metric_humio_metrics ingress throughput -0.85 [-0.99, -0.71]
splunk_hec_route_s3 ingress throughput -1.07 [-1.57, -0.57]
syslog_humio_logs ingress throughput -1.10 [-1.20, -1.00]
socket_to_socket_blackhole ingress throughput -2.83 [-2.88, -2.77]
otlp_http_to_blackhole ingress throughput -2.95 [-3.10, -2.81]

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

Copy link

Regression Detector Results

Run ID: 9a3af95f-c7d7-4adf-92cb-0d9e037e8c9e
Baseline: c119951
Comparison: 276e862
Total CPUs: 7

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

No significant changes in experiment optimization goals

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI
file_to_blackhole egress throughput +2.95 [+0.36, +5.53]
http_elasticsearch ingress throughput +1.76 [+1.69, +1.82]
http_to_http_acks ingress throughput +0.98 [-0.34, +2.31]
datadog_agent_remap_datadog_logs_acks ingress throughput +0.72 [+0.63, +0.81]
otlp_grpc_to_blackhole ingress throughput +0.68 [+0.59, +0.77]
syslog_log2metric_tag_cardinality_limit_blackhole ingress throughput +0.66 [+0.52, +0.81]
syslog_loki ingress throughput +0.63 [+0.57, +0.70]
datadog_agent_remap_datadog_logs ingress throughput +0.57 [+0.47, +0.68]
http_to_s3 ingress throughput +0.17 [-0.11, +0.45]
http_to_http_noack ingress throughput +0.15 [+0.08, +0.22]
http_to_http_json ingress throughput +0.04 [-0.04, +0.11]
splunk_hec_to_splunk_hec_logs_acks ingress throughput -0.00 [-0.16, +0.16]
splunk_hec_indexer_ack_blackhole ingress throughput -0.00 [-0.15, +0.14]
enterprise_http_to_http ingress throughput -0.02 [-0.08, +0.03]
splunk_hec_to_splunk_hec_logs_noack ingress throughput -0.06 [-0.17, +0.05]
syslog_log2metric_splunk_hec_metrics ingress throughput -0.16 [-0.29, -0.02]
datadog_agent_remap_blackhole_acks ingress throughput -0.34 [-0.44, -0.23]
syslog_log2metric_humio_metrics ingress throughput -0.38 [-0.50, -0.26]
syslog_humio_logs ingress throughput -1.04 [-1.14, -0.95]
syslog_splunk_hec_logs ingress throughput -1.46 [-1.54, -1.39]
syslog_regex_logs2metric_ddmetrics ingress throughput -1.54 [-1.65, -1.43]
fluent_elasticsearch ingress throughput -1.78 [-2.25, -1.32]
datadog_agent_remap_blackhole ingress throughput -1.85 [-1.93, -1.76]
http_text_to_http_json ingress throughput -1.85 [-1.98, -1.73]
socket_to_socket_blackhole ingress throughput -3.14 [-3.21, -3.08]
splunk_hec_route_s3 ingress throughput -3.35 [-3.85, -2.86]
otlp_http_to_blackhole ingress throughput -4.18 [-4.33, -4.03]

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 22, 2024
@sebastiantia sebastiantia added this pull request to the merge queue Jan 22, 2024
Copy link

Regression Detector Results

Run ID: 077f9a7f-c54f-484a-bb85-a7eaa5f2a75b
Baseline: a457f89
Comparison: 6d79780
Total CPUs: 7

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

No significant changes in experiment optimization goals

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI
fluent_elasticsearch ingress throughput +2.81 [+2.32, +3.29]
http_to_http_acks ingress throughput +1.93 [+0.60, +3.26]
syslog_log2metric_humio_metrics ingress throughput +1.65 [+1.51, +1.80]
datadog_agent_remap_blackhole ingress throughput +0.99 [+0.88, +1.09]
syslog_humio_logs ingress throughput +0.94 [+0.84, +1.05]
syslog_loki ingress throughput +0.90 [+0.84, +0.96]
syslog_log2metric_splunk_hec_metrics ingress throughput +0.87 [+0.73, +1.02]
splunk_hec_route_s3 ingress throughput +0.59 [+0.10, +1.09]
datadog_agent_remap_datadog_logs_acks ingress throughput +0.56 [+0.48, +0.64]
datadog_agent_remap_blackhole_acks ingress throughput +0.39 [+0.29, +0.50]
http_elasticsearch ingress throughput +0.38 [+0.31, +0.45]
otlp_grpc_to_blackhole ingress throughput +0.32 [+0.23, +0.41]
http_to_http_noack ingress throughput +0.18 [+0.09, +0.27]
syslog_splunk_hec_logs ingress throughput +0.17 [+0.11, +0.23]
datadog_agent_remap_datadog_logs ingress throughput +0.15 [+0.06, +0.24]
http_to_s3 ingress throughput +0.09 [-0.19, +0.37]
file_to_blackhole egress throughput +0.08 [-2.33, +2.50]
http_to_http_json ingress throughput +0.05 [-0.03, +0.13]
splunk_hec_indexer_ack_blackhole ingress throughput +0.01 [-0.14, +0.15]
splunk_hec_to_splunk_hec_logs_acks ingress throughput -0.00 [-0.15, +0.15]
splunk_hec_to_splunk_hec_logs_noack ingress throughput -0.02 [-0.13, +0.10]
socket_to_socket_blackhole ingress throughput -0.08 [-0.14, -0.02]
enterprise_http_to_http ingress throughput -0.13 [-0.21, -0.06]
syslog_log2metric_tag_cardinality_limit_blackhole ingress throughput -0.70 [-0.83, -0.57]
http_text_to_http_json ingress throughput -0.92 [-1.04, -0.79]
otlp_http_to_blackhole ingress throughput -1.49 [-1.63, -1.35]
syslog_regex_logs2metric_ddmetrics ingress throughput -1.94 [-2.07, -1.80]

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

Copy link

Regression Detector Results

Run ID: eb58f0ce-6a33-40e1-b91f-be3a963e92bc
Baseline: f41ca86
Comparison: 5bb4926
Total CPUs: 7

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

No significant changes in experiment optimization goals

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI
fluent_elasticsearch ingress throughput +2.53 [+2.04, +3.02]
syslog_regex_logs2metric_ddmetrics ingress throughput +2.42 [+2.31, +2.52]
datadog_agent_remap_blackhole ingress throughput +1.90 [+1.82, +1.99]
syslog_log2metric_tag_cardinality_limit_blackhole ingress throughput +1.57 [+1.44, +1.70]
syslog_humio_logs ingress throughput +1.42 [+1.32, +1.52]
datadog_agent_remap_datadog_logs ingress throughput +0.39 [+0.30, +0.49]
http_elasticsearch ingress throughput +0.34 [+0.27, +0.41]
splunk_hec_route_s3 ingress throughput +0.33 [-0.16, +0.83]
syslog_log2metric_splunk_hec_metrics ingress throughput +0.21 [+0.07, +0.35]
http_to_http_noack ingress throughput +0.17 [+0.07, +0.27]
http_to_http_json ingress throughput +0.03 [-0.04, +0.11]
socket_to_socket_blackhole ingress throughput +0.03 [-0.04, +0.10]
splunk_hec_indexer_ack_blackhole ingress throughput +0.01 [-0.14, +0.15]
splunk_hec_to_splunk_hec_logs_acks ingress throughput -0.00 [-0.16, +0.16]
datadog_agent_remap_datadog_logs_acks ingress throughput -0.00 [-0.08, +0.08]
splunk_hec_to_splunk_hec_logs_noack ingress throughput -0.03 [-0.14, +0.08]
syslog_splunk_hec_logs ingress throughput -0.10 [-0.17, -0.04]
enterprise_http_to_http ingress throughput -0.11 [-0.17, -0.05]
datadog_agent_remap_blackhole_acks ingress throughput -0.11 [-0.21, -0.01]
file_to_blackhole egress throughput -0.24 [-2.80, +2.33]
otlp_grpc_to_blackhole ingress throughput -0.28 [-0.37, -0.20]
http_to_s3 ingress throughput -0.28 [-0.57, -0.00]
http_to_http_acks ingress throughput -0.77 [-2.08, +0.53]
syslog_loki ingress throughput -0.86 [-0.92, -0.80]
otlp_http_to_blackhole ingress throughput -1.48 [-1.62, -1.34]
http_text_to_http_json ingress throughput -1.52 [-1.63, -1.41]
syslog_log2metric_humio_metrics ingress throughput -1.98 [-2.11, -1.86]

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

Merged via the queue into master with commit 5bb4926 Jan 23, 2024
41 checks passed
@sebastiantia sebastiantia deleted the sebtia/OPW-195_graphql-field-to-toggle-graphql-endpoint branch January 23, 2024 03:54
@sebastiantia sebastiantia restored the sebtia/OPW-195_graphql-field-to-toggle-graphql-endpoint branch January 23, 2024 16:21
sebastiantia added a commit that referenced this pull request Jan 23, 2024
…nt (#19645)

* OPW-195

* knit: param change

* docs

* trailing whitespaces

* rustfmt

* docs and test fix

* serialization skip for new field & typing

* passby clippy

* spacing

* nit
AndrooTheChen pushed a commit to discord/vector that referenced this pull request Sep 23, 2024
…nt (vectordotdev#19645)

* OPW-195

* knit: param change

* docs

* trailing whitespaces

* rustfmt

* docs and test fix

* serialization skip for new field & typing

* passby clippy

* spacing

* nit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: external docs Anything related to Vector's external, public documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants