@envelop/prometheus 6.1.1-alpha-e859732.0 → 6.2.0-alpha-e0e4d8e.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -8,4 +8,4 @@ declare type PluginInternalContext = {
8
8
  [promPluginContext]: FillLabelsFnParams;
9
9
  [promPluginExecutionStartTimeSymbol]: number;
10
10
  };
11
- export declare const usePrometheus: (config?: PrometheusTracingPluginConfig) => Plugin<{}, PluginInternalContext>;
11
+ export declare const usePrometheus: (config?: PrometheusTracingPluginConfig) => Plugin<PluginInternalContext>;
package/index.js CHANGED
@@ -261,9 +261,7 @@ const usePrometheus = (config = {}) => {
261
261
  const startTime = Date.now();
262
262
  return () => {
263
263
  const totalTime = (Date.now() - startTime) / 1000;
264
- if (context[promPluginContext]) {
265
- contextBuildingHistogram.histogram.observe(contextBuildingHistogram.fillLabelsFn(context[promPluginContext], context), totalTime);
266
- }
264
+ contextBuildingHistogram.histogram.observe(contextBuildingHistogram.fillLabelsFn(context[promPluginContext], context), totalTime);
267
265
  };
268
266
  }
269
267
  : undefined;
package/index.mjs CHANGED
@@ -257,9 +257,7 @@ const usePrometheus = (config = {}) => {
257
257
  const startTime = Date.now();
258
258
  return () => {
259
259
  const totalTime = (Date.now() - startTime) / 1000;
260
- if (context[promPluginContext]) {
261
- contextBuildingHistogram.histogram.observe(contextBuildingHistogram.fillLabelsFn(context[promPluginContext], context), totalTime);
262
- }
260
+ contextBuildingHistogram.histogram.observe(contextBuildingHistogram.fillLabelsFn(context[promPluginContext], context), totalTime);
263
261
  };
264
262
  }
265
263
  : undefined;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@envelop/prometheus",
3
- "version": "6.1.1-alpha-e859732.0",
3
+ "version": "6.2.0-alpha-e0e4d8e.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@envelop/core": "2.1.1-alpha-e859732.0",
6
+ "@envelop/core": "2.2.0-alpha-e0e4d8e.0",
7
7
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0",
8
8
  "prom-client": "^13 || ^14.0.0"
9
9
  },
package/utils.d.ts CHANGED
@@ -16,7 +16,7 @@ export declare type FillLabelsFnParams = {
16
16
  deprecationInfo?: DeprecatedFieldInfo;
17
17
  };
18
18
  export declare function shouldTraceFieldResolver(info: GraphQLResolveInfo, whitelist: string[] | undefined): boolean;
19
- export declare function createInternalContext(parseResult: AfterParseEventPayload<any, any>['result']): FillLabelsFnParams | null;
19
+ export declare function createInternalContext(parseResult: AfterParseEventPayload<any>['result']): FillLabelsFnParams | null;
20
20
  export declare type FillLabelsFn<LabelNames extends string> = (params: FillLabelsFnParams, rawContext: any) => Record<LabelNames, string>;
21
21
  export declare function createHistogram<LabelNames extends string>(options: {
22
22
  histogram: Histogram<LabelNames>;