-
Notifications
You must be signed in to change notification settings - Fork 121
chore: use hive console in addition to additional trace collector #7104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
0a7e3a3
fc0351e
fc2546e
4e3f9c2
9e6715a
c04bf43
696f5c0
cb40d28
13de6bd
237aab5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,13 @@ import { type Docker } from './docker'; | |
import { type Environment } from './environment'; | ||
import { type GraphQL } from './graphql'; | ||
import { type Observability } from './observability'; | ||
import { type OTELCollector } from './otel-collector'; | ||
|
||
/** | ||
* Hive Gateway Docker Image Version | ||
* Bump this to update the used gateway version. | ||
*/ | ||
const dockerImage = 'ghcr.io/graphql-hive/gateway:2.1.8'; | ||
const dockerImage = 'ghcr.io/graphql-hive/gateway:2.1.10'; | ||
|
||
const gatewayConfigDirectory = path.resolve( | ||
__dirname, | ||
|
@@ -32,6 +33,7 @@ export function deployPublicGraphQLAPIGateway(args: { | |
graphql: GraphQL; | ||
docker: Docker; | ||
observability: Observability; | ||
otelCollector: OTELCollector; | ||
}) { | ||
const apiConfig = new pulumi.Config('api'); | ||
|
||
|
@@ -43,6 +45,11 @@ export function deployPublicGraphQLAPIGateway(args: { | |
throw new Error("Missing cdn endpoint variable 'HIVE_PERSISTED_DOCUMENTS_CDN_ENDPOINT'."); | ||
} | ||
|
||
const hiveConfig = new pulumi.Config('hive'); | ||
const hiveConfigSecrets = new ServiceSecret('hive-secret', { | ||
otelTraceAccessToken: hiveConfig.requireSecret('otelTraceAccessToken'), | ||
}); | ||
|
||
const supergraphEndpoint = cdnEndpoint + '/contracts/public'; | ||
|
||
// Note: The persisted documents access key is also valid for reading the supergraph | ||
|
@@ -69,6 +76,13 @@ export function deployPublicGraphQLAPIGateway(args: { | |
), | ||
SUPERGRAPH_ENDPOINT: supergraphEndpoint, | ||
OPENTELEMETRY_COLLECTOR_ENDPOINT: args.observability.tracingEndpoint ?? '', | ||
|
||
// Hive Console OTEL Tracing configuration | ||
HIVE_HIVE_TRACE_ENDPOINT: serviceLocalEndpoint(args.otelCollector.service).apply( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why double: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's actually only on |
||
value => `${value}/v1/traces`, | ||
), | ||
HIVE_HIVE_TARGET: hiveConfig.require('target'), | ||
// HIVE_TRACE_ACCESS_TOKEN is a secret | ||
}, | ||
port: 4000, | ||
args: ['-c', '/config/gateway.config.ts', 'supergraph'], | ||
|
@@ -100,6 +114,7 @@ export function deployPublicGraphQLAPIGateway(args: { | |
[args.graphql.deployment, args.graphql.service], | ||
) | ||
.withSecret('HIVE_CDN_ACCESS_TOKEN', publicGraphQLAPISecret, 'cdnAccessKeyId') | ||
.withSecret('HIVE_HIVE_TRACE_ACCESS_TOKEN', hiveConfigSecrets, 'otelTraceAccessToken') | ||
.deploy(); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this impact performance at all, such that we shouldn't add it if only one of the exporters is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably minimal, but yes it always adds a minimal impact. When nothing is configured, OTEL uses a no-op
TracerProvider
which just does nothing at all.