Skip to content

Commit

Permalink
[#9631] Merge ErrorSummary into ExceptionGroupSummary
Browse files Browse the repository at this point in the history
  • Loading branch information
intr3p1d committed Aug 29, 2024
1 parent 8911fa1 commit 87edd39
Show file tree
Hide file tree
Showing 16 changed files with 153 additions and 496 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package com.navercorp.pinpoint.exceptiontrace.web.config;

import com.navercorp.pinpoint.exceptiontrace.web.entity.ErrorSummaryEntity;
import com.navercorp.pinpoint.exceptiontrace.web.entity.ExceptionChartValueViewEntity;
import com.navercorp.pinpoint.exceptiontrace.web.entity.ExceptionGroupSummaryEntity;
import com.navercorp.pinpoint.exceptiontrace.web.entity.ExceptionMetaDataEntity;
Expand All @@ -33,7 +32,6 @@ public class ExceptionTraceRegistryHandler implements MyBatisRegistryHandler {
public void registerTypeAlias(TypeAliasRegistry typeAliasRegistry) {
typeAliasRegistry.registerAlias(ExceptionMetaDataEntity.class);
typeAliasRegistry.registerAlias(GroupedFieldNameEntity.class);
typeAliasRegistry.registerAlias(ErrorSummaryEntity.class);
typeAliasRegistry.registerAlias(ExceptionGroupSummaryEntity.class);
typeAliasRegistry.registerAlias(ExceptionChartValueViewEntity.class);
typeAliasRegistry.registerAlias(ExceptionTraceQueryParameter.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@

import com.navercorp.pinpoint.common.server.util.time.Range;
import com.navercorp.pinpoint.common.server.util.time.RangeValidator;
import com.navercorp.pinpoint.exceptiontrace.web.model.ErrorSummary;
import com.navercorp.pinpoint.exceptiontrace.web.model.ExceptionGroupSummary;
import com.navercorp.pinpoint.exceptiontrace.web.view.ExceptionChartValueView;
import com.navercorp.pinpoint.exceptiontrace.web.service.ExceptionTraceService;
import com.navercorp.pinpoint.exceptiontrace.web.util.ExceptionTraceQueryParameter;
import com.navercorp.pinpoint.exceptiontrace.web.util.GroupByAttributes;
import com.navercorp.pinpoint.exceptiontrace.web.view.ErrorSummaryView;
import com.navercorp.pinpoint.exceptiontrace.web.view.ExceptionDetailView;
import com.navercorp.pinpoint.exceptiontrace.web.view.ExceptionChartView;
import com.navercorp.pinpoint.exceptiontrace.web.util.TimeSeriesUtils;
Expand Down Expand Up @@ -105,40 +103,6 @@ public List<ExceptionDetailView> getListOfExceptionMetaDataFromTransactionId(
);
}

@GetMapping("/summary")
public List<ErrorSummaryView> getErrorSummaries(
@RequestParam("applicationName") @NotBlank String applicationName,
@RequestParam(value = "agentId", required = false) String agentId,
@RequestParam("from") @PositiveOrZero long from,
@RequestParam("to") @PositiveOrZero long to
) {
Range range = Range.between(from, to);
rangeValidator.validate(range);
TimeWindow timeWindow = new TimeWindow(range, ROUGH_TIME_WINDOW_SAMPLER);


ExceptionTraceQueryParameter queryParameter = new ExceptionTraceQueryParameter.Builder()
.setTableName(tableName)
.setTenantId(tenantProvider.getTenantId())
.setApplicationName(applicationName)
.setAgentId(agentId)
.setRange(range)
.setTimePrecision(TimePrecision.newTimePrecision(TimeUnit.MILLISECONDS, (int) timeWindow.getWindowSlotSize()))
.setTimeWindowRangeCount(timeWindow.getWindowRangeCount())
.setGroupByAttributes(List.of(
GroupByAttributes.ERROR_MESSAGE_LOG_TYPE,
GroupByAttributes.ERROR_CLASS_NAME,
GroupByAttributes.STACK_TRACE
))
.build();

return exceptionTraceService.getErrorSummaries(
queryParameter
).stream().map(
(ErrorSummary e) -> new ErrorSummaryView(e, timeWindow)
).toList();
}

@GetMapping("/errorList")
public List<ExceptionDetailView> getListOfExceptionMetaDataByGivenRange(
@RequestParam("applicationName") @NotBlank String applicationName,
Expand All @@ -160,7 +124,6 @@ public List<ExceptionDetailView> getListOfExceptionMetaDataByGivenRange(
.setApplicationName(applicationName)
.setAgentId(agentId)
.setRange(range)
.setTimePrecision(DETAILED_TIME_PRECISION)
.setHardLimit(count)
.addAllFilters(filters)
.setOrderBy(orderBy)
Expand All @@ -182,14 +145,16 @@ public List<ExceptionGroupSummary> getListOfExceptionMetaDataWithDynamicGroupBy(
) {
Range range = Range.between(from, to);
rangeValidator.validate(range);
TimeWindow timeWindow = new TimeWindow(range, ROUGH_TIME_WINDOW_SAMPLER);

ExceptionTraceQueryParameter queryParameter = new ExceptionTraceQueryParameter.Builder()
.setTableName(tableName)
.setTenantId(tenantProvider.getTenantId())
.setApplicationName(applicationName)
.setAgentId(agentId)
.setRange(Range.between(from, to))
.setTimePrecision(DETAILED_TIME_PRECISION)
.setTimePrecision(TimePrecision.newTimePrecision(TimeUnit.MILLISECONDS, (int) timeWindow.getWindowSlotSize()))
.setTimeWindowRangeCount(timeWindow.getWindowRangeCount())
.addAllGroupByList(groupByList)
.build();
return exceptionTraceService.getGroupSummaries(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@


import com.navercorp.pinpoint.exceptiontrace.common.model.ExceptionMetaData;
import com.navercorp.pinpoint.exceptiontrace.web.model.ErrorSummary;
import com.navercorp.pinpoint.exceptiontrace.web.model.ExceptionGroupSummary;
import com.navercorp.pinpoint.exceptiontrace.web.view.ExceptionChartValueView;
import com.navercorp.pinpoint.exceptiontrace.web.util.ExceptionTraceQueryParameter;
Expand All @@ -35,5 +34,4 @@ public interface ExceptionTraceDao {
ExceptionMetaData getException(ExceptionTraceQueryParameter exceptionTraceQueryParameter);
List<ExceptionGroupSummary> getGroupSummaries(ExceptionTraceQueryParameter exceptionTraceQueryParameter);
List<ExceptionChartValueView> getChartValueViews(ExceptionTraceQueryParameter exceptionTraceQueryParameter);
List<ErrorSummary> getErrorSummaries(ExceptionTraceQueryParameter exceptionTraceQueryParameter);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
package com.navercorp.pinpoint.exceptiontrace.web.dao;

import com.navercorp.pinpoint.exceptiontrace.common.model.ExceptionMetaData;
import com.navercorp.pinpoint.exceptiontrace.web.entity.ErrorSummaryEntity;
import com.navercorp.pinpoint.exceptiontrace.web.entity.ExceptionGroupSummaryEntity;
import com.navercorp.pinpoint.exceptiontrace.web.entity.ExceptionMetaDataEntity;
import com.navercorp.pinpoint.exceptiontrace.web.model.ErrorSummary;
import com.navercorp.pinpoint.exceptiontrace.web.entity.ExceptionChartValueViewEntity;
import com.navercorp.pinpoint.exceptiontrace.web.mapper.ExceptionEntityMapper;
import com.navercorp.pinpoint.exceptiontrace.web.model.ExceptionGroupSummary;
Expand Down Expand Up @@ -114,14 +112,4 @@ public List<ExceptionChartValueView> getChartValueViews(ExceptionTraceQueryParam
).collect(Collectors.toList());
}

@Override
public List<ErrorSummary> getErrorSummaries(ExceptionTraceQueryParameter exceptionTraceQueryParameter) {
List<ErrorSummaryEntity> entities = this.sqlPinotSessionTemplate.selectList(NAMESPACE + SELECT_ERROR_SUMMARIES_QUERY, exceptionTraceQueryParameter);
return entities.stream()
.map((ErrorSummaryEntity e) ->
mapper.toErrorSummary(
e, exceptionTraceQueryParameter.getGroupByAttributes()
)
).collect(Collectors.toList());
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,39 @@
* @author intr3p1d
*/
public class ExceptionGroupSummaryEntity extends GroupedFieldNameEntity {
private String values;
private long count;
private String mostRecentErrorClass;
private String mostRecentErrorMessage;
private long count;
private String firstLineOfClassName;
private String firstLineOfMethodName;
private long firstOccurred;
private long lastOccurred;
private String applicationName;
private String agentId;
private String transactionId;
private String spanId;
private String exceptionId;

public ExceptionGroupSummaryEntity() {
}

public String getValues() {
return values;
}

public void setValues(String values) {
this.values = values;
}

public long getCount() {
return count;
}

public void setCount(long count) {
this.count = count;
}

public String getMostRecentErrorClass() {
return mostRecentErrorClass;
}
Expand All @@ -44,12 +68,20 @@ public void setMostRecentErrorMessage(String mostRecentErrorMessage) {
this.mostRecentErrorMessage = mostRecentErrorMessage;
}

public long getCount() {
return count;
public String getFirstLineOfClassName() {
return firstLineOfClassName;
}

public void setCount(long count) {
this.count = count;
public void setFirstLineOfClassName(String firstLineOfClassName) {
this.firstLineOfClassName = firstLineOfClassName;
}

public String getFirstLineOfMethodName() {
return firstLineOfMethodName;
}

public void setFirstLineOfMethodName(String firstLineOfMethodName) {
this.firstLineOfMethodName = firstLineOfMethodName;
}

public long getFirstOccurred() {
Expand All @@ -67,4 +99,44 @@ public long getLastOccurred() {
public void setLastOccurred(long lastOccurred) {
this.lastOccurred = lastOccurred;
}

public String getApplicationName() {
return applicationName;
}

public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}

public String getAgentId() {
return agentId;
}

public void setAgentId(String agentId) {
this.agentId = agentId;
}

public String getTransactionId() {
return transactionId;
}

public void setTransactionId(String transactionId) {
this.transactionId = transactionId;
}

public String getSpanId() {
return spanId;
}

public void setSpanId(String spanId) {
this.spanId = spanId;
}

public String getExceptionId() {
return exceptionId;
}

public void setExceptionId(String exceptionId) {
this.exceptionId = exceptionId;
}
}
Loading

0 comments on commit 87edd39

Please sign in to comment.