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 #2229

Merged
merged 2 commits into from
May 8, 2024
Merged

Upcoming Release Changes #2229

merged 2 commits into from
May 8, 2024

Conversation

theguild-bot
Copy link
Collaborator

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

  • #2217 7ac1d3c Thanks @EmrysMyrddin! - Adds a cache for metrics definition (Summary, Histogram and Counter).

    Fixes an issue preventing this plugin to be initialized multiple times, leading to metrics
    duplication error (How to run Prometheus with mesh start without giving an error? ardatan/graphql-mesh#6545).

    Behavior Breaking Change:

    Due to Prometheus client API limitations, a metric is only defined once for a given registry. This
    means that if the configuration of the metrics, it will be silently ignored on plugin
    re-initialization.

    This is to avoid potential loss of metrics data produced between the plugin re-initialization and
    the last pull by the prometheus agent.

    If you need to be sure metrics configuration is up to date after a plugin re-initialization, you can
    either:

    • restart the whole node process instead of just recreating a graphql server at runtime
    • clear the registry using registry.clear() before plugin re-initialization:
      function usePrometheusWithReset() {
        registry.clear()
        return usePrometheus({ ... })
      }
    • use a new registry for each plugin instance:
      function usePrometheusWithRegistry() {
        const registry = new Registry()
        return usePrometheus({
          registry,
          ...
        })
      }

    Keep in mind that this implies potential data loss in pull mode.

    API Breaking Change:

    To ensure metrics from being registered multiple times on the same registry, the signature of
    createHistogram, createSummary and createCounter have been changed to now include the registry
    as a mandatory parameter.

    If you were customizing metrics parameters, you will need to update the metric definitions

    usePrometheus({
      execute: createHistogram({
    +   registry: registry
        histogram: new Histogram({
          name: 'my_custom_name',
          help: 'HELP ME',
          labelNames: ['opText'] as const,
    -     registers: [registry],
        }),
        fillLabelsFn: () => {}
      }),
      requestCount: createCounter({
    +   registry: registry
        histogram: new Histogram({
          name: 'my_custom_name',
          help: 'HELP ME',
          labelNames: ['opText'] as const,
    -     registers: [registry],
        }),
        fillLabelsFn: () => {}
      }),
      requestSummary: createSummary({
    +   registry: registry
        histogram: new Histogram({
          name: 'my_custom_name',
          help: 'HELP ME',
          labelNames: ['opText'] as const,
    -     registers: [registry],
        }),
        fillLabelsFn: () => {}
      }),
    })

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

Copy link
Contributor

github-actions bot commented May 8, 2024

💻 Website Preview

The latest changes are available as preview in: https://7d39e02d.envelop.pages.dev

@theguild-bot
Copy link
Collaborator Author

✅ Benchmark Results

     ✓ no_errors
     ✓ expected_result

     checks.............................................: 100.00% ✓ 845862      ✗ 0     
     ✓ { mode:envelop-cache-and-no-internal-tracing }...: 100.00% ✓ 202418      ✗ 0     
     ✓ { mode:envelop-cache-jit }.......................: 100.00% ✓ 332282      ✗ 0     
     ✓ { mode:envelop-just-cache }......................: 100.00% ✓ 199428      ✗ 0     
     ✓ { mode:graphql-js }..............................: 100.00% ✓ 111734      ✗ 0     
     data_received......................................: 3.2 GB  27 MB/s
     data_sent..........................................: 184 MB  1.5 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=1.87µs  min=681ns    med=1.72µs  max=3.87ms  p(90)=2.24µs  p(95)=2.45µs 
     http_req_connecting................................: avg=23ns    min=0s       med=0s      max=1.95ms  p(90)=0s      p(95)=0s     
     http_req_duration..................................: avg=2.56ms  min=153.62µs med=2.25ms  max=82.63ms p(90)=4.65ms  p(95)=5.12ms 
       { expected_response:true }.......................: avg=2.56ms  min=153.62µs med=2.25ms  max=82.63ms p(90)=4.65ms  p(95)=5.12ms 
     ✓ { mode:envelop-cache-and-no-internal-tracing }...: avg=2.7ms   min=373.23µs med=2.38ms  max=14.89ms p(90)=4.63ms  p(95)=5.02ms 
     ✓ { mode:envelop-cache-jit }.......................: avg=1.52ms  min=153.62µs med=1.21ms  max=13.12ms p(90)=2.48ms  p(95)=2.65ms 
     ✓ { mode:envelop-just-cache }......................: avg=2.73ms  min=380.28µs med=2.39ms  max=33.77ms p(90)=4.65ms  p(95)=5.07ms 
     ✓ { mode:graphql-js }..............................: avg=5.11ms  min=734.11µs med=4.31ms  max=82.63ms p(90)=8.56ms  p(95)=9.29ms 
     http_req_failed....................................: 0.00%   ✓ 0           ✗ 422931
     http_req_receiving.................................: avg=31.92µs min=11.52µs  med=28.78µs max=16.96ms p(90)=43µs    p(95)=47.04µs
     http_req_sending...................................: avg=11.58µs min=4.65µs   med=10.24µs max=6.45ms  p(90)=13.95µs p(95)=17.78µs
     http_req_tls_handshaking...........................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     http_req_waiting...................................: avg=2.52ms  min=127.95µs med=2.21ms  max=82.56ms p(90)=4.6ms   p(95)=5.07ms 
     http_reqs..........................................: 422931  3524.206061/s
     iteration_duration.................................: avg=2.83ms  min=357.36µs med=2.51ms  max=83.18ms p(90)=4.91ms  p(95)=5.42ms 
     iterations.........................................: 422931  3524.206061/s
     vus................................................: 10      min=10        max=10  
     vus_max............................................: 20      min=20        max=20  

@EmrysMyrddin EmrysMyrddin merged commit cae6868 into main May 8, 2024
16 checks passed
@EmrysMyrddin EmrysMyrddin deleted the changeset-release/main branch May 8, 2024 07:40
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.

3 participants