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

Upcoming Release Changes #2324

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Upcoming Release Changes #2324

wants to merge 1 commit into from

Conversation

theguild-bot
Copy link
Collaborator

@theguild-bot theguild-bot commented Nov 12, 2024

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@envelop/[email protected]

Major Changes

  • #2317
    0977ef7
    Thanks @EmrysMyrddin! - Allow to explicitly control which
    events and timing should be observe.

    Each metric can now be configured to observe events and timings only for certain GraphQL pipeline
    phases, or depending on the request context.

    import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
    import { envelop, useEngine } from '@envelop/core'
    import { usePrometheus } from '@envelop/prometheus'
    
    const TRACKED_OPERATION_NAMES = [
      // make a list of operation that you want to monitor
    ]
    
    const getEnveloped = envelop({
      plugins: [
        useEngine({ parse, validate, specifiedRules, execute, subscribe }),
        usePrometheus({
          metrics: {
    
            // only trace errors of execute and subscribe phases
            graphql_envelop_phase_error: ['execute', 'subscribe']
    
            // only monitor timing of some operations
            graphql_yoga_http_duration: createHistogram({
              registry,
              histogram: {
                name: 'graphql_envelop_request_duration',
                help: 'Time spent on HTTP connection',
                labelNames: ['operation_name']
              },
              fillLabelsFn: ({ operationName }, _rawContext) => ({
                operation_name: operationName,
              }),
              phases: ['execute', 'subscribe'],
    
              // Here `shouldObserve` control if the request timing should be observed, based on context
              shouldObserve: (_, context) => TRACKED_OPERATIONS.includes(context?.params?.operationName),
            })
          },
        })
      ]
    })

    Breaking Change: A metric is enabled using true value in metrics options will observe in
    every phases available.

    Previously, which phase was observe was depending on which other metric were enabled. For example,
    this config would only trace validation error:

    usePrometheus({
      metrics: {
        graphql_envelop_phase_error: true,
        graphql_envelop_phase_validate: true
      }
    })

    This is no longer the case. If you were relying on this behavior, please use an array of string to
    restrict observed phases.

    usePrometheus({
      metrics: {
        graphql_envelop_phase_error: ['validate']
      }
    })

@envelop/[email protected]

Patch Changes

Copy link
Contributor

github-actions bot commented Nov 12, 2024

🚀 Snapshot Release (rc)

The latest changes of this PR are available as rc on npm (based on the declared changesets):

Package Version Info
@envelop/graphql-jit 8.0.4-rc-20241113192538-f24fddcca2a6d1f98b039813610668693420c858 npm ↗︎ unpkg ↗︎
@envelop/prometheus 12.0.0-rc-20241113192538-f24fddcca2a6d1f98b039813610668693420c858 npm ↗︎ unpkg ↗︎

Copy link
Contributor

github-actions bot commented Nov 12, 2024

💻 Website Preview

The latest changes are available as preview in: https://600b8c4d.envelop.pages.dev

@theguild-bot
Copy link
Collaborator Author

theguild-bot commented Nov 12, 2024

✅ Benchmark Results

     ✓ no_errors
     ✓ expected_result

     checks.............................................: 100.00% ✓ 767110      ✗ 0     
     ✓ { mode:envelop-cache-and-no-internal-tracing }...: 100.00% ✓ 163238      ✗ 0     
     ✓ { mode:envelop-cache-jit }.......................: 100.00% ✓ 341948      ✗ 0     
     ✓ { mode:envelop-just-cache }......................: 100.00% ✓ 162990      ✗ 0     
     ✓ { mode:graphql-js }..............................: 100.00% ✓ 98934       ✗ 0     
     data_received......................................: 2.9 GB  24 MB/s
     data_sent..........................................: 167 MB  1.4 MB/s
     envelop_init.......................................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     envelop_total......................................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     event_loop_lag.....................................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-and-no-internal-tracing }...: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     graphql_context....................................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     graphql_execute....................................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     graphql_parse......................................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     graphql_validate...................................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     http_req_blocked...................................: avg=2.81µs  min=1.22µs   med=2.52µs  max=8.17ms   p(90)=3.4µs   p(95)=3.78µs 
     http_req_connecting................................: avg=15ns    min=0s       med=0s      max=797.23µs p(90)=0s      p(95)=0s     
     http_req_duration..................................: avg=2.84ms  min=151.93µs med=2.78ms  max=37.73ms  p(90)=5.28ms  p(95)=6.14ms 
       { expected_response:true }.......................: avg=2.84ms  min=151.93µs med=2.78ms  max=37.73ms  p(90)=5.28ms  p(95)=6.14ms 
     ✓ { mode:envelop-cache-and-no-internal-tracing }...: avg=3.4ms   min=414.46µs med=3.04ms  max=18.53ms  p(90)=5.74ms  p(95)=6.25ms 
     ✓ { mode:envelop-cache-jit }.......................: avg=1.45ms  min=151.93µs med=1.2ms   max=16.12ms  p(90)=2.43ms  p(95)=2.58ms 
     ✓ { mode:envelop-just-cache }......................: avg=3.4ms   min=396.7µs  med=3.03ms  max=21.66ms  p(90)=5.71ms  p(95)=6.24ms 
     ✓ { mode:graphql-js }..............................: avg=5.77ms  min=983.99µs med=4.95ms  max=37.73ms  p(90)=9.64ms  p(95)=10.49ms
     http_req_failed....................................: 0.00%   ✓ 0           ✗ 383555
     http_req_receiving.................................: avg=35.56µs min=13.56µs  med=30.85µs max=10.19ms  p(90)=46.46µs p(95)=50.32µs
     http_req_sending...................................: avg=12.93µs min=4.08µs   med=9.93µs  max=19.15ms  p(90)=19.48µs p(95)=20.58µs
     http_req_tls_handshaking...........................: avg=0s      min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     http_req_waiting...................................: avg=2.79ms  min=125.95µs med=2.73ms  max=37.65ms  p(90)=5.22ms  p(95)=6.08ms 
     http_reqs..........................................: 383555  3196.254193/s
     iteration_duration.................................: avg=3.12ms  min=341.32µs med=3.03ms  max=38.43ms  p(90)=5.58ms  p(95)=6.43ms 
     iterations.........................................: 383555  3196.254193/s
     vus................................................: 10      min=10        max=10  
     vus_max............................................: 20      min=20        max=20  

@theguild-bot theguild-bot force-pushed the changeset-release/main branch 2 times, most recently from 17b8c70 to 5e53426 Compare November 13, 2024 18:49
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.

1 participant