Skip to content

Commit 91f9fa3

Browse files
committed
refactor: wire up OtlpTraceService to workload server, delete old otlpTrace module
1 parent 18eb7bb commit 91f9fa3

2 files changed

Lines changed: 9 additions & 22 deletions

File tree

apps/supervisor/src/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class ManagedSupervisor {
4444

4545
private readonly podCleaner?: PodCleaner;
4646
private readonly failedPodHandler?: FailedPodHandler;
47+
private readonly tracing?: OtlpTraceService;
4748

4849
private readonly isKubernetes = isKubernetesEnvironment(env.KUBERNETES_FORCE_ENABLED);
4950
private readonly warmStartUrl = env.TRIGGER_WARM_START_URL;
@@ -92,6 +93,12 @@ class ManagedSupervisor {
9293

9394
const callbackUrl = `${env.TRIGGER_WORKLOAD_API_PROTOCOL}://${env.TRIGGER_WORKLOAD_API_DOMAIN}:${env.TRIGGER_WORKLOAD_API_PORT_EXTERNAL}/api/v1/compute/snapshot-complete`;
9495

96+
if (env.COMPUTE_TRACE_SPANS_ENABLED) {
97+
this.tracing = new OtlpTraceService({
98+
endpointUrl: env.OTEL_EXPORTER_OTLP_ENDPOINT,
99+
});
100+
}
101+
95102
const computeManager = new ComputeWorkloadManager({
96103
...workloadManagerOptions,
97104
gateway: {
@@ -104,9 +111,7 @@ class ManagedSupervisor {
104111
delayMs: env.COMPUTE_SNAPSHOT_DELAY_MS,
105112
callbackUrl,
106113
},
107-
tracing: env.COMPUTE_TRACE_SPANS_ENABLED
108-
? new OtlpTraceService({ endpointUrl: env.OTEL_EXPORTER_OTLP_ENDPOINT })
109-
: undefined,
114+
tracing: this.tracing,
110115
runner: {
111116
instanceName: env.TRIGGER_WORKER_INSTANCE_NAME,
112117
otelEndpoint: env.OTEL_EXPORTER_OTLP_ENDPOINT,
@@ -404,6 +409,7 @@ class ManagedSupervisor {
404409
workerClient: this.workerSession.httpClient,
405410
checkpointClient: this.checkpointClient,
406411
computeManager: this.computeManager,
412+
tracing: this.tracing,
407413
});
408414

409415
this.workloadServer.on("runConnected", this.onRunConnected.bind(this));

apps/supervisor/src/otlpTrace.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)