|
9 | 9 | import io.apitally.common.dto.Request; |
10 | 10 | import io.apitally.common.dto.RequestLogItem; |
11 | 11 | import io.apitally.common.dto.Response; |
12 | | -import io.apitally.common.dto.SpanData; |
13 | 12 | import java.io.IOException; |
14 | 13 | import java.net.MalformedURLException; |
15 | 14 | import java.net.URL; |
@@ -127,13 +126,7 @@ public void setSuspendUntil(long timestamp) { |
127 | 126 | this.suspendUntil = timestamp; |
128 | 127 | } |
129 | 128 |
|
130 | | - public void logRequest( |
131 | | - Request request, |
132 | | - Response response, |
133 | | - Exception exception, |
134 | | - List<LogRecord> logs, |
135 | | - List<SpanData> spans, |
136 | | - String traceId) { |
| 129 | + public void logRequest(Request request, Response response, Exception exception, List<LogRecord> logs) { |
137 | 130 | if (!enabled || suspendUntil != null && suspendUntil > System.currentTimeMillis()) { |
138 | 131 | return; |
139 | 132 | } |
@@ -171,12 +164,7 @@ public void logRequest( |
171 | 164 | logs = null; |
172 | 165 | } |
173 | 166 |
|
174 | | - if (!config.isTracingEnabled()) { |
175 | | - spans = null; |
176 | | - traceId = null; |
177 | | - } |
178 | | - |
179 | | - RequestLogItem item = new RequestLogItem(request, response, exceptionDto, logs, spans, traceId); |
| 167 | + RequestLogItem item = new RequestLogItem(request, response, exceptionDto, logs); |
180 | 168 | pendingWrites.add(item); |
181 | 169 |
|
182 | 170 | if (pendingWrites.size() > MAX_PENDING_WRITES) { |
@@ -284,12 +272,6 @@ public void writeToFile() throws IOException { |
284 | 272 | if (item.getLogs() != null && !item.getLogs().isEmpty()) { |
285 | 273 | itemNode.set("logs", objectMapper.valueToTree(item.getLogs())); |
286 | 274 | } |
287 | | - if (item.getSpans() != null && !item.getSpans().isEmpty()) { |
288 | | - itemNode.set("spans", objectMapper.valueToTree(item.getSpans())); |
289 | | - } |
290 | | - if (item.getTraceId() != null && !item.getTraceId().isEmpty()) { |
291 | | - itemNode.put("trace_id", item.getTraceId()); |
292 | | - } |
293 | 275 |
|
294 | 276 | String serializedItem = objectMapper.writeValueAsString(itemNode); |
295 | 277 | currentFile.writeLine(serializedItem.getBytes(StandardCharsets.UTF_8)); |
|
0 commit comments