use of com.navercorp.pinpoint.common.server.bo.AnnotationBo 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.server.bo.AnnotationBo 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));
}
use of com.navercorp.pinpoint.common.server.bo.AnnotationBo in project pinpoint by naver.
the class MetaSpanCallTreeFactory method unknown.
public CallTree unknown(final long startTimeMillis) {
final SpanBo rootSpan = new SpanBo();
rootSpan.setTransactionId(new TransactionId(UNKNOWN_AGENT_ID, AGENT_START_TIME, 0));
rootSpan.setAgentId(UNKNOWN_AGENT_ID);
rootSpan.setApplicationId("UNKNOWN");
rootSpan.setStartTime(startTimeMillis);
rootSpan.setServiceType(ServiceType.UNKNOWN.getCode());
List<AnnotationBo> annotations = new ArrayList<>();
ApiMetaDataBo apiMetaData = new ApiMetaDataBo(UNKNOWN_AGENT_ID, AGENT_START_TIME, 0, LineNumber.NO_LINE_NUMBER, MethodTypeEnum.WEB_REQUEST, "Unknown");
final AnnotationBo apiMetaDataAnnotation = new AnnotationBo(AnnotationKey.API_METADATA.getCode(), apiMetaData);
annotations.add(apiMetaDataAnnotation);
final AnnotationBo argumentAnnotation = new AnnotationBo(AnnotationKeyUtils.getArgs(0).getCode(), "No Agent Data");
annotations.add(argumentAnnotation);
rootSpan.setAnnotationBoList(annotations);
return new MetaSpanCallTree(new SpanAlign(rootSpan, true));
}
use of com.navercorp.pinpoint.common.server.bo.AnnotationBo in project pinpoint by naver.
the class SpanServiceImpl method transitionCachedString.
private void transitionCachedString(List<Align> spans) {
this.transitionAnnotation(spans, new AnnotationReplacementCallback() {
@Override
public void replacement(Align align, List<AnnotationBo> annotationBoList) {
List<AnnotationBo> cachedStringAnnotation = findCachedStringAnnotation(annotationBoList);
if (cachedStringAnnotation.isEmpty()) {
return;
}
for (AnnotationBo annotationBo : cachedStringAnnotation) {
final int cachedArgsKey = annotationBo.getKey();
int stringMetaDataId = (Integer) annotationBo.getValue();
List<StringMetaDataBo> stringMetaList = stringMetaDataDao.getStringMetaData(align.getAgentId(), align.getAgentStartTime(), stringMetaDataId);
int size = stringMetaList.size();
if (size == 0) {
logger.warn("StringMetaData not Found {}/{}/{}", align.getAgentId(), stringMetaDataId, align.getAgentStartTime());
String errorMessage = "CACHED-STRING-ID not found. stringId:";
AnnotationBo api = new AnnotationBo(AnnotationKey.ERROR_API_METADATA_NOT_FOUND.getCode(), errorMessage);
annotationBoList.add(api);
} else if (size >= 1) {
// key collision shouldn't really happen (probability too low)
StringMetaDataBo stringMetaDataBo = stringMetaList.get(0);
AnnotationBo stringMetaData = new AnnotationBo(AnnotationKeyUtils.cachedArgsToArgs(cachedArgsKey), stringMetaDataBo.getStringValue());
annotationBoList.add(stringMetaData);
if (size > 1) {
logger.warn("stringMetaData size not 1 :{}", stringMetaList);
}
}
}
}
});
}
use of com.navercorp.pinpoint.common.server.bo.AnnotationBo in project pinpoint by naver.
the class SpanFactory method newAnnotationBo.
private AnnotationBo newAnnotationBo(TAnnotation tAnnotation) {
Objects.requireNonNull(tAnnotation, "tAnnotation");
AnnotationBo annotationBo = annotationFactory.buildAnnotation(tAnnotation);
return annotationBo;
}
Aggregations