@graphql-hive/gateway 2.0.0-alpha-b02daead998ce12ffde320b956dc6d8d1a199172 → 2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
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 +14 -14
- package/dist/bin.cjs +2 -2
- package/dist/bin.js +2 -2
- package/dist/{cli-w5oUkqGz.js → cli-C8SAeNPg.js} +70 -36
- package/dist/{cli-DewWk4WC.cjs → cli-CQdLYWjW.cjs} +70 -36
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# @graphql-hive/gateway
|
2
2
|
|
3
|
-
## 2.0.0-alpha-
|
3
|
+
## 2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
4
4
|
|
5
5
|
### Major Changes
|
6
6
|
|
@@ -75,19 +75,19 @@
|
|
75
75
|
- Removed dependency [`@graphql-mesh/plugin-mock@^0.105.6` ↗︎](https://www.npmjs.com/package/@graphql-mesh/plugin-mock/v/0.105.6) (from `dependencies`)
|
76
76
|
|
77
77
|
- Updated dependencies [[`95484c2`](https://github.com/graphql-hive/gateway/commit/95484c2ca0cea1cd732df4bfe8ce45032ec31d42), [`7dafdeb`](https://github.com/graphql-hive/gateway/commit/7dafdebc803e49373fe9d53997113483e512fdb0), [`6215001`](https://github.com/graphql-hive/gateway/commit/6215001b1d650ad865331661532bcc4f7bad6b40), [`f12f2b7`](https://github.com/graphql-hive/gateway/commit/f12f2b78163fbef797a42b5999a0b5a8ef6b2c98), [`8b7db06`](https://github.com/graphql-hive/gateway/commit/8b7db06887f5dec52d380bfc123dbf495cbe04ef), [`6215001`](https://github.com/graphql-hive/gateway/commit/6215001b1d650ad865331661532bcc4f7bad6b40), [`7dafdeb`](https://github.com/graphql-hive/gateway/commit/7dafdebc803e49373fe9d53997113483e512fdb0), [`9e4d81c`](https://github.com/graphql-hive/gateway/commit/9e4d81c2ad9e99d2195e3f2a021a30a9312cf980), [`f3caa12`](https://github.com/graphql-hive/gateway/commit/f3caa12a7ad50cdc03c82f2336f820e8ccbad55e), [`1ba0cf4`](https://github.com/graphql-hive/gateway/commit/1ba0cf4a6359e41a6ab16f940d8733d3ad9d800b), [`dfe6f58`](https://github.com/graphql-hive/gateway/commit/dfe6f58209afd27953676c5b51b8b9f07fc99671), [`ceb07a6`](https://github.com/graphql-hive/gateway/commit/ceb07a61f6f1c7ca345df2c23860950e5152288e), [`732c6f5`](https://github.com/graphql-hive/gateway/commit/732c6f5c82fdf6b730109fbc7c05c69da8ce6fb4), [`95484c2`](https://github.com/graphql-hive/gateway/commit/95484c2ca0cea1cd732df4bfe8ce45032ec31d42), [`7dafdeb`](https://github.com/graphql-hive/gateway/commit/7dafdebc803e49373fe9d53997113483e512fdb0), [`8b7db06`](https://github.com/graphql-hive/gateway/commit/8b7db06887f5dec52d380bfc123dbf495cbe04ef), [`6215001`](https://github.com/graphql-hive/gateway/commit/6215001b1d650ad865331661532bcc4f7bad6b40), [`cd9b7ce`](https://github.com/graphql-hive/gateway/commit/cd9b7ce551ec702c00b33e6c1b2cf68f0a6c82a3), [`95484c2`](https://github.com/graphql-hive/gateway/commit/95484c2ca0cea1cd732df4bfe8ce45032ec31d42), [`f052709`](https://github.com/graphql-hive/gateway/commit/f0527092e4942b4c97cb3272266f93f3200fac98), [`9bee8e9`](https://github.com/graphql-hive/gateway/commit/9bee8e9ff165c43591c0b20637b6d1f2a2cb9cc2), [`9b230f3`](https://github.com/graphql-hive/gateway/commit/9b230f35b47afbf3b253e4c21720e836c5a2a8d1), [`10a5887`](https://github.com/graphql-hive/gateway/commit/10a58873acde8734f05dfda455fe7b366861676b), [`2a56e5f`](https://github.com/graphql-hive/gateway/commit/2a56e5fd5a07f6784e8c2d0ad767d8c55710ada4), [`ae37c4a`](https://github.com/graphql-hive/gateway/commit/ae37c4a4189e3ea20f2ce0d24e2509d2053eb244), [`732c6f5`](https://github.com/graphql-hive/gateway/commit/732c6f5c82fdf6b730109fbc7c05c69da8ce6fb4), [`95484c2`](https://github.com/graphql-hive/gateway/commit/95484c2ca0cea1cd732df4bfe8ce45032ec31d42), [`dbb4fd9`](https://github.com/graphql-hive/gateway/commit/dbb4fd9287ff872de5cc9f18546987bd71232df5)]:
|
78
|
-
- @graphql-hive/gateway-runtime@2.0.0-alpha-
|
79
|
-
- @graphql-hive/plugin-aws-sigv4@2.0.0-alpha-
|
80
|
-
- @graphql-mesh/plugin-jwt-auth@2.0.0-alpha-
|
81
|
-
- @graphql-mesh/plugin-opentelemetry@2.0.0-alpha-
|
82
|
-
- @graphql-mesh/plugin-prometheus@2.0.0-alpha-
|
83
|
-
- @graphql-mesh/transport-ws@2.0.0-alpha-
|
84
|
-
- @graphql-mesh/hmac-upstream-signature@2.0.0-alpha-
|
85
|
-
- @graphql-hive/plugin-deduplicate-request@2.0.0-alpha-
|
86
|
-
- @graphql-mesh/transport-http-callback@1.0.0-alpha-
|
87
|
-
- @graphql-mesh/transport-http@1.0.0-alpha-
|
88
|
-
- @graphql-hive/importer@2.0.0-alpha-
|
89
|
-
- @graphql-hive/pubsub@2.0.0-alpha-
|
90
|
-
- @graphql-hive/logger@1.0.1-alpha-
|
78
|
+
- @graphql-hive/gateway-runtime@2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
79
|
+
- @graphql-hive/plugin-aws-sigv4@2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
80
|
+
- @graphql-mesh/plugin-jwt-auth@2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
81
|
+
- @graphql-mesh/plugin-opentelemetry@2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
82
|
+
- @graphql-mesh/plugin-prometheus@2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
83
|
+
- @graphql-mesh/transport-ws@2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
84
|
+
- @graphql-mesh/hmac-upstream-signature@2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
85
|
+
- @graphql-hive/plugin-deduplicate-request@2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
86
|
+
- @graphql-mesh/transport-http-callback@1.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
87
|
+
- @graphql-mesh/transport-http@1.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
88
|
+
- @graphql-hive/importer@2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
89
|
+
- @graphql-hive/pubsub@2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
90
|
+
- @graphql-hive/logger@1.0.1-alpha-d94711dad9603bf7cee45770805e1d9026d17e52
|
91
91
|
|
92
92
|
## 1.15.4
|
93
93
|
|
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-
|
6
|
+
var cli = require('./cli-CQdLYWjW.cjs');
|
7
7
|
require('node:cluster');
|
8
8
|
require('node:os');
|
9
9
|
require('node:path');
|
@@ -17,8 +17,8 @@ require('node:url');
|
|
17
17
|
require('node:fs');
|
18
18
|
require('node:http');
|
19
19
|
require('node:https');
|
20
|
-
require('@opentelemetry/sdk-trace-base');
|
21
20
|
require('@graphql-tools/utils');
|
21
|
+
require('@opentelemetry/sdk-trace-base');
|
22
22
|
require('@graphql-tools/code-file-loader');
|
23
23
|
require('@graphql-tools/graphql-file-loader');
|
24
24
|
require('@graphql-tools/load');
|
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-
|
5
|
+
import { e as enableModuleCachingIfPossible, h as handleNodeWarnings, r as run } from './cli-C8SAeNPg.js';
|
6
6
|
import 'node:cluster';
|
7
7
|
import 'node:os';
|
8
8
|
import 'node:path';
|
@@ -16,8 +16,8 @@ import 'node:url';
|
|
16
16
|
import 'node:fs';
|
17
17
|
import 'node:http';
|
18
18
|
import 'node:https';
|
19
|
-
import '@opentelemetry/sdk-trace-base';
|
20
19
|
import '@graphql-tools/utils';
|
20
|
+
import '@opentelemetry/sdk-trace-base';
|
21
21
|
import '@graphql-tools/code-file-loader';
|
22
22
|
import '@graphql-tools/graphql-file-loader';
|
23
23
|
import '@graphql-tools/load';
|
@@ -13,8 +13,8 @@ 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 { fakePromise, isValidPath, asArray } from '@graphql-tools/utils';
|
16
17
|
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
|
17
|
-
import { isValidPath, asArray } from '@graphql-tools/utils';
|
18
18
|
import { CodeFileLoader } from '@graphql-tools/code-file-loader';
|
19
19
|
import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader';
|
20
20
|
import { loadTypedefs } from '@graphql-tools/load';
|
@@ -488,40 +488,74 @@ function handleFork(log, config) {
|
|
488
488
|
|
489
489
|
async function handleOpenTelemetryConfig(ctx, cliOpts) {
|
490
490
|
const accessToken = cliOpts.hiveTraceAccessToken;
|
491
|
-
const
|
491
|
+
const traceEndpoint = cliOpts.hiveTraceEndpoint;
|
492
492
|
const target = cliOpts.hiveTarget;
|
493
493
|
const openTelemetry = cliOpts.openTelemetry;
|
494
494
|
const exporterType = cliOpts.openTelemetryExporterType ?? "otlp-http";
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
);
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
495
|
+
const log = ctx.log.child("[OpenTelemetry] ");
|
496
|
+
if (openTelemetry || accessToken) {
|
497
|
+
log.debug(
|
498
|
+
{ openTelemetry, exporterType, target, traceEndpoint },
|
499
|
+
"Initializing OpenTelemetry SDK"
|
500
|
+
);
|
501
|
+
return fakePromise().then(async () => {
|
502
|
+
const { openTelemetrySetup, HiveTracingSpanProcessor, getEnvVar } = await import('@graphql-mesh/plugin-opentelemetry/setup');
|
503
|
+
const processors = [];
|
504
|
+
const logAttributes = {
|
505
|
+
traceEndpoints: [],
|
506
|
+
contextManager: false
|
507
|
+
};
|
508
|
+
let integrationName;
|
509
|
+
if (openTelemetry) {
|
510
|
+
const otelEndpoint = typeof openTelemetry === "string" ? openTelemetry : getEnvVar("OTEL_EXPORTER_OTLP_ENDPOINT", void 0);
|
511
|
+
log.debug({ exporterType, otelEndpoint }, "Setting up OTLP Exporter");
|
512
|
+
integrationName = "OpenTelemetry";
|
513
|
+
logAttributes.traceEndpoints.push({
|
514
|
+
url: otelEndpoint ?? null,
|
515
|
+
type: exporterType
|
516
|
+
});
|
517
|
+
log.debug({ type: exporterType }, "Loading OpenTelemetry exporter");
|
518
|
+
const { OTLPTraceExporter } = await import(`@opentelemetry/exporter-trace-${exporterType}`);
|
519
|
+
processors.push(
|
520
|
+
new BatchSpanProcessor(new OTLPTraceExporter({ url: otelEndpoint }))
|
508
521
|
);
|
509
|
-
process.exit(1);
|
510
522
|
}
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
+
if (accessToken) {
|
524
|
+
log.debug({ target, traceEndpoint }, "Setting up Hive Tracing");
|
525
|
+
integrationName ??= "Hive Tracing";
|
526
|
+
if (!target) {
|
527
|
+
ctx.log.error(
|
528
|
+
'Hive tracing needs a target. Please provide it through "--hive-target <target>"'
|
529
|
+
);
|
530
|
+
process.exit(1);
|
531
|
+
}
|
532
|
+
logAttributes.traceEndpoints.push({
|
533
|
+
url: traceEndpoint,
|
534
|
+
type: "hive tracing",
|
535
|
+
target
|
536
|
+
});
|
537
|
+
processors.push(
|
538
|
+
new HiveTracingSpanProcessor({
|
539
|
+
accessToken,
|
540
|
+
target,
|
541
|
+
endpoint: traceEndpoint
|
542
|
+
})
|
543
|
+
);
|
544
|
+
}
|
545
|
+
log.debug("Trying to load AsyncLocalStorage based Context Manager");
|
546
|
+
const contextManager = await import('@opentelemetry/context-async-hooks').then((module) => {
|
547
|
+
logAttributes.contextManager = true;
|
548
|
+
return new module.AsyncLocalStorageContextManager();
|
549
|
+
}).catch(() => null);
|
550
|
+
openTelemetrySetup({
|
551
|
+
traces: { processors },
|
552
|
+
contextManager
|
553
|
+
});
|
554
|
+
log.info(logAttributes, `${integrationName} integration is enabled`);
|
555
|
+
return true;
|
523
556
|
});
|
524
557
|
}
|
558
|
+
return false;
|
525
559
|
}
|
526
560
|
|
527
561
|
function handleReportingConfig(ctx, loadedConfig, cliOpts) {
|
@@ -630,7 +664,7 @@ const addCommand$2 = (ctx, cli) => cli.command("proxy").description(
|
|
630
664
|
...opts
|
631
665
|
} = this.optsWithGlobals();
|
632
666
|
ctx.log.info(`Starting ${ctx.productName} ${ctx.version} in proxy mode`);
|
633
|
-
await handleOpenTelemetryConfig(ctx, {
|
667
|
+
const openTelemetryEnabledByCLI = await handleOpenTelemetryConfig(ctx, {
|
634
668
|
openTelemetry: opentelemetry,
|
635
669
|
openTelemetryExporterType: opentelemetryExporterType,
|
636
670
|
hiveTarget,
|
@@ -716,7 +750,7 @@ const addCommand$2 = (ctx, cli) => cli.command("proxy").description(
|
|
716
750
|
{
|
717
751
|
...loadedConfig,
|
718
752
|
...opts,
|
719
|
-
openTelemetry:
|
753
|
+
openTelemetry: openTelemetryEnabledByCLI ? { ...loadedConfig.openTelemetry, traces: true } : loadedConfig.openTelemetry
|
720
754
|
},
|
721
755
|
{
|
722
756
|
log: ctx.log,
|
@@ -806,7 +840,7 @@ const addCommand$1 = (ctx, cli) => cli.command("subgraph").description(
|
|
806
840
|
...opts
|
807
841
|
} = this.optsWithGlobals();
|
808
842
|
ctx.log.info(`Starting ${ctx.productName} ${ctx.version} as subgraph`);
|
809
|
-
await handleOpenTelemetryConfig(ctx, {
|
843
|
+
const openTelemetryEnabledByCLI = await handleOpenTelemetryConfig(ctx, {
|
810
844
|
openTelemetry: opentelemetry,
|
811
845
|
openTelemetryExporterType: opentelemetryExporterType,
|
812
846
|
hiveTarget,
|
@@ -854,7 +888,7 @@ const addCommand$1 = (ctx, cli) => cli.command("subgraph").description(
|
|
854
888
|
{
|
855
889
|
...loadedConfig,
|
856
890
|
...opts,
|
857
|
-
openTelemetry:
|
891
|
+
openTelemetry: openTelemetryEnabledByCLI ? { ...loadedConfig.openTelemetry, traces: true } : loadedConfig.openTelemetry
|
858
892
|
},
|
859
893
|
{
|
860
894
|
log: ctx.log,
|
@@ -970,7 +1004,7 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
|
|
970
1004
|
ctx.log.info(
|
971
1005
|
`Starting ${ctx.productName} ${ctx.version} with supergraph`
|
972
1006
|
);
|
973
|
-
await handleOpenTelemetryConfig(ctx, {
|
1007
|
+
const openTelemetryEnabledByCLI = await handleOpenTelemetryConfig(ctx, {
|
974
1008
|
openTelemetry: opentelemetry,
|
975
1009
|
openTelemetryExporterType: opentelemetryExporterType,
|
976
1010
|
hiveTarget,
|
@@ -1088,7 +1122,7 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
|
|
1088
1122
|
{
|
1089
1123
|
...loadedConfig,
|
1090
1124
|
...opts,
|
1091
|
-
openTelemetry:
|
1125
|
+
openTelemetry: openTelemetryEnabledByCLI ? { ...loadedConfig.openTelemetry, traces: true } : loadedConfig.openTelemetry
|
1092
1126
|
},
|
1093
1127
|
{
|
1094
1128
|
log: ctx.log,
|
@@ -1381,8 +1415,8 @@ let cli = new Command().configureHelp({
|
|
1381
1415
|
).addOption(
|
1382
1416
|
new Option(
|
1383
1417
|
"--hive-trace-endpoint <endpoint>",
|
1384
|
-
`Hive registry
|
1385
|
-
).env("HIVE_TRACE_ENDPOINT")
|
1418
|
+
`Hive registry tracing endpoint.`
|
1419
|
+
).env("HIVE_TRACE_ENDPOINT").default(`https://api.graphql-hive.com/otel/v1/traces`)
|
1386
1420
|
).option(
|
1387
1421
|
"--hive-persisted-documents-endpoint <endpoint>",
|
1388
1422
|
'[EXPERIMENTAL] Hive CDN endpoint for fetching the persisted documents. Requires the "--hive-persisted-documents-token <token>" option'
|
@@ -15,8 +15,8 @@ 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');
|
19
18
|
var utils$1 = require('@graphql-tools/utils');
|
19
|
+
var sdkTraceBase = require('@opentelemetry/sdk-trace-base');
|
20
20
|
var codeFileLoader = require('@graphql-tools/code-file-loader');
|
21
21
|
var graphqlFileLoader = require('@graphql-tools/graphql-file-loader');
|
22
22
|
var load = require('@graphql-tools/load');
|
@@ -495,40 +495,74 @@ function handleFork(log, config) {
|
|
495
495
|
|
496
496
|
async function handleOpenTelemetryConfig(ctx, cliOpts) {
|
497
497
|
const accessToken = cliOpts.hiveTraceAccessToken;
|
498
|
-
const
|
498
|
+
const traceEndpoint = cliOpts.hiveTraceEndpoint;
|
499
499
|
const target = cliOpts.hiveTarget;
|
500
500
|
const openTelemetry = cliOpts.openTelemetry;
|
501
501
|
const exporterType = cliOpts.openTelemetryExporterType ?? "otlp-http";
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
);
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
502
|
+
const log = ctx.log.child("[OpenTelemetry] ");
|
503
|
+
if (openTelemetry || accessToken) {
|
504
|
+
log.debug(
|
505
|
+
{ openTelemetry, exporterType, target, traceEndpoint },
|
506
|
+
"Initializing OpenTelemetry SDK"
|
507
|
+
);
|
508
|
+
return utils$1.fakePromise().then(async () => {
|
509
|
+
const { openTelemetrySetup, HiveTracingSpanProcessor, getEnvVar } = await import('@graphql-mesh/plugin-opentelemetry/setup');
|
510
|
+
const processors = [];
|
511
|
+
const logAttributes = {
|
512
|
+
traceEndpoints: [],
|
513
|
+
contextManager: false
|
514
|
+
};
|
515
|
+
let integrationName;
|
516
|
+
if (openTelemetry) {
|
517
|
+
const otelEndpoint = typeof openTelemetry === "string" ? openTelemetry : getEnvVar("OTEL_EXPORTER_OTLP_ENDPOINT", void 0);
|
518
|
+
log.debug({ exporterType, otelEndpoint }, "Setting up OTLP Exporter");
|
519
|
+
integrationName = "OpenTelemetry";
|
520
|
+
logAttributes.traceEndpoints.push({
|
521
|
+
url: otelEndpoint ?? null,
|
522
|
+
type: exporterType
|
523
|
+
});
|
524
|
+
log.debug({ type: exporterType }, "Loading OpenTelemetry exporter");
|
525
|
+
const { OTLPTraceExporter } = await import(`@opentelemetry/exporter-trace-${exporterType}`);
|
526
|
+
processors.push(
|
527
|
+
new sdkTraceBase.BatchSpanProcessor(new OTLPTraceExporter({ url: otelEndpoint }))
|
515
528
|
);
|
516
|
-
process.exit(1);
|
517
529
|
}
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
+
if (accessToken) {
|
531
|
+
log.debug({ target, traceEndpoint }, "Setting up Hive Tracing");
|
532
|
+
integrationName ??= "Hive Tracing";
|
533
|
+
if (!target) {
|
534
|
+
ctx.log.error(
|
535
|
+
'Hive tracing needs a target. Please provide it through "--hive-target <target>"'
|
536
|
+
);
|
537
|
+
process.exit(1);
|
538
|
+
}
|
539
|
+
logAttributes.traceEndpoints.push({
|
540
|
+
url: traceEndpoint,
|
541
|
+
type: "hive tracing",
|
542
|
+
target
|
543
|
+
});
|
544
|
+
processors.push(
|
545
|
+
new HiveTracingSpanProcessor({
|
546
|
+
accessToken,
|
547
|
+
target,
|
548
|
+
endpoint: traceEndpoint
|
549
|
+
})
|
550
|
+
);
|
551
|
+
}
|
552
|
+
log.debug("Trying to load AsyncLocalStorage based Context Manager");
|
553
|
+
const contextManager = await import('@opentelemetry/context-async-hooks').then((module) => {
|
554
|
+
logAttributes.contextManager = true;
|
555
|
+
return new module.AsyncLocalStorageContextManager();
|
556
|
+
}).catch(() => null);
|
557
|
+
openTelemetrySetup({
|
558
|
+
traces: { processors },
|
559
|
+
contextManager
|
560
|
+
});
|
561
|
+
log.info(logAttributes, `${integrationName} integration is enabled`);
|
562
|
+
return true;
|
530
563
|
});
|
531
564
|
}
|
565
|
+
return false;
|
532
566
|
}
|
533
567
|
|
534
568
|
function handleReportingConfig(ctx, loadedConfig, cliOpts) {
|
@@ -637,7 +671,7 @@ const addCommand$2 = (ctx, cli) => cli.command("proxy").description(
|
|
637
671
|
...opts
|
638
672
|
} = this.optsWithGlobals();
|
639
673
|
ctx.log.info(`Starting ${ctx.productName} ${ctx.version} in proxy mode`);
|
640
|
-
await handleOpenTelemetryConfig(ctx, {
|
674
|
+
const openTelemetryEnabledByCLI = await handleOpenTelemetryConfig(ctx, {
|
641
675
|
openTelemetry: opentelemetry,
|
642
676
|
openTelemetryExporterType: opentelemetryExporterType,
|
643
677
|
hiveTarget,
|
@@ -723,7 +757,7 @@ const addCommand$2 = (ctx, cli) => cli.command("proxy").description(
|
|
723
757
|
{
|
724
758
|
...loadedConfig,
|
725
759
|
...opts,
|
726
|
-
openTelemetry:
|
760
|
+
openTelemetry: openTelemetryEnabledByCLI ? { ...loadedConfig.openTelemetry, traces: true } : loadedConfig.openTelemetry
|
727
761
|
},
|
728
762
|
{
|
729
763
|
log: ctx.log,
|
@@ -813,7 +847,7 @@ const addCommand$1 = (ctx, cli) => cli.command("subgraph").description(
|
|
813
847
|
...opts
|
814
848
|
} = this.optsWithGlobals();
|
815
849
|
ctx.log.info(`Starting ${ctx.productName} ${ctx.version} as subgraph`);
|
816
|
-
await handleOpenTelemetryConfig(ctx, {
|
850
|
+
const openTelemetryEnabledByCLI = await handleOpenTelemetryConfig(ctx, {
|
817
851
|
openTelemetry: opentelemetry,
|
818
852
|
openTelemetryExporterType: opentelemetryExporterType,
|
819
853
|
hiveTarget,
|
@@ -861,7 +895,7 @@ const addCommand$1 = (ctx, cli) => cli.command("subgraph").description(
|
|
861
895
|
{
|
862
896
|
...loadedConfig,
|
863
897
|
...opts,
|
864
|
-
openTelemetry:
|
898
|
+
openTelemetry: openTelemetryEnabledByCLI ? { ...loadedConfig.openTelemetry, traces: true } : loadedConfig.openTelemetry
|
865
899
|
},
|
866
900
|
{
|
867
901
|
log: ctx.log,
|
@@ -977,7 +1011,7 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
|
|
977
1011
|
ctx.log.info(
|
978
1012
|
`Starting ${ctx.productName} ${ctx.version} with supergraph`
|
979
1013
|
);
|
980
|
-
await handleOpenTelemetryConfig(ctx, {
|
1014
|
+
const openTelemetryEnabledByCLI = await handleOpenTelemetryConfig(ctx, {
|
981
1015
|
openTelemetry: opentelemetry,
|
982
1016
|
openTelemetryExporterType: opentelemetryExporterType,
|
983
1017
|
hiveTarget,
|
@@ -1095,7 +1129,7 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
|
|
1095
1129
|
{
|
1096
1130
|
...loadedConfig,
|
1097
1131
|
...opts,
|
1098
|
-
openTelemetry:
|
1132
|
+
openTelemetry: openTelemetryEnabledByCLI ? { ...loadedConfig.openTelemetry, traces: true } : loadedConfig.openTelemetry
|
1099
1133
|
},
|
1100
1134
|
{
|
1101
1135
|
log: ctx.log,
|
@@ -1388,8 +1422,8 @@ let cli = new extraTypings.Command().configureHelp({
|
|
1388
1422
|
).addOption(
|
1389
1423
|
new extraTypings.Option(
|
1390
1424
|
"--hive-trace-endpoint <endpoint>",
|
1391
|
-
`Hive registry
|
1392
|
-
).env("HIVE_TRACE_ENDPOINT")
|
1425
|
+
`Hive registry tracing endpoint.`
|
1426
|
+
).env("HIVE_TRACE_ENDPOINT").default(`https://api.graphql-hive.com/otel/v1/traces`)
|
1393
1427
|
).option(
|
1394
1428
|
"--hive-persisted-documents-endpoint <endpoint>",
|
1395
1429
|
'[EXPERIMENTAL] Hive CDN endpoint for fetching the persisted documents. Requires the "--hive-persisted-documents-token <token>" option'
|
package/dist/index.cjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var cli = require('./cli-
|
3
|
+
var cli = require('./cli-CQdLYWjW.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,8 +30,8 @@ require('node:url');
|
|
30
30
|
require('node:fs');
|
31
31
|
require('node:http');
|
32
32
|
require('node:https');
|
33
|
-
require('@opentelemetry/sdk-trace-base');
|
34
33
|
require('@graphql-tools/utils');
|
34
|
+
require('@opentelemetry/sdk-trace-base');
|
35
35
|
require('@graphql-tools/code-file-loader');
|
36
36
|
require('@graphql-tools/graphql-file-loader');
|
37
37
|
require('@graphql-tools/load');
|
package/dist/index.d.cts
CHANGED
@@ -276,7 +276,7 @@ declare let cli: Command<[], {
|
|
276
276
|
hiveAccessToken?: string | undefined;
|
277
277
|
hiveUsageAccessToken?: string | undefined;
|
278
278
|
hiveTraceAccessToken?: string | undefined;
|
279
|
-
hiveTraceEndpoint
|
279
|
+
hiveTraceEndpoint: string;
|
280
280
|
hivePersistedDocumentsEndpoint?: string | undefined;
|
281
281
|
hivePersistedDocumentsToken?: string | undefined;
|
282
282
|
hiveCdnEndpoint?: string | undefined;
|
@@ -301,7 +301,7 @@ declare function run(userCtx: Partial<CLIContext>): Promise<Command<[], {
|
|
301
301
|
hiveAccessToken?: string | undefined;
|
302
302
|
hiveUsageAccessToken?: string | undefined;
|
303
303
|
hiveTraceAccessToken?: string | undefined;
|
304
|
-
hiveTraceEndpoint
|
304
|
+
hiveTraceEndpoint: string;
|
305
305
|
hivePersistedDocumentsEndpoint?: string | undefined;
|
306
306
|
hivePersistedDocumentsToken?: string | undefined;
|
307
307
|
hiveCdnEndpoint?: string | undefined;
|
package/dist/index.d.ts
CHANGED
@@ -276,7 +276,7 @@ declare let cli: Command<[], {
|
|
276
276
|
hiveAccessToken?: string | undefined;
|
277
277
|
hiveUsageAccessToken?: string | undefined;
|
278
278
|
hiveTraceAccessToken?: string | undefined;
|
279
|
-
hiveTraceEndpoint
|
279
|
+
hiveTraceEndpoint: string;
|
280
280
|
hivePersistedDocumentsEndpoint?: string | undefined;
|
281
281
|
hivePersistedDocumentsToken?: string | undefined;
|
282
282
|
hiveCdnEndpoint?: string | undefined;
|
@@ -301,7 +301,7 @@ declare function run(userCtx: Partial<CLIContext>): Promise<Command<[], {
|
|
301
301
|
hiveAccessToken?: string | undefined;
|
302
302
|
hiveUsageAccessToken?: string | undefined;
|
303
303
|
hiveTraceAccessToken?: string | undefined;
|
304
|
-
hiveTraceEndpoint
|
304
|
+
hiveTraceEndpoint: string;
|
305
305
|
hivePersistedDocumentsEndpoint?: string | undefined;
|
306
306
|
hivePersistedDocumentsToken?: string | undefined;
|
307
307
|
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-
|
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-C8SAeNPg.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,8 +29,8 @@ import 'node:url';
|
|
29
29
|
import 'node:fs';
|
30
30
|
import 'node:http';
|
31
31
|
import 'node:https';
|
32
|
-
import '@opentelemetry/sdk-trace-base';
|
33
32
|
import '@graphql-tools/utils';
|
33
|
+
import '@opentelemetry/sdk-trace-base';
|
34
34
|
import '@graphql-tools/code-file-loader';
|
35
35
|
import '@graphql-tools/graphql-file-loader';
|
36
36
|
import '@graphql-tools/load';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@graphql-hive/gateway",
|
3
|
-
"version": "2.0.0-alpha-
|
3
|
+
"version": "2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
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-
|
57
|
-
"@graphql-hive/importer": "2.0.0-alpha-
|
58
|
-
"@graphql-hive/logger": "1.0.1-alpha-
|
59
|
-
"@graphql-hive/plugin-aws-sigv4": "2.0.0-alpha-
|
60
|
-
"@graphql-hive/plugin-deduplicate-request": "2.0.0-alpha-
|
61
|
-
"@graphql-hive/pubsub": "2.0.0-alpha-
|
56
|
+
"@graphql-hive/gateway-runtime": "2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
57
|
+
"@graphql-hive/importer": "2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
58
|
+
"@graphql-hive/logger": "1.0.1-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
59
|
+
"@graphql-hive/plugin-aws-sigv4": "2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
60
|
+
"@graphql-hive/plugin-deduplicate-request": "2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
61
|
+
"@graphql-hive/pubsub": "2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
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-
|
67
|
+
"@graphql-mesh/hmac-upstream-signature": "2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
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-
|
71
|
-
"@graphql-mesh/plugin-opentelemetry": "2.0.0-alpha-
|
72
|
-
"@graphql-mesh/plugin-prometheus": "2.0.0-alpha-
|
70
|
+
"@graphql-mesh/plugin-jwt-auth": "2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
71
|
+
"@graphql-mesh/plugin-opentelemetry": "2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
72
|
+
"@graphql-mesh/plugin-prometheus": "2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
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-
|
76
|
-
"@graphql-mesh/transport-http-callback": "1.0.0-alpha-
|
77
|
-
"@graphql-mesh/transport-ws": "2.0.0-alpha-
|
75
|
+
"@graphql-mesh/transport-http": "1.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
76
|
+
"@graphql-mesh/transport-http-callback": "1.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
77
|
+
"@graphql-mesh/transport-ws": "2.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
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",
|
@@ -103,7 +103,7 @@
|
|
103
103
|
"ws": "^8.18.3"
|
104
104
|
},
|
105
105
|
"devDependencies": {
|
106
|
-
"@graphql-mesh/transport-common": "1.0.0-alpha-
|
106
|
+
"@graphql-mesh/transport-common": "1.0.0-alpha-d94711dad9603bf7cee45770805e1d9026d17e52",
|
107
107
|
"@graphql-mesh/transport-soap": "^0.10.6",
|
108
108
|
"@graphql-tools/executor": "^1.4.7",
|
109
109
|
"@rollup/plugin-commonjs": "^28.0.0",
|