mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-16 16:28:48 +10:00
Merge pull request #697 from minwoo-jung/naver-157
[#694] improvement logic for logging button
This commit is contained in:
@@ -77,6 +77,8 @@ public class SpanBo implements com.navercorp.pinpoint.common.bo.Span {
|
||||
|
||||
private String remoteAddr; // optional
|
||||
|
||||
private boolean loggingTransactionInfo; //optional
|
||||
|
||||
public SpanBo(TSpan span) {
|
||||
if (span == null) {
|
||||
throw new NullPointerException("span must not be null");
|
||||
@@ -110,6 +112,8 @@ public class SpanBo implements com.navercorp.pinpoint.common.bo.Span {
|
||||
|
||||
this.remoteAddr = span.getRemoteAddr();
|
||||
|
||||
this.loggingTransactionInfo = span.getLoggingTransactionInfo() == 1 ? true : false;
|
||||
|
||||
// FIXME (2015.03) Legacy - applicationServiceType added in v1.1.0
|
||||
// applicationServiceType is not saved for older versions where applicationServiceType does not exist.
|
||||
if (span.isSetApplicationServiceType()) {
|
||||
@@ -380,6 +384,14 @@ public class SpanBo implements com.navercorp.pinpoint.common.bo.Span {
|
||||
return this.serviceType;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isLoggingTransactionInfo() {
|
||||
return loggingTransactionInfo;
|
||||
}
|
||||
|
||||
public void setLoggingTransactionInfo(boolean loggingTransactionInfo) {
|
||||
this.loggingTransactionInfo = loggingTransactionInfo;
|
||||
}
|
||||
|
||||
// Variable encoding has been added in case of write io operation. The data size can be reduced by about 10%.
|
||||
public byte[] writeValue() {
|
||||
@@ -434,6 +446,8 @@ public class SpanBo implements com.navercorp.pinpoint.common.bo.Span {
|
||||
} else {
|
||||
buffer.put(false);
|
||||
}
|
||||
|
||||
buffer.put(loggingTransactionInfo);
|
||||
|
||||
return buffer.getBuffer();
|
||||
}
|
||||
@@ -480,6 +494,8 @@ public class SpanBo implements com.navercorp.pinpoint.common.bo.Span {
|
||||
this.applicationServiceType = buffer.readShort();
|
||||
}
|
||||
}
|
||||
|
||||
this.loggingTransactionInfo = buffer.readBoolean();
|
||||
|
||||
return buffer.getOffset();
|
||||
}
|
||||
|
||||
+17
-4
@@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -70,9 +71,15 @@ public class BusinessTransactionController {
|
||||
@Autowired
|
||||
private FilterBuilder filterBuilder;
|
||||
|
||||
// Temporarily disabled Because We need to solve authentication problem inter system.
|
||||
// @Value("#{pinpointWebProps['log.enable'] ?: false}")
|
||||
private boolean logLinkEnable = false;
|
||||
@Value("#{pinpointWebProps['log.enable'] ?: false}")
|
||||
private boolean logLinkEnable;
|
||||
|
||||
@Value("#{pinpointWebProps['log.button.name'] ?: ''}")
|
||||
private String logButtonName;
|
||||
|
||||
@Value("#{pinpointWebProps['log.page.url'] ?: ''}")
|
||||
private String logPageUrl;
|
||||
|
||||
|
||||
/**
|
||||
* executed URLs in applicationname query within from ~ to timeframe
|
||||
@@ -169,7 +176,6 @@ public class BusinessTransactionController {
|
||||
ApplicationMap map = filteredMapService.selectApplicationMap(traceId);
|
||||
mv.addObject("nodes", map.getNodes());
|
||||
mv.addObject("links", map.getLinks());
|
||||
mv.addObject("logLinkEnable", logLinkEnable);
|
||||
|
||||
// call stacks
|
||||
RecordSet recordSet = this.transactionInfoService.createRecordSet(callTreeIterator, focusTimestamp);
|
||||
@@ -181,7 +187,14 @@ public class BusinessTransactionController {
|
||||
mv.addObject("callstackStart", recordSet.getStartTime());
|
||||
mv.addObject("callstackEnd", recordSet.getEndTime());
|
||||
mv.addObject("completeState", spanResult.getCompleteTypeString());
|
||||
|
||||
mv.addObject("logLinkEnable", logLinkEnable);
|
||||
|
||||
if (logLinkEnable) {
|
||||
mv.addObject("loggingTransactionInfo", recordSet.isLoggingTransactionInfo());
|
||||
mv.addObject("logButtonName", logButtonName);
|
||||
mv.addObject("logPageUrl", logPageUrl);
|
||||
}
|
||||
|
||||
if (viewVersion == 2) {
|
||||
mv.setViewName("transactionInfoJsonHash");
|
||||
|
||||
@@ -65,16 +65,6 @@ public class ScatterChartController {
|
||||
|
||||
@Autowired
|
||||
private FilterBuilder filterBuilder;
|
||||
|
||||
|
||||
@Value("#{pinpointWebProps['log.enable'] ?: false}")
|
||||
private boolean logLinkEnable;
|
||||
|
||||
@Value("#{pinpointWebProps['log.button.name'] ?: ''}")
|
||||
private String logButtonName;
|
||||
|
||||
@Value("#{pinpointWebProps['log.page.url'] ?: ''}")
|
||||
private String logPageUrl;
|
||||
|
||||
private static final String PREFIX_TRANSACTION_ID = "I";
|
||||
private static final String PREFIX_TIME = "T";
|
||||
@@ -234,10 +224,6 @@ public class ScatterChartController {
|
||||
model.addAttribute("metadata", metadata);
|
||||
}
|
||||
|
||||
if (logLinkEnable) {
|
||||
model.addAttribute("logButtonName", logButtonName);
|
||||
model.addAttribute("logPageUrl", logPageUrl);
|
||||
}
|
||||
|
||||
return "transactionmetadata";
|
||||
}
|
||||
|
||||
@@ -146,6 +146,8 @@ public class TransactionInfoServiceImpl implements TransactionInfoService {
|
||||
// find the endTime to use as reference
|
||||
long endTime = getEndTime(spanAlignList);
|
||||
recordSet.setEndTime(endTime);
|
||||
|
||||
recordSet.setLoggingTransactionInfo(focusTimeSpanBo.isLoggingTransactionInfo());
|
||||
|
||||
final SpanAlignPopulate spanAlignPopulate = new SpanAlignPopulate();
|
||||
List<Record> recordList = spanAlignPopulate.populateSpanRecord(callTreeIterator);
|
||||
|
||||
@@ -33,6 +33,8 @@ public class RecordSet {
|
||||
|
||||
private String agentId;
|
||||
private String applicationId;
|
||||
|
||||
private boolean loggingTransactionInfo;
|
||||
|
||||
public RecordSet() {
|
||||
}
|
||||
@@ -101,4 +103,12 @@ public class RecordSet {
|
||||
public void setApplicationId(String applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
}
|
||||
|
||||
public boolean isLoggingTransactionInfo() {
|
||||
return loggingTransactionInfo;
|
||||
}
|
||||
|
||||
public void setLoggingTransactionInfo(boolean loggingTransactionInfo) {
|
||||
this.loggingTransactionInfo = loggingTransactionInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
"callStackEnd" : ${callstackEnd},
|
||||
"completeState" : "${completeState}",
|
||||
"logLinkEnable" : ${logLinkEnable},
|
||||
"loggingTransactionInfo" : ${loggingTransactionInfo},
|
||||
"logButtonName": "${logButtonName}",
|
||||
"logPageUrl" : "${logPageUrl}",
|
||||
"callStackIndex" : {
|
||||
"depth":0,
|
||||
"begin":1,
|
||||
|
||||
@@ -298,10 +298,6 @@
|
||||
{id: "agent", name: "Agent", field: "agent", width: 130},
|
||||
{id: "application-name", name: "Application", field: "applicationName", width: 150}
|
||||
];
|
||||
|
||||
if (t.logLinkEnable) {
|
||||
columns.push({id: "Loglink", name: "log", field: "logLink", width: 50, formatter:linkFormatter});
|
||||
}
|
||||
|
||||
grid = new Slick.Grid(element.get(0), dataView, columns, options);
|
||||
grid.setSelectionModel(new Slick.RowSelectionModel());
|
||||
|
||||
Reference in New Issue
Block a user