public PersistedTrace(TraceId id, Time timestampValue, byte[] traceBytes) { this.traceId = id.toString(); this.timestamp = timestampValue; this.bytes = traceBytes; }
public PersistedTraceSummary getTraceSummary(TraceId id) { return entityManager.createNamedQuery(QUERY_SUMMARY_BY_TRACE_ID, PersistedTraceSummary.class) .setParameter("traceId", id.toString()) .getSingleResult(); }
public TraceRegionKey(TraceId id, Time timestampValue) { this.traceId = id.toString(); this.timestamp = timestampValue.getNanos(); }
private void addTraceIdResponseHeader(Response response, TraceId traceId) { response.addHeader("X-TraceId", traceId.toString()); try { // TODO make URL configurable response.addHeader("X-TraceUrl", "/insight/services/traces/" + URLEncoder.encode(traceId.toString(), response.getCharacterEncoding()) + "?type=json"); } catch (UnsupportedEncodingException e) { // ignore } }
public PersistedTraceSummary(String traceLabel, TraceId traceId, TimeRange range, int errCount, String errText, Set<PersistedTag> tagSet, ServerName server, ApplicationName app, EndPointName endPoint) { this.label = (traceLabel.length() > 255) ? traceLabel.substring(0, 255) : traceLabel; this.serverName = server == null ? null : server.getName(); this.appName = app == null ? null : app.getName(); this.endpointName = endPoint == null ? null : endPoint.getName(); this.traceIdStr = traceId.toString(); this.rangeStart = range.getStart(); this.rangeEnd = range.getEnd(); this.responseTime = range.getDuration(); this.errorCount = errCount; this.errorText = errText; this.tags.addAll(tagSet); }