@@ -1140,7 +1140,6 @@ import { defineConfig } from '@graphql-hive/gateway'
1140
1140
1141
1141
export const gatewayConfig = defineConfig ({
1142
1142
openTelemetry: {
1143
- ... ctx ,
1144
1143
// Use the default DiagLogger, which outputs logs directly to stdout
1145
1144
configureDiagLogger: false
1146
1145
}
@@ -1190,7 +1189,6 @@ import { defineConfig } from '@graphql-hive/gateway'
1190
1189
1191
1190
export const gatewayConfig = defineConfig ({
1192
1191
openTelemetry: {
1193
- ... ctx ,
1194
1192
// Disable the auto-flush on shutdown
1195
1193
flushOnDispose: false ,
1196
1194
// or call a custom method
@@ -1225,6 +1223,54 @@ export const gateway = createGatewayRuntime({
1225
1223
1226
1224
</Tabs >
1227
1225
1226
+
1227
+ #### Tracer
1228
+
1229
+ By default, Hive Gateway will create a tracer named ` gateway ` . You can provide your own tracer if needed.
1230
+
1231
+ <Tabs items = { [<div >Hive Gateway <code >opentelemetrySetup()</code > (recommended)</div >, <div >OpenTelemetry <code >NodeSDK</code ></div >]} >
1232
+
1233
+ <Tabs.Tab >
1234
+
1235
+ ``` ts filename="gateway.config.ts"
1236
+ import ' ./telemetry.ts'
1237
+ import { defineConfig } from ' @graphql-hive/gateway'
1238
+ import { trace } from ' @opentelemetry/api'
1239
+
1240
+ export const gatewayConfig = defineConfig ({
1241
+ openTelemetry: {
1242
+ traces: {
1243
+ tracer: trace .getTracer (' my-custom-tracer' )
1244
+ }
1245
+ }
1246
+ })
1247
+ ```
1248
+
1249
+ </Tabs.Tab >
1250
+
1251
+ <Tabs.Tab >
1252
+
1253
+ ``` ts filename="gateway.config.ts"
1254
+ import ' ./telemetry.ts'
1255
+ import { createGatewayRuntime } from ' @graphql-hive/gateway-runtime'
1256
+ import { useOpenTelemetry } from ' @graphql-mesh/plugin-opentelemetry'
1257
+
1258
+ export const gateway = createGatewayRuntime ({
1259
+ plugins : ctx => [
1260
+ useOpenTelemetry ({
1261
+ ... ctx ,
1262
+ traces: {
1263
+ tracer: trace .getTracer (' my-custom-tracer' )
1264
+ }
1265
+ })
1266
+ ]
1267
+ })
1268
+ ```
1269
+
1270
+ </Tabs.Tab >
1271
+
1272
+ </Tabs >
1273
+
1228
1274
### Reported Spans
1229
1275
1230
1276
The plugin exports the following OpenTelemetry Spans:
0 commit comments