You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using version 2.11.0 of the quarkus-google-cloud-logging quarkiverse extension so that I can include tracing information when logging to GCP.
Following the instructions here I've implemented a TraceInfoExtractor that returns the current trace and span ids.
However the resulting payload, while it includes the trace in the format GCP expects, does not include the logging.googleapis.com/spanId value, and logging.googleapis.com/trace_sampled is left defaulted to false.
Without these additional fields, it is not possible to navigate between traces and logs in the GCP console.
As far as I can see the issue is in the LoggingHandler#transform method from this extension, which omits to call the builder methods to set these (see java comments):
privateLogEntrytransform(ExtLogRecordrecord, TraceInfotrace) {
Payload<?> payload = internalHandler.transform(record, trace);
if (payload != null) {
com.google.cloud.logging.LogEntry.Builderbuilder = LogEntry.newBuilder(payload)
.setSeverity(LevelTransformer.toSeverity(record.getLevel()))
.setTimestamp(record.getInstant());
/* * Ideally should be setting labels for logging here too i.e. * * builder.addLabel("levelName", LevelTransformer.toSeverity(record.getLevel()).toString()) * builder.addLabel("levelValue", String.valueOf(level.intValue())) * builder.addLabel("loggerName", extLogRecord.getSourceClassName()) */if (this.config.gcpTracing().enabled() && trace != null && !Strings.isNullOrEmpty(trace.getTraceId())) {
builder = builder.setTrace(composeTraceString(trace.getTraceId()));
/* Should also be setting these for integrated log/tracing support: * builder.setSpan(trace.getSpanId()) * builder.setTraceSampled(true) */
}
returnbuilder.build();
} else {
returnnull;
}
}
The text was updated successfully, but these errors were encountered:
I'm using version 2.11.0 of the quarkus-google-cloud-logging quarkiverse extension so that I can include tracing information when logging to GCP.
Following the instructions here I've implemented a TraceInfoExtractor that returns the current trace and span ids.
However the resulting payload, while it includes the trace in the format GCP expects, does not include the
logging.googleapis.com/spanId
value, andlogging.googleapis.com/trace_sampled
is left defaulted to false.Without these additional fields, it is not possible to navigate between traces and logs in the GCP console.
As far as I can see the issue is in the
LoggingHandler#transform
method from this extension, which omits to call the builder methods to set these (see java comments):The text was updated successfully, but these errors were encountered: