|
1 | 1 | // @ts-expect-error not a dependency
|
2 |
| -import { defineConfig } from '@graphql-hive/gateway'; |
3 |
| -// @ts-expect-error not a dependency |
4 |
| -import { openTelemetrySetup } from '@graphql-hive/gateway/opentelemetry/setup'; |
5 |
| -import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks'; |
6 |
| -import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'; |
7 |
| - |
8 |
| -openTelemetrySetup({ |
9 |
| - // Mandatory: It depends on the available API in your runtime. |
10 |
| - // We recommend AsyncLocalStorage based manager when possible. |
11 |
| - // `@opentelemetry/context-zone` is also available for other runtimes. |
12 |
| - // Pass `false` to disable context manager usage. |
13 |
| - contextManager: new AsyncLocalStorageContextManager(), |
14 |
| - |
15 |
| - traces: { |
16 |
| - // Define your exporter, most of the time the OTLP HTTP one. Traces are batched by default. |
17 |
| - exporter: new OTLPTraceExporter({ url: process.env['OPENTELEMETRY_COLLECTOR_ENDPOINT']! }), |
18 |
| - // You can easily enable a console exporter for quick debug |
19 |
| - console: process.env['DEBUG_TRACES'] === '1', |
20 |
| - }, |
21 |
| -}); |
| 2 | +import { createOtlpHttpExporter, defineConfig } from '@graphql-hive/gateway'; |
22 | 3 |
|
23 | 4 | const defaultQuery = `#
|
24 | 5 | # Welcome to the Hive Console GraphQL API.
|
@@ -53,6 +34,11 @@ export const gatewayConfig = defineConfig({
|
53 | 34 | openTelemetry: process.env['OPENTELEMETRY_COLLECTOR_ENDPOINT']
|
54 | 35 | ? {
|
55 | 36 | serviceName: 'public-graphql-api-gateway',
|
| 37 | + exporters: [ |
| 38 | + createOtlpHttpExporter({ |
| 39 | + url: process.env['OPENTELEMETRY_COLLECTOR_ENDPOINT'], |
| 40 | + }), |
| 41 | + ], |
56 | 42 | }
|
57 | 43 | : false,
|
58 | 44 | demandControl: {
|
|
0 commit comments