@graphql-hive/gateway 2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193 → 2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @graphql-hive/gateway
2
2
 
3
- ## 2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
3
+ ## 2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
4
4
 
5
5
  ### Major Changes
6
6
 
@@ -39,10 +39,10 @@
39
39
  - Added dependency [`@opentelemetry/sampler-jaeger-remote@^0.202.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/sampler-jaeger-remote/v/0.202.0) (to `dependencies`)
40
40
  - Added dependency [`@opentelemetry/sdk-metrics@^2.0.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/sdk-metrics/v/2.0.1) (to `dependencies`)
41
41
 
42
- - [#1293](https://github.com/graphql-hive/gateway/pull/1293) [`a7aba54`](https://github.com/graphql-hive/gateway/commit/a7aba544c1e81d85d86cd251ecc1f8a8b7928e7f) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates:
42
+ - [#1300](https://github.com/graphql-hive/gateway/pull/1300) [`466b846`](https://github.com/graphql-hive/gateway/commit/466b846d405e9069a91b0a053c56c947a6adc8df) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates:
43
43
 
44
- - Added dependency [`@opentelemetry/api-logs@^0.202.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/api-logs/v/0.202.0) (to `dependencies`)
45
- - Added dependency [`@opentelemetry/sdk-logs@^0.202.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/sdk-logs/v/0.202.0) (to `dependencies`)
44
+ - Added dependency [`@opentelemetry/context-async-hooks@^2.0.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/context-async-hooks/v/2.0.1) (to `dependencies`)
45
+ - Added dependency [`@opentelemetry/sdk-trace-base@^2.0.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/sdk-trace-base/v/2.0.1) (to `dependencies`)
46
46
 
47
47
  - [#956](https://github.com/graphql-hive/gateway/pull/956) [`81671ba`](https://github.com/graphql-hive/gateway/commit/81671ba909e319be155d2ec2f10f5e3f6cc01cec) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates:
48
48
 
@@ -58,20 +58,20 @@
58
58
  - Added dependency [`@opentelemetry/sdk-metrics@^2.0.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/sdk-metrics/v/2.0.1) (to `dependencies`)
59
59
  - Removed dependency [`@graphql-mesh/plugin-mock@^0.105.6` ↗︎](https://www.npmjs.com/package/@graphql-mesh/plugin-mock/v/0.105.6) (from `dependencies`)
60
60
 
61
- - Updated dependencies [[`6c9083c`](https://github.com/graphql-hive/gateway/commit/6c9083c08c9f61ee224451a370353c18ad08e6d9), [`81671ba`](https://github.com/graphql-hive/gateway/commit/81671ba909e319be155d2ec2f10f5e3f6cc01cec), [`0d1f7fc`](https://github.com/graphql-hive/gateway/commit/0d1f7fcb435f1026b92f6a1db0448f36ecb336b6), [`a7aba54`](https://github.com/graphql-hive/gateway/commit/a7aba544c1e81d85d86cd251ecc1f8a8b7928e7f), [`2375a73`](https://github.com/graphql-hive/gateway/commit/2375a73752497960e18a2d9f58ae70125b89b64a), [`1942a82`](https://github.com/graphql-hive/gateway/commit/1942a82c039703b5682b64bda8464945722d266c), [`dd09ea9`](https://github.com/graphql-hive/gateway/commit/dd09ea939cc92d86559b3d4abe2d2a86a6f84ef4), [`6c9083c`](https://github.com/graphql-hive/gateway/commit/6c9083c08c9f61ee224451a370353c18ad08e6d9), [`81671ba`](https://github.com/graphql-hive/gateway/commit/81671ba909e319be155d2ec2f10f5e3f6cc01cec), [`2e5d9e3`](https://github.com/graphql-hive/gateway/commit/2e5d9e3c89569ace0d40e2fabd06c61808fed3b0), [`6c9083c`](https://github.com/graphql-hive/gateway/commit/6c9083c08c9f61ee224451a370353c18ad08e6d9), [`e08a863`](https://github.com/graphql-hive/gateway/commit/e08a863ad6ed47f3ab9c41efcb4b9434b0d61d59), [`17c1241`](https://github.com/graphql-hive/gateway/commit/17c12417e321dba453d149d08df730307bda300b), [`f008aed`](https://github.com/graphql-hive/gateway/commit/f008aed2fa901905090ef19ec43f8043b5852103), [`f0ff13d`](https://github.com/graphql-hive/gateway/commit/f0ff13d086a30eb156469cdb3452298f2ea0352e), [`dd09ea9`](https://github.com/graphql-hive/gateway/commit/dd09ea939cc92d86559b3d4abe2d2a86a6f84ef4), [`6c9083c`](https://github.com/graphql-hive/gateway/commit/6c9083c08c9f61ee224451a370353c18ad08e6d9), [`07c2d07`](https://github.com/graphql-hive/gateway/commit/07c2d07b11cce6d3f50fadd16b3e36597cd2472f)]:
62
- - @graphql-hive/gateway-runtime@2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
63
- - @graphql-mesh/plugin-opentelemetry@2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
64
- - @graphql-mesh/plugin-prometheus@2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
65
- - @graphql-mesh/hmac-upstream-signature@2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
66
- - @graphql-hive/plugin-deduplicate-request@2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
67
- - @graphql-mesh/transport-http-callback@1.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
68
- - @graphql-hive/plugin-aws-sigv4@2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
69
- - @graphql-mesh/plugin-jwt-auth@2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
70
- - @graphql-mesh/transport-http@1.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
71
- - @graphql-mesh/transport-ws@2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
72
- - @graphql-hive/importer@2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
73
- - @graphql-hive/logger@1.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
74
- - @graphql-hive/pubsub@2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193
61
+ - Updated dependencies [[`6c9083c`](https://github.com/graphql-hive/gateway/commit/6c9083c08c9f61ee224451a370353c18ad08e6d9), [`81671ba`](https://github.com/graphql-hive/gateway/commit/81671ba909e319be155d2ec2f10f5e3f6cc01cec), [`0d1f7fc`](https://github.com/graphql-hive/gateway/commit/0d1f7fcb435f1026b92f6a1db0448f36ecb336b6), [`309e408`](https://github.com/graphql-hive/gateway/commit/309e40818da7775623c0577a4a2d7f1ecba8be31), [`2375a73`](https://github.com/graphql-hive/gateway/commit/2375a73752497960e18a2d9f58ae70125b89b64a), [`1942a82`](https://github.com/graphql-hive/gateway/commit/1942a82c039703b5682b64bda8464945722d266c), [`dd09ea9`](https://github.com/graphql-hive/gateway/commit/dd09ea939cc92d86559b3d4abe2d2a86a6f84ef4), [`6c9083c`](https://github.com/graphql-hive/gateway/commit/6c9083c08c9f61ee224451a370353c18ad08e6d9), [`81671ba`](https://github.com/graphql-hive/gateway/commit/81671ba909e319be155d2ec2f10f5e3f6cc01cec), [`2e5d9e3`](https://github.com/graphql-hive/gateway/commit/2e5d9e3c89569ace0d40e2fabd06c61808fed3b0), [`6c9083c`](https://github.com/graphql-hive/gateway/commit/6c9083c08c9f61ee224451a370353c18ad08e6d9), [`e08a863`](https://github.com/graphql-hive/gateway/commit/e08a863ad6ed47f3ab9c41efcb4b9434b0d61d59), [`17c1241`](https://github.com/graphql-hive/gateway/commit/17c12417e321dba453d149d08df730307bda300b), [`f008aed`](https://github.com/graphql-hive/gateway/commit/f008aed2fa901905090ef19ec43f8043b5852103), [`f0ff13d`](https://github.com/graphql-hive/gateway/commit/f0ff13d086a30eb156469cdb3452298f2ea0352e), [`dd09ea9`](https://github.com/graphql-hive/gateway/commit/dd09ea939cc92d86559b3d4abe2d2a86a6f84ef4), [`6c9083c`](https://github.com/graphql-hive/gateway/commit/6c9083c08c9f61ee224451a370353c18ad08e6d9), [`07c2d07`](https://github.com/graphql-hive/gateway/commit/07c2d07b11cce6d3f50fadd16b3e36597cd2472f)]:
62
+ - @graphql-hive/gateway-runtime@2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
63
+ - @graphql-mesh/plugin-opentelemetry@2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
64
+ - @graphql-mesh/plugin-prometheus@2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
65
+ - @graphql-mesh/hmac-upstream-signature@2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
66
+ - @graphql-hive/plugin-deduplicate-request@2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
67
+ - @graphql-mesh/transport-http-callback@1.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
68
+ - @graphql-hive/plugin-aws-sigv4@2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
69
+ - @graphql-mesh/plugin-jwt-auth@2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
70
+ - @graphql-mesh/transport-http@1.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
71
+ - @graphql-mesh/transport-ws@2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
72
+ - @graphql-hive/importer@2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
73
+ - @graphql-hive/logger@1.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
74
+ - @graphql-hive/pubsub@2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf
75
75
 
76
76
  ## 1.15.3
77
77
 
package/dist/bin.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  require('dotenv/config');
4
4
  var module$1 = require('node:module');
5
5
  var logger = require('@graphql-hive/logger');
6
- var cli = require('./cli-Bej_F2hi.cjs');
6
+ var cli = require('./cli-Dry_zVMS.cjs');
7
7
  require('node:cluster');
8
8
  require('node:os');
9
9
  require('node:path');
@@ -17,6 +17,7 @@ require('node:url');
17
17
  require('node:fs');
18
18
  require('node:http');
19
19
  require('node:https');
20
+ require('@opentelemetry/sdk-trace-base');
20
21
  require('@graphql-tools/utils');
21
22
  require('@graphql-tools/code-file-loader');
22
23
  require('@graphql-tools/graphql-file-loader');
package/dist/bin.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import 'dotenv/config';
3
3
  import module from 'node:module';
4
4
  import { Logger } from '@graphql-hive/logger';
5
- import { e as enableModuleCachingIfPossible, h as handleNodeWarnings, r as run } from './cli-B_Lev2Nu.js';
5
+ import { e as enableModuleCachingIfPossible, h as handleNodeWarnings, r as run } from './cli-NUmC8UiD.js';
6
6
  import 'node:cluster';
7
7
  import 'node:os';
8
8
  import 'node:path';
@@ -16,6 +16,7 @@ import 'node:url';
16
16
  import 'node:fs';
17
17
  import 'node:http';
18
18
  import 'node:https';
19
+ import '@opentelemetry/sdk-trace-base';
19
20
  import '@graphql-tools/utils';
20
21
  import '@graphql-tools/code-file-loader';
21
22
  import '@graphql-tools/graphql-file-loader';
@@ -15,6 +15,7 @@ var node_url = require('node:url');
15
15
  var node_fs = require('node:fs');
16
16
  var node_http = require('node:http');
17
17
  var node_https = require('node:https');
18
+ var sdkTraceBase = require('@opentelemetry/sdk-trace-base');
18
19
  var utils$1 = require('@graphql-tools/utils');
19
20
  var codeFileLoader = require('@graphql-tools/code-file-loader');
20
21
  var graphqlFileLoader = require('@graphql-tools/graphql-file-loader');
@@ -492,11 +493,46 @@ function handleFork(log, config) {
492
493
  return false;
493
494
  }
494
495
 
496
+ async function handleOpenTelemetryConfig(ctx, cliOpts) {
497
+ const accessToken = cliOpts.hiveTraceAccessToken;
498
+ const target = cliOpts.hiveTarget;
499
+ const openTelemetry = cliOpts.openTelemetry;
500
+ const exporterType = cliOpts.openTelemetryExporterType ?? "otlp-http";
501
+ if (typeof openTelemetry === "string" || accessToken) {
502
+ const { openTelemetrySetup, HiveTracingSpanProcessor } = await import('@graphql-mesh/plugin-opentelemetry/setup');
503
+ const processors = [];
504
+ if (openTelemetry) {
505
+ const { OTLPTraceExporter } = await import(`@opentelemetry/exporter-trace-${exporterType}`);
506
+ processors.push(
507
+ new sdkTraceBase.BatchSpanProcessor(new OTLPTraceExporter({ url: openTelemetry }))
508
+ );
509
+ }
510
+ if (accessToken) {
511
+ if (!target) {
512
+ ctx.log.error(
513
+ 'Hive tracing needs a target. Please provide it through "--hive-target <target>"'
514
+ );
515
+ process.exit(1);
516
+ }
517
+ processors.push(
518
+ new HiveTracingSpanProcessor({
519
+ accessToken,
520
+ target
521
+ })
522
+ );
523
+ }
524
+ openTelemetrySetup({
525
+ traces: { processors },
526
+ contextManager: await import('@opentelemetry/context-async-hooks').then((module) => new module.AsyncLocalStorageContextManager()).catch(() => null)
527
+ });
528
+ }
529
+ }
530
+
495
531
  function handleReportingConfig(ctx, loadedConfig, cliOpts) {
496
532
  const confOpts = {
497
533
  ...loadedConfig.reporting?.type === "hive" ? {
498
534
  hiveRegistryToken: loadedConfig.reporting.token,
499
- hiveUsageTarget: loadedConfig.reporting.target,
535
+ hiveTarget: loadedConfig.reporting.target,
500
536
  hiveUsageAccessToken: loadedConfig.reporting.token
501
537
  } : {},
502
538
  ...loadedConfig.reporting?.type === "graphos" ? {
@@ -504,32 +540,42 @@ function handleReportingConfig(ctx, loadedConfig, cliOpts) {
504
540
  apolloKey: loadedConfig.reporting.apiKey
505
541
  } : {}
506
542
  };
507
- const opts = { ...confOpts, ...cliOpts };
543
+ const opts = {
544
+ ...confOpts,
545
+ ...cliOpts,
546
+ hiveTarget: cliOpts.hiveTarget ?? cliOpts.hiveUsageTarget ?? confOpts.hiveTarget
547
+ };
508
548
  if (cliOpts.hiveRegistryToken && cliOpts.hiveUsageAccessToken) {
509
549
  ctx.log.error(
510
550
  'Cannot use "--hive-registry-token" with "--hive-usage-access-token". Please use "--hive-usage-target" and "--hive-usage-access-token" or the config instead.'
511
551
  );
512
552
  process.exit(1);
513
553
  }
514
- if (cliOpts.hiveRegistryToken && opts.hiveUsageTarget) {
554
+ if (cliOpts.hiveUsageTarget && cliOpts.hiveTarget) {
555
+ ctx.log.error(
556
+ 'Cannot use "--hive-usage-target" with "--hive-target". Please only use "--hive-target"'
557
+ );
558
+ process.exit(1);
559
+ }
560
+ if (cliOpts.hiveRegistryToken && opts.hiveTarget) {
515
561
  ctx.log.error(
516
562
  'Cannot use "--hive-registry-token" with a target. Please use "--hive-usage-target" and "--hive-usage-access-token" or the config instead.'
517
563
  );
518
564
  process.exit(1);
519
565
  }
520
- if (opts.hiveUsageTarget && !opts.hiveUsageAccessToken) {
566
+ if (opts.hiveTarget && !opts.hiveAccessToken && !opts.hiveUsageAccessToken && !opts.hiveTraceAccessToken) {
521
567
  ctx.log.error(
522
- 'Hive usage target needs an access token. Please provide it through the "--hive-usage-access-token <token>" option or the config.'
568
+ 'Hive usage target needs an access token. Please provide it through "--hive-access-token <token>", or specific "--hive-usage-access-token <token>" and "--hive-trace-access-token" options, or the config.'
523
569
  );
524
570
  process.exit(1);
525
571
  }
526
- if (opts.hiveUsageAccessToken && !opts.hiveUsageTarget) {
572
+ if ((opts.hiveAccessToken || opts.hiveUsageAccessToken || opts.hiveTraceAccessToken) && !opts.hiveUsageTarget) {
527
573
  ctx.log.error(
528
- 'Hive usage access token needs a target. Please provide it through the "--hive-usage-target <target>" option or the config.'
574
+ 'Hive access token needs a target. Please provide it through the "--hive-target <target>" option or the config.'
529
575
  );
530
576
  process.exit(1);
531
577
  }
532
- const hiveUsageAccessToken = opts.hiveUsageAccessToken || opts.hiveRegistryToken;
578
+ const hiveUsageAccessToken = opts.hiveAccessToken || opts.hiveUsageAccessToken || opts.hiveRegistryToken;
533
579
  if (hiveUsageAccessToken) {
534
580
  if (opts.hiveUsageTarget) {
535
581
  ctx.log.info("Configuring Hive usage reporting");
@@ -540,7 +586,7 @@ function handleReportingConfig(ctx, loadedConfig, cliOpts) {
540
586
  ...loadedConfig.reporting,
541
587
  type: "hive",
542
588
  token: hiveUsageAccessToken,
543
- target: opts.hiveUsageTarget
589
+ target: opts.hiveTarget
544
590
  };
545
591
  }
546
592
  if (opts.apolloKey) {
@@ -568,17 +614,28 @@ const addCommand$2 = (ctx, cli) => cli.command("proxy").description(
568
614
  "path to the GraphQL schema file or a url from where to pull the schema"
569
615
  ).action(async function proxy(endpoint) {
570
616
  const {
617
+ opentelemetry,
618
+ opentelemetryExporterType,
571
619
  hiveCdnEndpoint,
572
620
  hiveCdnKey,
573
621
  hiveRegistryToken,
622
+ hiveTarget,
574
623
  hiveUsageTarget,
624
+ hiveAccessToken,
575
625
  hiveUsageAccessToken,
626
+ hiveTraceAccessToken,
576
627
  maskedErrors,
577
628
  hivePersistedDocumentsEndpoint,
578
629
  hivePersistedDocumentsToken,
579
630
  ...opts
580
631
  } = this.optsWithGlobals();
581
632
  ctx.log.info(`Starting ${ctx.productName} ${ctx.version} in proxy mode`);
633
+ await handleOpenTelemetryConfig(ctx, {
634
+ openTelemetry: opentelemetry,
635
+ openTelemetryExporterType: opentelemetryExporterType,
636
+ hiveTarget,
637
+ hiveTraceAccessToken
638
+ });
582
639
  const loadedConfig = await loadConfig({
583
640
  log: ctx.log,
584
641
  configPath: opts.configPath,
@@ -632,8 +689,11 @@ const addCommand$2 = (ctx, cli) => cli.command("proxy").description(
632
689
  const registryConfig = {};
633
690
  const reporting = handleReportingConfig(ctx, loadedConfig, {
634
691
  hiveRegistryToken,
692
+ hiveTarget,
635
693
  hiveUsageTarget,
694
+ hiveAccessToken,
636
695
  hiveUsageAccessToken,
696
+ hiveTraceAccessToken,
637
697
  // proxy can only do reporting to hive registry
638
698
  apolloGraphRef: void 0,
639
699
  apolloKey: void 0
@@ -654,7 +714,8 @@ const addCommand$2 = (ctx, cli) => cli.command("proxy").description(
654
714
  const builtinPlugins = await getBuiltinPluginsFromConfig(
655
715
  {
656
716
  ...loadedConfig,
657
- ...opts
717
+ ...opts,
718
+ openTelemetry: opentelemetry ? { ...loadedConfig.openTelemetry, traces: true } : loadedConfig.openTelemetry
658
719
  },
659
720
  {
660
721
  log: ctx.log,
@@ -727,15 +788,26 @@ const addCommand$1 = (ctx, cli) => cli.command("subgraph").description(
727
788
  'path to the subgraph schema file or a url from where to pull the subgraph schema (default: "subgraph.graphql")'
728
789
  ).action(async function subgraph(schemaPathOrUrl) {
729
790
  const {
791
+ opentelemetry,
792
+ opentelemetryExporterType,
730
793
  maskedErrors,
731
794
  hiveRegistryToken,
795
+ hiveTarget,
732
796
  hiveUsageTarget,
797
+ hiveAccessToken,
733
798
  hiveUsageAccessToken,
799
+ hiveTraceAccessToken,
734
800
  hivePersistedDocumentsEndpoint,
735
801
  hivePersistedDocumentsToken,
736
802
  ...opts
737
803
  } = this.optsWithGlobals();
738
804
  ctx.log.info(`Starting ${ctx.productName} ${ctx.version} as subgraph`);
805
+ await handleOpenTelemetryConfig(ctx, {
806
+ openTelemetry: opentelemetry,
807
+ openTelemetryExporterType: opentelemetryExporterType,
808
+ hiveTarget,
809
+ hiveTraceAccessToken
810
+ });
739
811
  const loadedConfig = await loadConfig({
740
812
  log: ctx.log,
741
813
  configPath: opts.configPath,
@@ -751,8 +823,11 @@ const addCommand$1 = (ctx, cli) => cli.command("subgraph").description(
751
823
  const registryConfig = {};
752
824
  const reporting = handleReportingConfig(ctx, loadedConfig, {
753
825
  hiveRegistryToken,
826
+ hiveTarget,
754
827
  hiveUsageTarget,
828
+ hiveAccessToken,
755
829
  hiveUsageAccessToken,
830
+ hiveTraceAccessToken,
756
831
  // subgraph can only do reporting to hive registry
757
832
  apolloGraphRef: void 0,
758
833
  apolloKey: void 0
@@ -773,7 +848,8 @@ const addCommand$1 = (ctx, cli) => cli.command("subgraph").description(
773
848
  const builtinPlugins = await getBuiltinPluginsFromConfig(
774
849
  {
775
850
  ...loadedConfig,
776
- ...opts
851
+ ...opts,
852
+ openTelemetry: opentelemetry ? { ...loadedConfig.openTelemetry, traces: true } : loadedConfig.openTelemetry
777
853
  },
778
854
  {
779
855
  log: ctx.log,
@@ -866,11 +942,16 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
866
942
  ).env("APOLLO_SCHEMA_CONFIG_DELIVERY_ENDPOINT")
867
943
  ).action(async function supergraph(schemaPathOrUrl) {
868
944
  const {
945
+ opentelemetry,
946
+ opentelemetryExporterType,
869
947
  hiveCdnEndpoint,
870
948
  hiveCdnKey,
871
949
  hiveRegistryToken,
872
950
  hiveUsageTarget,
951
+ hiveTarget,
952
+ hiveAccessToken,
873
953
  hiveUsageAccessToken,
954
+ hiveTraceAccessToken,
874
955
  maskedErrors,
875
956
  apolloGraphRef,
876
957
  apolloKey,
@@ -882,6 +963,12 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
882
963
  ctx.log.info(
883
964
  `Starting ${ctx.productName} ${ctx.version} with supergraph`
884
965
  );
966
+ await handleOpenTelemetryConfig(ctx, {
967
+ openTelemetry: opentelemetry,
968
+ openTelemetryExporterType: opentelemetryExporterType,
969
+ hiveTarget,
970
+ hiveTraceAccessToken
971
+ });
885
972
  const loadedConfig = await loadConfig({
886
973
  log: ctx.log,
887
974
  configPath: opts.configPath,
@@ -967,6 +1054,9 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
967
1054
  }
968
1055
  const registryConfig = {};
969
1056
  const reporting = handleReportingConfig(ctx, loadedConfig, {
1057
+ hiveTarget,
1058
+ hiveAccessToken,
1059
+ hiveTraceAccessToken,
970
1060
  hiveRegistryToken,
971
1061
  hiveUsageTarget,
972
1062
  hiveUsageAccessToken,
@@ -989,7 +1079,8 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
989
1079
  const builtinPlugins = await getBuiltinPluginsFromConfig(
990
1080
  {
991
1081
  ...loadedConfig,
992
- ...opts
1082
+ ...opts,
1083
+ openTelemetry: opentelemetry ? { ...loadedConfig.openTelemetry, traces: true } : loadedConfig.openTelemetry
993
1084
  },
994
1085
  {
995
1086
  log: ctx.log,
@@ -1239,27 +1330,52 @@ let cli = new extraTypings.Command().configureHelp({
1239
1330
  // see here https://github.com/tj/commander.js/blob/970ecae402b253de691e6a9066fea22f38fe7431/lib/command.js#L655
1240
1331
  // @ts-expect-error
1241
1332
  null
1333
+ ).addOption(
1334
+ new extraTypings.Option(
1335
+ "--opentelemetry [exporter-endpoint]",
1336
+ `Enable OpenTelemetry integration with an exporter using this option's value as endpoint. By default, it uses OTLP HTTP, use "--opentelemetry-exporter-type" to change the default.`
1337
+ ).env("OPENTELEMETRY")
1338
+ ).addOption(
1339
+ new extraTypings.Option(
1340
+ "--opentelemetry-exporter-type <type>",
1341
+ `OpenTelemetry exporter type to use when setting up OpenTelemetry integration. Requires "--opentelemetry" to set the endpoint.`
1342
+ ).choices(["otlp-http", "otlp-grpc"]).default("otlp-http").env("OPENTELEMETRY_EXPORTER_TYPE")
1242
1343
  ).addOption(
1243
1344
  new extraTypings.Option(
1244
1345
  "--hive-registry-token <token>",
1245
- '[DEPRECATED: please use "--hive-usage-target" and "--hive-usage-access-token"] Hive registry token for usage metrics reporting'
1346
+ '[DEPRECATED: please use "--hive-target" and "--hive-access-token"] Hive registry token for usage metrics reporting'
1246
1347
  ).env("HIVE_REGISTRY_TOKEN")
1247
1348
  ).addOption(
1248
1349
  new extraTypings.Option(
1249
1350
  "--hive-usage-target <target>",
1250
- 'Hive registry target to which the usage data should be reported to. requires the "--hive-usage-access-token <token>" option'
1351
+ "[DEPRECATED] please use --hive-target instead."
1251
1352
  ).env("HIVE_USAGE_TARGET")
1353
+ ).addOption(
1354
+ new extraTypings.Option(
1355
+ "--hive-target <target>",
1356
+ 'Hive registry target to which the usage and tracing data should be reported to. Requires either "--hive-access-token <token>", "--hive-usage-access-token <token>" or "--hive-trace-access-token" option'
1357
+ ).env("HIVE_TARGET")
1358
+ ).addOption(
1359
+ new extraTypings.Option(
1360
+ "--hive-access-token <token>",
1361
+ 'Hive registry access token for usage metrics reporting and tracing. Enables both usage reporting and tracing. Requires the "--hive-target <target>" option'
1362
+ ).env("HIVE_ACCESS_TOKEN")
1252
1363
  ).addOption(
1253
1364
  new extraTypings.Option(
1254
1365
  "--hive-usage-access-token <token>",
1255
- 'Hive registry access token for usage metrics reporting. requires the "--hive-usage-target <target>" option'
1366
+ `Hive registry access token for usage reporting. Enables Hive usage report. Requires the "--hive-target <target>" option. It can't be used together with "--hive-access-token"`
1256
1367
  ).env("HIVE_USAGE_ACCESS_TOKEN")
1368
+ ).addOption(
1369
+ new extraTypings.Option(
1370
+ "--hive-trace-access-token <token>",
1371
+ `Hive registry access token for tracing. Enables Hive tracing. Requires the "--hive-target <target>" option. It can't be used together with "--hive-access-token"`
1372
+ ).env("HIVE_TRACE_ACCESS_TOKEN")
1257
1373
  ).option(
1258
1374
  "--hive-persisted-documents-endpoint <endpoint>",
1259
- '[EXPERIMENTAL] Hive CDN endpoint for fetching the persisted documents. requires the "--hive-persisted-documents-token <token>" option'
1375
+ '[EXPERIMENTAL] Hive CDN endpoint for fetching the persisted documents. Requires the "--hive-persisted-documents-token <token>" option'
1260
1376
  ).option(
1261
1377
  "--hive-persisted-documents-token <token>",
1262
- '[EXPERIMENTAL] Hive persisted documents CDN endpoint token. requires the "--hive-persisted-documents-endpoint <endpoint>" option'
1378
+ '[EXPERIMENTAL] Hive persisted documents CDN endpoint token. Requires the "--hive-persisted-documents-endpoint <endpoint>" option'
1263
1379
  ).addOption(
1264
1380
  new extraTypings.Option(
1265
1381
  "--hive-cdn-endpoint <endpoint>",
@@ -13,6 +13,7 @@ import { pathToFileURL } from 'node:url';
13
13
  import { promises } from 'node:fs';
14
14
  import { createServer as createServer$1 } from 'node:http';
15
15
  import { createServer } from 'node:https';
16
+ import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
16
17
  import { isValidPath, asArray } from '@graphql-tools/utils';
17
18
  import { CodeFileLoader } from '@graphql-tools/code-file-loader';
18
19
  import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader';
@@ -485,11 +486,46 @@ function handleFork(log, config) {
485
486
  return false;
486
487
  }
487
488
 
489
+ async function handleOpenTelemetryConfig(ctx, cliOpts) {
490
+ const accessToken = cliOpts.hiveTraceAccessToken;
491
+ const target = cliOpts.hiveTarget;
492
+ const openTelemetry = cliOpts.openTelemetry;
493
+ const exporterType = cliOpts.openTelemetryExporterType ?? "otlp-http";
494
+ if (typeof openTelemetry === "string" || accessToken) {
495
+ const { openTelemetrySetup, HiveTracingSpanProcessor } = await import('@graphql-mesh/plugin-opentelemetry/setup');
496
+ const processors = [];
497
+ if (openTelemetry) {
498
+ const { OTLPTraceExporter } = await import(`@opentelemetry/exporter-trace-${exporterType}`);
499
+ processors.push(
500
+ new BatchSpanProcessor(new OTLPTraceExporter({ url: openTelemetry }))
501
+ );
502
+ }
503
+ if (accessToken) {
504
+ if (!target) {
505
+ ctx.log.error(
506
+ 'Hive tracing needs a target. Please provide it through "--hive-target <target>"'
507
+ );
508
+ process.exit(1);
509
+ }
510
+ processors.push(
511
+ new HiveTracingSpanProcessor({
512
+ accessToken,
513
+ target
514
+ })
515
+ );
516
+ }
517
+ openTelemetrySetup({
518
+ traces: { processors },
519
+ contextManager: await import('@opentelemetry/context-async-hooks').then((module) => new module.AsyncLocalStorageContextManager()).catch(() => null)
520
+ });
521
+ }
522
+ }
523
+
488
524
  function handleReportingConfig(ctx, loadedConfig, cliOpts) {
489
525
  const confOpts = {
490
526
  ...loadedConfig.reporting?.type === "hive" ? {
491
527
  hiveRegistryToken: loadedConfig.reporting.token,
492
- hiveUsageTarget: loadedConfig.reporting.target,
528
+ hiveTarget: loadedConfig.reporting.target,
493
529
  hiveUsageAccessToken: loadedConfig.reporting.token
494
530
  } : {},
495
531
  ...loadedConfig.reporting?.type === "graphos" ? {
@@ -497,32 +533,42 @@ function handleReportingConfig(ctx, loadedConfig, cliOpts) {
497
533
  apolloKey: loadedConfig.reporting.apiKey
498
534
  } : {}
499
535
  };
500
- const opts = { ...confOpts, ...cliOpts };
536
+ const opts = {
537
+ ...confOpts,
538
+ ...cliOpts,
539
+ hiveTarget: cliOpts.hiveTarget ?? cliOpts.hiveUsageTarget ?? confOpts.hiveTarget
540
+ };
501
541
  if (cliOpts.hiveRegistryToken && cliOpts.hiveUsageAccessToken) {
502
542
  ctx.log.error(
503
543
  'Cannot use "--hive-registry-token" with "--hive-usage-access-token". Please use "--hive-usage-target" and "--hive-usage-access-token" or the config instead.'
504
544
  );
505
545
  process.exit(1);
506
546
  }
507
- if (cliOpts.hiveRegistryToken && opts.hiveUsageTarget) {
547
+ if (cliOpts.hiveUsageTarget && cliOpts.hiveTarget) {
548
+ ctx.log.error(
549
+ 'Cannot use "--hive-usage-target" with "--hive-target". Please only use "--hive-target"'
550
+ );
551
+ process.exit(1);
552
+ }
553
+ if (cliOpts.hiveRegistryToken && opts.hiveTarget) {
508
554
  ctx.log.error(
509
555
  'Cannot use "--hive-registry-token" with a target. Please use "--hive-usage-target" and "--hive-usage-access-token" or the config instead.'
510
556
  );
511
557
  process.exit(1);
512
558
  }
513
- if (opts.hiveUsageTarget && !opts.hiveUsageAccessToken) {
559
+ if (opts.hiveTarget && !opts.hiveAccessToken && !opts.hiveUsageAccessToken && !opts.hiveTraceAccessToken) {
514
560
  ctx.log.error(
515
- 'Hive usage target needs an access token. Please provide it through the "--hive-usage-access-token <token>" option or the config.'
561
+ 'Hive usage target needs an access token. Please provide it through "--hive-access-token <token>", or specific "--hive-usage-access-token <token>" and "--hive-trace-access-token" options, or the config.'
516
562
  );
517
563
  process.exit(1);
518
564
  }
519
- if (opts.hiveUsageAccessToken && !opts.hiveUsageTarget) {
565
+ if ((opts.hiveAccessToken || opts.hiveUsageAccessToken || opts.hiveTraceAccessToken) && !opts.hiveUsageTarget) {
520
566
  ctx.log.error(
521
- 'Hive usage access token needs a target. Please provide it through the "--hive-usage-target <target>" option or the config.'
567
+ 'Hive access token needs a target. Please provide it through the "--hive-target <target>" option or the config.'
522
568
  );
523
569
  process.exit(1);
524
570
  }
525
- const hiveUsageAccessToken = opts.hiveUsageAccessToken || opts.hiveRegistryToken;
571
+ const hiveUsageAccessToken = opts.hiveAccessToken || opts.hiveUsageAccessToken || opts.hiveRegistryToken;
526
572
  if (hiveUsageAccessToken) {
527
573
  if (opts.hiveUsageTarget) {
528
574
  ctx.log.info("Configuring Hive usage reporting");
@@ -533,7 +579,7 @@ function handleReportingConfig(ctx, loadedConfig, cliOpts) {
533
579
  ...loadedConfig.reporting,
534
580
  type: "hive",
535
581
  token: hiveUsageAccessToken,
536
- target: opts.hiveUsageTarget
582
+ target: opts.hiveTarget
537
583
  };
538
584
  }
539
585
  if (opts.apolloKey) {
@@ -561,17 +607,28 @@ const addCommand$2 = (ctx, cli) => cli.command("proxy").description(
561
607
  "path to the GraphQL schema file or a url from where to pull the schema"
562
608
  ).action(async function proxy(endpoint) {
563
609
  const {
610
+ opentelemetry,
611
+ opentelemetryExporterType,
564
612
  hiveCdnEndpoint,
565
613
  hiveCdnKey,
566
614
  hiveRegistryToken,
615
+ hiveTarget,
567
616
  hiveUsageTarget,
617
+ hiveAccessToken,
568
618
  hiveUsageAccessToken,
619
+ hiveTraceAccessToken,
569
620
  maskedErrors,
570
621
  hivePersistedDocumentsEndpoint,
571
622
  hivePersistedDocumentsToken,
572
623
  ...opts
573
624
  } = this.optsWithGlobals();
574
625
  ctx.log.info(`Starting ${ctx.productName} ${ctx.version} in proxy mode`);
626
+ await handleOpenTelemetryConfig(ctx, {
627
+ openTelemetry: opentelemetry,
628
+ openTelemetryExporterType: opentelemetryExporterType,
629
+ hiveTarget,
630
+ hiveTraceAccessToken
631
+ });
575
632
  const loadedConfig = await loadConfig({
576
633
  log: ctx.log,
577
634
  configPath: opts.configPath,
@@ -625,8 +682,11 @@ const addCommand$2 = (ctx, cli) => cli.command("proxy").description(
625
682
  const registryConfig = {};
626
683
  const reporting = handleReportingConfig(ctx, loadedConfig, {
627
684
  hiveRegistryToken,
685
+ hiveTarget,
628
686
  hiveUsageTarget,
687
+ hiveAccessToken,
629
688
  hiveUsageAccessToken,
689
+ hiveTraceAccessToken,
630
690
  // proxy can only do reporting to hive registry
631
691
  apolloGraphRef: void 0,
632
692
  apolloKey: void 0
@@ -647,7 +707,8 @@ const addCommand$2 = (ctx, cli) => cli.command("proxy").description(
647
707
  const builtinPlugins = await getBuiltinPluginsFromConfig(
648
708
  {
649
709
  ...loadedConfig,
650
- ...opts
710
+ ...opts,
711
+ openTelemetry: opentelemetry ? { ...loadedConfig.openTelemetry, traces: true } : loadedConfig.openTelemetry
651
712
  },
652
713
  {
653
714
  log: ctx.log,
@@ -720,15 +781,26 @@ const addCommand$1 = (ctx, cli) => cli.command("subgraph").description(
720
781
  'path to the subgraph schema file or a url from where to pull the subgraph schema (default: "subgraph.graphql")'
721
782
  ).action(async function subgraph(schemaPathOrUrl) {
722
783
  const {
784
+ opentelemetry,
785
+ opentelemetryExporterType,
723
786
  maskedErrors,
724
787
  hiveRegistryToken,
788
+ hiveTarget,
725
789
  hiveUsageTarget,
790
+ hiveAccessToken,
726
791
  hiveUsageAccessToken,
792
+ hiveTraceAccessToken,
727
793
  hivePersistedDocumentsEndpoint,
728
794
  hivePersistedDocumentsToken,
729
795
  ...opts
730
796
  } = this.optsWithGlobals();
731
797
  ctx.log.info(`Starting ${ctx.productName} ${ctx.version} as subgraph`);
798
+ await handleOpenTelemetryConfig(ctx, {
799
+ openTelemetry: opentelemetry,
800
+ openTelemetryExporterType: opentelemetryExporterType,
801
+ hiveTarget,
802
+ hiveTraceAccessToken
803
+ });
732
804
  const loadedConfig = await loadConfig({
733
805
  log: ctx.log,
734
806
  configPath: opts.configPath,
@@ -744,8 +816,11 @@ const addCommand$1 = (ctx, cli) => cli.command("subgraph").description(
744
816
  const registryConfig = {};
745
817
  const reporting = handleReportingConfig(ctx, loadedConfig, {
746
818
  hiveRegistryToken,
819
+ hiveTarget,
747
820
  hiveUsageTarget,
821
+ hiveAccessToken,
748
822
  hiveUsageAccessToken,
823
+ hiveTraceAccessToken,
749
824
  // subgraph can only do reporting to hive registry
750
825
  apolloGraphRef: void 0,
751
826
  apolloKey: void 0
@@ -766,7 +841,8 @@ const addCommand$1 = (ctx, cli) => cli.command("subgraph").description(
766
841
  const builtinPlugins = await getBuiltinPluginsFromConfig(
767
842
  {
768
843
  ...loadedConfig,
769
- ...opts
844
+ ...opts,
845
+ openTelemetry: opentelemetry ? { ...loadedConfig.openTelemetry, traces: true } : loadedConfig.openTelemetry
770
846
  },
771
847
  {
772
848
  log: ctx.log,
@@ -859,11 +935,16 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
859
935
  ).env("APOLLO_SCHEMA_CONFIG_DELIVERY_ENDPOINT")
860
936
  ).action(async function supergraph(schemaPathOrUrl) {
861
937
  const {
938
+ opentelemetry,
939
+ opentelemetryExporterType,
862
940
  hiveCdnEndpoint,
863
941
  hiveCdnKey,
864
942
  hiveRegistryToken,
865
943
  hiveUsageTarget,
944
+ hiveTarget,
945
+ hiveAccessToken,
866
946
  hiveUsageAccessToken,
947
+ hiveTraceAccessToken,
867
948
  maskedErrors,
868
949
  apolloGraphRef,
869
950
  apolloKey,
@@ -875,6 +956,12 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
875
956
  ctx.log.info(
876
957
  `Starting ${ctx.productName} ${ctx.version} with supergraph`
877
958
  );
959
+ await handleOpenTelemetryConfig(ctx, {
960
+ openTelemetry: opentelemetry,
961
+ openTelemetryExporterType: opentelemetryExporterType,
962
+ hiveTarget,
963
+ hiveTraceAccessToken
964
+ });
878
965
  const loadedConfig = await loadConfig({
879
966
  log: ctx.log,
880
967
  configPath: opts.configPath,
@@ -960,6 +1047,9 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
960
1047
  }
961
1048
  const registryConfig = {};
962
1049
  const reporting = handleReportingConfig(ctx, loadedConfig, {
1050
+ hiveTarget,
1051
+ hiveAccessToken,
1052
+ hiveTraceAccessToken,
963
1053
  hiveRegistryToken,
964
1054
  hiveUsageTarget,
965
1055
  hiveUsageAccessToken,
@@ -982,7 +1072,8 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
982
1072
  const builtinPlugins = await getBuiltinPluginsFromConfig(
983
1073
  {
984
1074
  ...loadedConfig,
985
- ...opts
1075
+ ...opts,
1076
+ openTelemetry: opentelemetry ? { ...loadedConfig.openTelemetry, traces: true } : loadedConfig.openTelemetry
986
1077
  },
987
1078
  {
988
1079
  log: ctx.log,
@@ -1232,27 +1323,52 @@ let cli = new Command().configureHelp({
1232
1323
  // see here https://github.com/tj/commander.js/blob/970ecae402b253de691e6a9066fea22f38fe7431/lib/command.js#L655
1233
1324
  // @ts-expect-error
1234
1325
  null
1326
+ ).addOption(
1327
+ new Option(
1328
+ "--opentelemetry [exporter-endpoint]",
1329
+ `Enable OpenTelemetry integration with an exporter using this option's value as endpoint. By default, it uses OTLP HTTP, use "--opentelemetry-exporter-type" to change the default.`
1330
+ ).env("OPENTELEMETRY")
1331
+ ).addOption(
1332
+ new Option(
1333
+ "--opentelemetry-exporter-type <type>",
1334
+ `OpenTelemetry exporter type to use when setting up OpenTelemetry integration. Requires "--opentelemetry" to set the endpoint.`
1335
+ ).choices(["otlp-http", "otlp-grpc"]).default("otlp-http").env("OPENTELEMETRY_EXPORTER_TYPE")
1235
1336
  ).addOption(
1236
1337
  new Option(
1237
1338
  "--hive-registry-token <token>",
1238
- '[DEPRECATED: please use "--hive-usage-target" and "--hive-usage-access-token"] Hive registry token for usage metrics reporting'
1339
+ '[DEPRECATED: please use "--hive-target" and "--hive-access-token"] Hive registry token for usage metrics reporting'
1239
1340
  ).env("HIVE_REGISTRY_TOKEN")
1240
1341
  ).addOption(
1241
1342
  new Option(
1242
1343
  "--hive-usage-target <target>",
1243
- 'Hive registry target to which the usage data should be reported to. requires the "--hive-usage-access-token <token>" option'
1344
+ "[DEPRECATED] please use --hive-target instead."
1244
1345
  ).env("HIVE_USAGE_TARGET")
1346
+ ).addOption(
1347
+ new Option(
1348
+ "--hive-target <target>",
1349
+ 'Hive registry target to which the usage and tracing data should be reported to. Requires either "--hive-access-token <token>", "--hive-usage-access-token <token>" or "--hive-trace-access-token" option'
1350
+ ).env("HIVE_TARGET")
1351
+ ).addOption(
1352
+ new Option(
1353
+ "--hive-access-token <token>",
1354
+ 'Hive registry access token for usage metrics reporting and tracing. Enables both usage reporting and tracing. Requires the "--hive-target <target>" option'
1355
+ ).env("HIVE_ACCESS_TOKEN")
1245
1356
  ).addOption(
1246
1357
  new Option(
1247
1358
  "--hive-usage-access-token <token>",
1248
- 'Hive registry access token for usage metrics reporting. requires the "--hive-usage-target <target>" option'
1359
+ `Hive registry access token for usage reporting. Enables Hive usage report. Requires the "--hive-target <target>" option. It can't be used together with "--hive-access-token"`
1249
1360
  ).env("HIVE_USAGE_ACCESS_TOKEN")
1361
+ ).addOption(
1362
+ new Option(
1363
+ "--hive-trace-access-token <token>",
1364
+ `Hive registry access token for tracing. Enables Hive tracing. Requires the "--hive-target <target>" option. It can't be used together with "--hive-access-token"`
1365
+ ).env("HIVE_TRACE_ACCESS_TOKEN")
1250
1366
  ).option(
1251
1367
  "--hive-persisted-documents-endpoint <endpoint>",
1252
- '[EXPERIMENTAL] Hive CDN endpoint for fetching the persisted documents. requires the "--hive-persisted-documents-token <token>" option'
1368
+ '[EXPERIMENTAL] Hive CDN endpoint for fetching the persisted documents. Requires the "--hive-persisted-documents-token <token>" option'
1253
1369
  ).option(
1254
1370
  "--hive-persisted-documents-token <token>",
1255
- '[EXPERIMENTAL] Hive persisted documents CDN endpoint token. requires the "--hive-persisted-documents-endpoint <endpoint>" option'
1371
+ '[EXPERIMENTAL] Hive persisted documents CDN endpoint token. Requires the "--hive-persisted-documents-endpoint <endpoint>" option'
1256
1372
  ).addOption(
1257
1373
  new Option(
1258
1374
  "--hive-cdn-endpoint <endpoint>",
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var cli = require('./cli-Bej_F2hi.cjs');
3
+ var cli = require('./cli-Dry_zVMS.cjs');
4
4
  var logger = require('@graphql-hive/logger');
5
5
  var gatewayRuntime = require('@graphql-hive/gateway-runtime');
6
6
  var pubsub = require('@graphql-hive/pubsub');
@@ -30,6 +30,7 @@ require('node:url');
30
30
  require('node:fs');
31
31
  require('node:http');
32
32
  require('node:https');
33
+ require('@opentelemetry/sdk-trace-base');
33
34
  require('@graphql-tools/utils');
34
35
  require('@graphql-tools/code-file-loader');
35
36
  require('@graphql-tools/graphql-file-loader');
package/dist/index.d.cts CHANGED
@@ -268,9 +268,14 @@ declare let cli: Command<[], {
268
268
  port?: number | undefined;
269
269
  polling?: number | undefined;
270
270
  maskedErrors: string | boolean | string[] | [];
271
+ opentelemetry?: string | true | undefined;
272
+ opentelemetryExporterType: "otlp-http" | "otlp-grpc";
271
273
  hiveRegistryToken?: string | undefined;
272
274
  hiveUsageTarget?: string | undefined;
275
+ hiveTarget?: string | undefined;
276
+ hiveAccessToken?: string | undefined;
273
277
  hiveUsageAccessToken?: string | undefined;
278
+ hiveTraceAccessToken?: string | undefined;
274
279
  hivePersistedDocumentsEndpoint?: string | undefined;
275
280
  hivePersistedDocumentsToken?: string | undefined;
276
281
  hiveCdnEndpoint?: string | undefined;
@@ -287,9 +292,14 @@ declare function run(userCtx: Partial<CLIContext>): Promise<Command<[], {
287
292
  port?: number | undefined;
288
293
  polling?: number | undefined;
289
294
  maskedErrors: string | boolean | string[] | [];
295
+ opentelemetry?: string | true | undefined;
296
+ opentelemetryExporterType: "otlp-http" | "otlp-grpc";
290
297
  hiveRegistryToken?: string | undefined;
291
298
  hiveUsageTarget?: string | undefined;
299
+ hiveTarget?: string | undefined;
300
+ hiveAccessToken?: string | undefined;
292
301
  hiveUsageAccessToken?: string | undefined;
302
+ hiveTraceAccessToken?: string | undefined;
293
303
  hivePersistedDocumentsEndpoint?: string | undefined;
294
304
  hivePersistedDocumentsToken?: string | undefined;
295
305
  hiveCdnEndpoint?: string | undefined;
package/dist/index.d.ts CHANGED
@@ -268,9 +268,14 @@ declare let cli: Command<[], {
268
268
  port?: number | undefined;
269
269
  polling?: number | undefined;
270
270
  maskedErrors: string | boolean | string[] | [];
271
+ opentelemetry?: string | true | undefined;
272
+ opentelemetryExporterType: "otlp-http" | "otlp-grpc";
271
273
  hiveRegistryToken?: string | undefined;
272
274
  hiveUsageTarget?: string | undefined;
275
+ hiveTarget?: string | undefined;
276
+ hiveAccessToken?: string | undefined;
273
277
  hiveUsageAccessToken?: string | undefined;
278
+ hiveTraceAccessToken?: string | undefined;
274
279
  hivePersistedDocumentsEndpoint?: string | undefined;
275
280
  hivePersistedDocumentsToken?: string | undefined;
276
281
  hiveCdnEndpoint?: string | undefined;
@@ -287,9 +292,14 @@ declare function run(userCtx: Partial<CLIContext>): Promise<Command<[], {
287
292
  port?: number | undefined;
288
293
  polling?: number | undefined;
289
294
  maskedErrors: string | boolean | string[] | [];
295
+ opentelemetry?: string | true | undefined;
296
+ opentelemetryExporterType: "otlp-http" | "otlp-grpc";
290
297
  hiveRegistryToken?: string | undefined;
291
298
  hiveUsageTarget?: string | undefined;
299
+ hiveTarget?: string | undefined;
300
+ hiveAccessToken?: string | undefined;
292
301
  hiveUsageAccessToken?: string | undefined;
302
+ hiveTraceAccessToken?: string | undefined;
293
303
  hivePersistedDocumentsEndpoint?: string | undefined;
294
304
  hivePersistedDocumentsToken?: string | undefined;
295
305
  hiveCdnEndpoint?: string | undefined;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { b as defaultOptions, d as defineConfig, e as enableModuleCachingIfPossible, a as getBuiltinPluginsFromConfig, g as getCacheInstanceFromConfig, h as handleNodeWarnings, r as run } from './cli-B_Lev2Nu.js';
1
+ export { b as defaultOptions, d as defineConfig, e as enableModuleCachingIfPossible, a as getBuiltinPluginsFromConfig, g as getCacheInstanceFromConfig, h as handleNodeWarnings, r as run } from './cli-NUmC8UiD.js';
2
2
  export * from '@graphql-hive/logger';
3
3
  export * from '@graphql-hive/gateway-runtime';
4
4
  export { PubSub } from '@graphql-hive/pubsub';
@@ -29,6 +29,7 @@ import 'node:url';
29
29
  import 'node:fs';
30
30
  import 'node:http';
31
31
  import 'node:https';
32
+ import '@opentelemetry/sdk-trace-base';
32
33
  import '@graphql-tools/utils';
33
34
  import '@graphql-tools/code-file-loader';
34
35
  import '@graphql-tools/graphql-file-loader';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-hive/gateway",
3
- "version": "2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
3
+ "version": "2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -53,28 +53,28 @@
53
53
  "@escape.tech/graphql-armor-block-field-suggestions": "^3.0.0",
54
54
  "@escape.tech/graphql-armor-max-depth": "^2.4.0",
55
55
  "@escape.tech/graphql-armor-max-tokens": "^2.5.0",
56
- "@graphql-hive/gateway-runtime": "2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
57
- "@graphql-hive/importer": "2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
58
- "@graphql-hive/logger": "1.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
59
- "@graphql-hive/plugin-aws-sigv4": "2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
60
- "@graphql-hive/plugin-deduplicate-request": "2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
61
- "@graphql-hive/pubsub": "2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
56
+ "@graphql-hive/gateway-runtime": "2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
57
+ "@graphql-hive/importer": "2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
58
+ "@graphql-hive/logger": "1.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
59
+ "@graphql-hive/plugin-aws-sigv4": "2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
60
+ "@graphql-hive/plugin-deduplicate-request": "2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
61
+ "@graphql-hive/pubsub": "2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
62
62
  "@graphql-mesh/cache-cfw-kv": "^0.105.5",
63
63
  "@graphql-mesh/cache-localforage": "^0.105.6",
64
64
  "@graphql-mesh/cache-redis": "^0.104.5",
65
65
  "@graphql-mesh/cache-upstash-redis": "^0.1.5",
66
66
  "@graphql-mesh/cross-helpers": "^0.4.10",
67
- "@graphql-mesh/hmac-upstream-signature": "2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
67
+ "@graphql-mesh/hmac-upstream-signature": "2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
68
68
  "@graphql-mesh/plugin-http-cache": "^0.105.6",
69
69
  "@graphql-mesh/plugin-jit": "^0.2.5",
70
- "@graphql-mesh/plugin-jwt-auth": "2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
71
- "@graphql-mesh/plugin-opentelemetry": "2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
72
- "@graphql-mesh/plugin-prometheus": "2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
70
+ "@graphql-mesh/plugin-jwt-auth": "2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
71
+ "@graphql-mesh/plugin-opentelemetry": "2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
72
+ "@graphql-mesh/plugin-prometheus": "2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
73
73
  "@graphql-mesh/plugin-rate-limit": "^0.104.5",
74
74
  "@graphql-mesh/plugin-snapshot": "^0.104.5",
75
- "@graphql-mesh/transport-http": "1.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
76
- "@graphql-mesh/transport-http-callback": "1.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
77
- "@graphql-mesh/transport-ws": "2.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
75
+ "@graphql-mesh/transport-http": "1.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
76
+ "@graphql-mesh/transport-http-callback": "1.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
77
+ "@graphql-mesh/transport-ws": "2.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
78
78
  "@graphql-mesh/types": "^0.104.5",
79
79
  "@graphql-mesh/utils": "^0.104.5",
80
80
  "@graphql-tools/code-file-loader": "^8.1.15",
@@ -83,7 +83,7 @@
83
83
  "@graphql-tools/utils": "^10.8.1",
84
84
  "@graphql-yoga/render-graphiql": "^5.13.5",
85
85
  "@opentelemetry/api": "^1.9.0",
86
- "@opentelemetry/api-logs": "^0.202.0",
86
+ "@opentelemetry/context-async-hooks": "^2.0.1",
87
87
  "@opentelemetry/context-zone": "^2.0.1",
88
88
  "@opentelemetry/core": "^2.0.1",
89
89
  "@opentelemetry/exporter-jaeger": "^2.0.1",
@@ -91,8 +91,8 @@
91
91
  "@opentelemetry/propagator-b3": "^2.0.1",
92
92
  "@opentelemetry/propagator-jaeger": "^2.0.1",
93
93
  "@opentelemetry/sampler-jaeger-remote": "^0.202.0",
94
- "@opentelemetry/sdk-logs": "^0.202.0",
95
94
  "@opentelemetry/sdk-metrics": "^2.0.1",
95
+ "@opentelemetry/sdk-trace-base": "^2.0.1",
96
96
  "commander": "^13.1.0",
97
97
  "dotenv": "^16.4.7",
98
98
  "graphql-ws": "^6.0.4",
@@ -101,7 +101,7 @@
101
101
  "ws": "^8.18.0"
102
102
  },
103
103
  "devDependencies": {
104
- "@graphql-mesh/transport-common": "1.0.0-alpha-53cd0a74b026dea5d975614fa049bc698a178193",
104
+ "@graphql-mesh/transport-common": "1.0.0-alpha-f78cc13e6890ffeaf4570d7a81f384abccc313cf",
105
105
  "@graphql-mesh/transport-soap": "^0.10.6",
106
106
  "@graphql-tools/executor": "^1.4.7",
107
107
  "@rollup/plugin-commonjs": "^28.0.0",