Skip to content

Commit

Permalink
[#8614] Empty database support in collector
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Feb 8, 2022
1 parent 9eb8660 commit 1e00db9
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.navercorp.pinpoint.common.server.bo.SpanChunkBo;
import com.navercorp.pinpoint.common.server.bo.SpanEventBo;
import com.navercorp.pinpoint.common.trace.ServiceType;
import com.navercorp.pinpoint.common.trace.ServiceTypeCategory;
import com.navercorp.pinpoint.loader.service.ServiceTypeRegistryService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -210,7 +211,7 @@ private void insertSpanEventList(List<SpanEventBo> spanEventList, ServiceType ap
continue;
}

final String spanEventApplicationName = spanEvent.getDestinationId();
final String spanEventApplicationName = normalize(spanEvent.getDestinationId(), spanEventType);
final String spanEventEndPoint = spanEvent.getEndPoint();

// if terminal update statistics
Expand All @@ -234,6 +235,16 @@ private void insertSpanEventList(List<SpanEventBo> spanEventList, ServiceType ap
}
}

private String normalize(String spanEventApplicationName, ServiceType spanEventType) {
if (spanEventType.getCategory() == ServiceTypeCategory.DATABASE) {
// empty database id
if (spanEventApplicationName == null) {
return "UNKNWON_DATABASE";
}
}
return spanEventApplicationName;
}

private boolean isAlias(ServiceType spanEventType, SpanEventBo forDebugEvent) {
if (!spanEventType.isAlias()) {
return false;
Expand Down

0 comments on commit 1e00db9

Please sign in to comment.