polish debug logging avoid null value when segment be ignored. (#7070)

* polish debug logging avoid null value.

* update CHANGES.md.
This commit is contained in:
Jared Tan 2021-06-05 19:23:46 +08:00 committed by GitHub
parent 56f2e86a07
commit 17abef4c59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -61,6 +61,7 @@ Release Notes.
* Make metrics exporter still work even when storage layer failed.
* Fix Jetty HTTP `TRACE` issue, disable HTTP methods except `POST`.
* CVE: upgrade snakeyaml to prevent [billion laughs attack](https://en.wikipedia.org/wiki/Billion_laughs#Variations) in dynamic configuration.
* polish debug logging avoids null value when the segment ignored.
#### UI
* Add logo for kong plugin.

View File

@ -170,12 +170,15 @@ public class SegmentAnalysisListener implements FirstAnalysisListener, EntryAnal
@Override
public void build() {
if (log.isDebugEnabled()) {
log.debug("segment listener build, segment id: {}", segment.getSegmentId());
if (sampleStatus.equals(SAMPLE_STATUS.IGNORE)) {
if (log.isDebugEnabled()) {
log.debug("segment ignored, trace id: {}", segment.getTraceId());
}
return;
}
if (sampleStatus.equals(SAMPLE_STATUS.IGNORE)) {
return;
if (log.isDebugEnabled()) {
log.debug("segment listener build, segment id: {}", segment.getSegmentId());
}
segment.setEndpointId(endpointId);