Skip to content

Releases: n1ru4l/envelop

May 30, 2024

30 May 09:49
de4d13b
Compare
Choose a tag to compare

@envelop/response-cache@6.2.0

Minor Changes

  • #2238
    430ee7d
    Thanks @ardatan! - Accept a factory function to cache that takes
    the context and returns the cache implementation

@envelop/response-cache-cloudflare-kv@1.0.0

Minor Changes

  • #2238
    430ee7d
    Thanks @ardatan! - BREAKING: Now the cache implementation does not
    require the ExecutionContext or KVNamespace instance but only the name of the namespace

    import { createSchema, createYoga, YogaInitialContext } from 'graphql-yoga'
    import { useResponseCache } from '@envelop/response-cache'
    import { createKvCache } from '@envelop/response-cache-cloudflare-kv'
    import { resolvers } from './graphql-schema/resolvers.generated'
    import { typeDefs } from './graphql-schema/typeDefs.generated'
    
    export type Env = {
      GRAPHQL_RESPONSE_CACHE: KVNamespace
    }
    
    const graphqlServer = createYoga<Env & ExecutionContext>({
      schema: createSchema({ typeDefs, resolvers }),
      plugins: [
        useResponseCache({
          cache: createKvCache({
            KVName: 'GRAPHQL_RESPONSE_CACHE',
            keyPrefix: 'graphql' // optional
          }),
          session: () => null,
          includeExtensionMetadata: true,
          ttl: 1000 * 10 // 10 seconds
        })
      ]
    })
    
    export default {
      fetch: graphqlServer
    }

Patch Changes

  • Updated dependencies
    [430ee7d]:
    • @envelop/response-cache@6.2.0

May 08, 2024

08 May 07:42
cae6868
Compare
Choose a tag to compare

@envelop/core@5.0.1

Patch Changes

@envelop/opentelemetry@6.3.1

Patch Changes

@envelop/prometheus@10.0.0

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 (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

  • Updated dependencies
    [dc1222f]:
    • @envelop/core@5.0.1

April 02, 2024

02 Apr 12:26
d7f6da0
Compare
Choose a tag to compare

@envelop/graphql-jit@8.0.3

Patch Changes

@envelop/opentelemetry@6.3.0

Minor Changes

@envelop/sentry@9.0.0

Major Changes

  • #2163
    7686b33
    Thanks @MarcelCutts! - Removed includedResolverArgs from
    SentryPluginOptions as it lead to no functionality.

March 18, 2024

18 Mar 21:43
40f7d1b
Compare
Choose a tag to compare

@envelop/graphql-jit@8.0.2

Patch Changes

March 13, 2024

13 Mar 14:04
62c5e10
Compare
Choose a tag to compare

@envelop/prometheus@9.4.0

Minor Changes

January 24, 2024

24 Jan 14:04
beb4c75
Compare
Choose a tag to compare

@envelop/prometheus@9.3.1

Patch Changes

January 18, 2024

18 Jan 15:23
cdb6b4d
Compare
Choose a tag to compare

@envelop/prometheus@9.3.0

Minor Changes

January 18, 2024

18 Jan 14:45
13bb9ff
Compare
Choose a tag to compare

@envelop/prometheus@9.2.0

Minor Changes

  • #2142
    4c11530
    Thanks @ardatan! - - Ability to hide operationName and operationType
    in the labels
    • Count schema changes
    • Catch errors during the context creation

January 18, 2024

18 Jan 12:13
8476c3d
Compare
Choose a tag to compare

@envelop/opentelemetry@6.2.1

Patch Changes

January 18, 2024

18 Jan 11:43
c7c5f5e
Compare
Choose a tag to compare

@envelop/opentelemetry@6.2.0

Minor Changes

Patch Changes