use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class DefaultTraceIdFactory method continueTraceId.
public TraceId continueTraceId(String transactionId, long parentSpanId, long spanId, short flags) {
Objects.requireNonNull(transactionId, "transactionId");
final TransactionId parseId = TransactionIdUtils.parseTransactionId(transactionId);
return new DefaultTraceId(parseId.getAgentId(), parseId.getAgentStartTime(), parseId.getTransactionSequence(), parentSpanId, spanId, flags);
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class BusinessTransactionController method traceViewerData.
@GetMapping(value = "/traceViewerData")
public TraceViewerDataViewModel traceViewerData(@RequestParam("traceId") String traceIdParam, @RequestParam(value = "focusTimestamp", required = false, defaultValue = "0") long focusTimestamp, @RequestParam(value = "agentId", required = false) String agentId, @RequestParam(value = "spanId", required = false, defaultValue = "-1") long spanId) {
logger.debug("GET /traceViewerData params {traceId={}, focusTimestamp={}, agentId={}, spanId={}}", traceIdParam, focusTimestamp, agentId, spanId);
final TransactionId transactionId = TransactionIdUtils.parseTransactionId(traceIdParam);
final ColumnGetCount columnGetCount = ColumnGetCountFactory.create(callstackSelectSpansLimit);
// select spans
Predicate<SpanBo> spanMatchFilter = SpanFilters.spanFilter(spanId, agentId, focusTimestamp);
SpanResult spanResult = this.spanService.selectSpan(transactionId, spanMatchFilter, columnGetCount);
final CallTreeIterator callTreeIterator = spanResult.getCallTree();
RecordSet recordSet = this.transactionInfoService.createRecordSet(callTreeIterator, spanMatchFilter);
return new TraceViewerDataViewModel(recordSet);
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class BusinessTransactionController method transactionInfo.
/**
* info lookup for a selected transaction
*
* @param traceId
* @param focusTimestamp
* @return
*/
@GetMapping(value = "/transactionInfo")
public TransactionInfoViewModel transactionInfo(@RequestParam("traceId") String traceId, @RequestParam(value = "focusTimestamp", required = false, defaultValue = DEFAULT_FOCUS_TIMESTAMP) long focusTimestamp, @RequestParam(value = "agentId", required = false) String agentId, @RequestParam(value = "spanId", required = false, defaultValue = DEFAULT_SPANID) long spanId, @RequestParam(value = "v", required = false, defaultValue = "0") int viewVersion, @RequestParam(value = "useStatisticsAgentState", required = false, defaultValue = "false") boolean useStatisticsAgentState, @RequestParam(value = "useLoadHistogramFormat", required = false, defaultValue = "false") boolean useLoadHistogramFormat) {
logger.debug("GET /transactionInfo params {traceId={}, focusTimestamp={}, agentId={}, spanId={}, v={}}", traceId, focusTimestamp, agentId, spanId, viewVersion);
final TransactionId transactionId = TransactionIdUtils.parseTransactionId(traceId);
final ColumnGetCount columnGetCount = ColumnGetCountFactory.create(callstackSelectSpansLimit);
Predicate<SpanBo> spanMatchFilter = SpanFilters.spanFilter(spanId, agentId, focusTimestamp);
// select spans
final SpanResult spanResult = this.spanService.selectSpan(transactionId, spanMatchFilter, columnGetCount);
final CallTreeIterator callTreeIterator = spanResult.getCallTree();
// application map
FilteredMapServiceOption.Builder optionBuilder = new FilteredMapServiceOption.Builder(transactionId, viewVersion, columnGetCount);
final FilteredMapServiceOption option = optionBuilder.setUseStatisticsAgentState(useStatisticsAgentState).build();
ApplicationMap map = filteredMapService.selectApplicationMap(option);
RecordSet recordSet = this.transactionInfoService.createRecordSet(callTreeIterator, spanMatchFilter);
TransactionInfoViewModel result = new TransactionInfoViewModel(transactionId, spanId, map.getNodes(), map.getLinks(), recordSet, spanResult.getTraceState(), logConfiguration);
if (useLoadHistogramFormat) {
result.setTimeHistogramFormat(TimeHistogramFormat.V2);
}
return result;
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class LinkedCallTree method createMultiChildSpanAlign.
private SpanAlign createMultiChildSpanAlign(short serviceType, long startTime) {
SpanBo spanBo = new SpanBo();
spanBo.setTransactionId(new TransactionId("UNKNOWN", 0, 0));
spanBo.setServiceType(serviceType);
spanBo.setStartTime(startTime);
AnnotationBo multiChildAnnotation = createMultiChildAnnotation();
List<AnnotationBo> annotationBoList = new ArrayList<>();
annotationBoList.add(multiChildAnnotation);
spanBo.setAnnotationBoList(annotationBoList);
return new SpanAlign(spanBo, true);
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class MetaSpanCallTreeFactory method corrupted.
public SpanCallTree corrupted(final String title, final long parentSpanId, final long spanId, final long startTimeMillis) {
final SpanBo rootSpan = new SpanBo();
rootSpan.setParentSpanId(parentSpanId);
rootSpan.setSpanId(spanId);
rootSpan.setStartTime(startTimeMillis);
rootSpan.setTransactionId(new TransactionId(CORRUPTED_AGENT_ID, AGENT_START_TIME, 0));
rootSpan.setAgentId(CORRUPTED_AGENT_ID);
rootSpan.setApplicationId("CORRUPTED");
rootSpan.setServiceType(ServiceType.UNKNOWN.getCode());
List<AnnotationBo> annotations = new ArrayList<>();
ApiMetaDataBo apiMetaData = new ApiMetaDataBo(CORRUPTED_AGENT_ID, AGENT_START_TIME, 0, LineNumber.NO_LINE_NUMBER, MethodTypeEnum.CORRUPTED, "...");
final AnnotationBo apiMetaDataAnnotation = new AnnotationBo(AnnotationKey.API_METADATA.getCode(), apiMetaData);
annotations.add(apiMetaDataAnnotation);
int key = AnnotationKeyUtils.getArgs(0).getCode();
String errorMessage = getErrorMessage(title, startTimeMillis);
final AnnotationBo argumentAnnotation = new AnnotationBo(key, errorMessage);
annotations.add(argumentAnnotation);
rootSpan.setAnnotationBoList(annotations);
return new MetaSpanCallTree(new SpanAlign(rootSpan, true));
}
Aggregations