Skip to content

Commit a5a31ee

Browse files
authored
Reduce super-noisy traces (#16507)
* [messagebus] Stop reporting messagebus spans * [server] Don't trace individual updates to clients
1 parent 74e2fee commit a5a31ee

File tree

3 files changed

+8
-39
lines changed

3 files changed

+8
-39
lines changed

components/gitpod-messagebus/src/messagebus.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Disposable } from "@gitpod/gitpod-protocol";
1010
import { log } from "@gitpod/gitpod-protocol/lib/util/logging";
1111
import { MessagebusConfiguration } from "./config";
1212
import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing";
13-
import { globalTracer, FORMAT_HTTP_HEADERS, childOf } from "opentracing";
13+
import { globalTracer, FORMAT_HTTP_HEADERS } from "opentracing";
1414
import { CancellationToken } from "vscode-jsonrpc/lib/cancellation";
1515

1616
export type WorkspaceSubtopic = "updates" | "log" | "credit" | "headless-log" | "ports";
@@ -540,22 +540,11 @@ export abstract class AbstractTopicListener<T> implements MessagebusListener {
540540
}
541541

542542
if (msg) {
543-
const spanCtx = globalTracer().extract(FORMAT_HTTP_HEADERS, message.properties.headers);
544-
let span;
545-
if (!!spanCtx && !!spanCtx.toTraceId()) {
546-
span = globalTracer().startSpan(`/messagebus/${this.exchangeName}`, {
547-
references: [childOf(spanCtx!)],
548-
});
549-
}
550-
543+
// gpl: We decided against tracing here because of the low signal/noise ratio (see history)
551544
try {
552-
this.listener({ span }, msg, message.fields.routingKey);
545+
this.listener({}, msg, message.fields.routingKey);
553546
} catch (e) {
554547
log.error("Error while executing message handler", e, { message });
555-
} finally {
556-
if (span) {
557-
span.finish();
558-
}
559548
}
560549
}
561550
}

components/server/src/workspace/gitpod-server-impl.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ import { ProjectsService } from "../projects/projects-service";
161161
import { LocalMessageBroker } from "../messaging/local-message-broker";
162162
import { IDEOptions } from "@gitpod/gitpod-protocol/lib/ide-protocol";
163163
import { PartialProject } from "@gitpod/gitpod-protocol/lib/teams-projects-protocol";
164-
import { ClientMetadata, traceClientMetadata } from "../websocket/websocket-connection-manager";
164+
import { ClientMetadata } from "../websocket/websocket-connection-manager";
165165
import { ConfigurationService } from "../config/configuration-service";
166166
import { EnvVarWithValue, ProjectEnvVar } from "@gitpod/gitpod-protocol/lib/protocol";
167167
import { InstallationAdminSettings, TelemetryData } from "@gitpod/gitpod-protocol";
@@ -334,16 +334,8 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
334334
}
335335

336336
protected forwardInstanceUpdateToClient(ctx: TraceContext, instance: WorkspaceInstance) {
337-
TraceContext.withSpan(
338-
"forwardInstanceUpdateToClient",
339-
(ctx) => {
340-
traceClientMetadata(ctx, this.clientMetadata);
341-
TraceContext.setJsonRPCMetadata(ctx, "onInstanceUpdate");
342-
343-
this.client?.onInstanceUpdate(this.censorInstance(instance));
344-
},
345-
ctx,
346-
);
337+
// gpl: We decided against tracing updates here, because it create far too much noise (cmp. history)
338+
this.client?.onInstanceUpdate(this.censorInstance(instance));
347339
}
348340

349341
setClient(ctx: TraceContext, client: GitpodApiClient | undefined): void {

components/server/src/workspace/messagebus-integration.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { log } from "@gitpod/gitpod-protocol/lib/util/logging";
1818
import { HeadlessWorkspaceEvent, HeadlessWorkspaceEventType } from "@gitpod/gitpod-protocol/lib/headless-workspace-log";
1919
import { Channel, Message } from "amqplib";
2020
import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing";
21-
import * as opentracing from "opentracing";
2221
import { CancellationTokenSource } from "vscode-ws-jsonrpc";
2322
import { increaseMessagebusTopicReads } from "../prometheus-metrics";
2423
import { CreditAlert } from "@gitpod/gitpod-protocol/lib/accounting-protocol";
@@ -108,15 +107,7 @@ export class PrebuildUpdatableQueueListener implements MessagebusListener {
108107
this.channel.ack(message);
109108
}
110109

111-
const spanCtx = opentracing.globalTracer().extract(opentracing.FORMAT_HTTP_HEADERS, message.properties.headers);
112-
let span;
113-
if (!!spanCtx && !!spanCtx.toTraceId()) {
114-
span = opentracing
115-
.globalTracer()
116-
.startSpan(`/messagebus/${MessageBusHelperImpl.PREBUILD_UPDATABLE_QUEUE}`, {
117-
references: [opentracing.childOf(spanCtx!)],
118-
});
119-
}
110+
// gpl: We decided against tracing here because of the low signal/noise ratio (see history)
120111

121112
let msg: any | undefined;
122113
try {
@@ -129,13 +120,10 @@ export class PrebuildUpdatableQueueListener implements MessagebusListener {
129120

130121
if (msg) {
131122
try {
132-
this.callback({ span }, msg);
123+
this.callback({}, msg);
133124
} catch (e) {
134125
log.error("Error while executing message handler", e, { message });
135126
} finally {
136-
if (span) {
137-
span.finish();
138-
}
139127
}
140128
}
141129
}

0 commit comments

Comments
 (0)