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

feat: [plugins/prometheus] allow to skip request or phases for a metric #3489

Merged
merged 14 commits into from
Nov 26, 2024

Conversation

EmrysMyrddin
Copy link
Collaborator

@EmrysMyrddin EmrysMyrddin commented Nov 12, 2024

Allow to explicitly control which events and timing should be observe.

This PR remove unnecessary hooks if possible, and adds the ability to skip the observation of a request.

This is an upstream Envelop feature.

On Yoga, selecting phases doesn't much sense. Perhaps we should add a "mandatory phases" in Envelop to handle those cases.

If it's also needed for the Mesh variant, we can introduce this additional concept, otherwise, we can just let it like this.

Copy link

changeset-bot bot commented Nov 12, 2024

🦋 Changeset detected

Latest commit: 263a8b2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphql-yoga/plugin-prometheus Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Nov 12, 2024

✅ Benchmark Results

     ✓ no_errors{mode:graphql}
     ✓ expected_result{mode:graphql}
     ✓ no_errors{mode:graphql-jit}
     ✓ expected_result{mode:graphql-jit}
     ✓ no_errors{mode:graphql-response-cache}
     ✓ expected_result{mode:graphql-response-cache}
     ✓ no_errors{mode:graphql-no-parse-validate-cache}
     ✓ expected_result{mode:graphql-no-parse-validate-cache}
     ✓ no_errors{mode:uws}
     ✓ expected_result{mode:uws}

     checks.......................................: 100.00% ✓ 526372      ✗ 0     
     data_received................................: 2.1 GB  14 MB/s
     data_sent....................................: 106 MB  705 kB/s
     http_req_blocked.............................: avg=1.45µs   min=952ns    med=1.3µs    max=293.98µs p(90)=1.95µs   p(95)=2.15µs  
     http_req_connecting..........................: avg=2ns      min=0s       med=0s       max=152.07µs p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=357.93µs min=214.31µs med=321.4µs  max=23.64ms  p(90)=462.18µs p(95)=482.54µs
       { expected_response:true }.................: avg=357.93µs min=214.31µs med=321.4µs  max=23.64ms  p(90)=462.18µs p(95)=482.54µs
     ✓ { mode:graphql-jit }.......................: avg=288.14µs min=214.31µs med=266.39µs max=23.64ms  p(90)=297.53µs p(95)=313.3µs 
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=495.64µs min=403.1µs  med=465.16µs max=10.03ms  p(90)=504.99µs p(95)=539.68µs
     ✓ { mode:graphql-response-cache }............: avg=342.39µs min=268.94µs med=323.7µs  max=6.43ms   p(90)=353.86µs p(95)=365.27µs
     ✓ { mode:graphql }...........................: avg=358.13µs min=267.19µs med=325.04µs max=13.78ms  p(90)=375.55µs p(95)=422.89µs
     ✓ { mode:uws }...............................: avg=344.2µs  min=266.44µs med=322.48µs max=9.34ms   p(90)=355.79µs p(95)=373.24µs
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 263186
     http_req_receiving...........................: avg=33.22µs  min=16.75µs  med=33.16µs  max=7.25ms   p(90)=38.89µs  p(95)=41.02µs 
     http_req_sending.............................: avg=8.17µs   min=5.86µs   med=7.19µs   max=5.36ms   p(90)=10.72µs  p(95)=11.55µs 
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=316.53µs min=184.82µs med=281.12µs max=23.53ms  p(90)=419.33µs p(95)=437.21µs
     http_reqs....................................: 263186  1754.551773/s
     iteration_duration...........................: avg=565.14µs min=387.1µs  med=525.75µs max=24.12ms  p(90)=675.93µs p(95)=700.7µs 
     iterations...................................: 263186  1754.551773/s
     vus..........................................: 1       min=1         max=1   
     vus_max......................................: 2       min=2         max=2   

Copy link
Contributor

github-actions bot commented Nov 12, 2024

💻 Website Preview

The latest changes are available as preview in: https://b65e93b3.graphql-yoga.pages.dev

Copy link
Contributor

github-actions bot commented Nov 12, 2024

Apollo Federation Subgraph Compatibility Results

Federation 1 Support Federation 2 Support
_service🟢
@key (single)🟢
@key (multi)🟢
@key (composite)🟢
repeatable @key🟢
@requires🟢
@provides🟢
federated tracing🟢
@link🟢
@shareable🟢
@tag🟢
@override🟢
@inaccessible🟢
@composeDirective🟢
@interfaceObject🟢

Learn more:

@EmrysMyrddin EmrysMyrddin force-pushed the feat/prometheus/skip-request branch from e97d38f to eead95a Compare November 22, 2024 10:22
@EmrysMyrddin EmrysMyrddin force-pushed the feat/prometheus/skip-request branch from e0eecf6 to 7688f04 Compare November 26, 2024 13:59
@EmrysMyrddin EmrysMyrddin merged commit 131dfa3 into main Nov 26, 2024
35 checks passed
@EmrysMyrddin EmrysMyrddin deleted the feat/prometheus/skip-request branch November 26, 2024 18:11
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