fix: extract snapshot data from chunks, reduce ClickHouse log noise
- ChunkAccumulator now extracts inputBody/outputBody/inputHeaders/outputHeaders from ExecutionChunk.inputSnapshot/outputSnapshot instead of storing empty strings - Set ClickHouse server log level to warning (was trace by default) - Update CLAUDE.md to document Ed25519 key derivation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.cameleer3.server.core.ingestion;
|
||||
|
||||
import com.cameleer3.common.model.ExchangeSnapshot;
|
||||
import com.cameleer3.common.model.ExecutionChunk;
|
||||
import com.cameleer3.common.model.FlatProcessorRecord;
|
||||
import com.cameleer3.server.core.storage.DiagramStore;
|
||||
@@ -140,6 +141,8 @@ public class ChunkAccumulator {
|
||||
merged.setSpanId(coalesce(newer.getSpanId(), older.getSpanId()));
|
||||
merged.setOriginalExchangeId(coalesce(newer.getOriginalExchangeId(), older.getOriginalExchangeId()));
|
||||
merged.setReplayExchangeId(coalesce(newer.getReplayExchangeId(), older.getReplayExchangeId()));
|
||||
merged.setInputSnapshot(coalesce(newer.getInputSnapshot(), older.getInputSnapshot()));
|
||||
merged.setOutputSnapshot(coalesce(newer.getOutputSnapshot(), older.getOutputSnapshot()));
|
||||
merged.setChunkSeq(Math.max(newer.getChunkSeq(), older.getChunkSeq()));
|
||||
merged.setFinal(newer.isFinal() || older.isFinal());
|
||||
merged.setProcessors(List.of()); // processors are handled separately
|
||||
@@ -182,10 +185,10 @@ public class ChunkAccumulator {
|
||||
envelope.getRootCauseMessage(),
|
||||
diagramHash,
|
||||
envelope.getEngineLevel(),
|
||||
"", // inputBody — on processor records now
|
||||
"", // outputBody
|
||||
"", // inputHeaders
|
||||
"", // outputHeaders
|
||||
extractBody(envelope.getInputSnapshot()),
|
||||
extractBody(envelope.getOutputSnapshot()),
|
||||
extractHeaders(envelope.getInputSnapshot()),
|
||||
extractHeaders(envelope.getOutputSnapshot()),
|
||||
serializeAttributes(envelope.getAttributes()),
|
||||
envelope.getTraceId(),
|
||||
envelope.getSpanId(),
|
||||
@@ -196,6 +199,21 @@ public class ChunkAccumulator {
|
||||
);
|
||||
}
|
||||
|
||||
private static String extractBody(ExchangeSnapshot snapshot) {
|
||||
if (snapshot == null || snapshot.getBody() == null) return "";
|
||||
return snapshot.getBody();
|
||||
}
|
||||
|
||||
private static String extractHeaders(ExchangeSnapshot snapshot) {
|
||||
if (snapshot == null || snapshot.getHeaders() == null) return "";
|
||||
try {
|
||||
return MAPPER.writeValueAsString(snapshot.getHeaders());
|
||||
} catch (JsonProcessingException e) {
|
||||
log.warn("Failed to serialize snapshot headers", e);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private static String serializeAttributes(Map<String, String> attributes) {
|
||||
if (attributes == null || attributes.isEmpty()) {
|
||||
return "{}";
|
||||
|
||||
Reference in New Issue
Block a user