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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

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: 6a615dc

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% ✓ 517112      ✗ 0     
     data_received................................: 2.1 GB  14 MB/s
     data_sent....................................: 104 MB  693 kB/s
     http_req_blocked.............................: avg=1.49µs   min=952ns    med=1.32µs   max=293µs    p(90)=1.97µs   p(95)=2.17µs  
     http_req_connecting..........................: avg=2ns      min=0s       med=0s       max=132.04µs p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=364.98µs min=217.99µs med=328.33µs max=15.11ms  p(90)=463.53µs p(95)=487.19µs
       { expected_response:true }.................: avg=364.98µs min=217.99µs med=328.33µs max=15.11ms  p(90)=463.53µs p(95)=487.19µs
     ✓ { mode:graphql-jit }.......................: avg=294.53µs min=217.99µs med=271.5µs  max=15.11ms  p(90)=303.45µs p(95)=320.56µs
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=493.58µs min=396.49µs med=464.4µs  max=10.66ms  p(90)=510.94µs p(95)=545.65µs
     ✓ { mode:graphql-response-cache }............: avg=348.83µs min=268.67µs med=329.03µs max=6.39ms   p(90)=360.22µs p(95)=373.89µs
     ✓ { mode:graphql }...........................: avg=372.91µs min=273.57µs med=335.52µs max=14.44ms  p(90)=398.05µs p(95)=454.29µs
     ✓ { mode:uws }...............................: avg=349.91µs min=274.17µs med=327.63µs max=9.65ms   p(90)=361.39µs p(95)=378.16µs
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 258556
     http_req_receiving...........................: avg=33.89µs  min=16.85µs  med=33.73µs  max=4.5ms    p(90)=39.72µs  p(95)=42.08µs 
     http_req_sending.............................: avg=8.6µs    min=6.01µs   med=7.55µs   max=5.52ms   p(90)=11.07µs  p(95)=12.22µs 
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=322.47µs min=187.21µs med=286.73µs max=14.98ms  p(90)=420.52µs p(95)=441.97µs
     http_reqs....................................: 258556  1723.688831/s
     iteration_duration...........................: avg=575.3µs  min=398.19µs med=535.71µs max=15.69ms  p(90)=677.83µs p(95)=706.1µs 
     iterations...................................: 258556  1723.688831/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://24244ce9.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:

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