Skip to content

Commit

Permalink
Merge pull request #290 from solarwinds/cc/NH-97753
Browse files Browse the repository at this point in the history
NH-97753: remove http status code check for error
  • Loading branch information
cleverchuk authored Dec 13, 2024
2 parents 7fe6363 + 6e82bf1 commit 02e400a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ public void onEnd(ReadableSpan span) {

final long duration =
(spanData.getEndEpochNanos() - spanData.getStartEpochNanos()) / 1_000_000;
if (!hasError && status != null) {
hasError = status.intValue() > 499;
}

AttributesBuilder responseTimeAttr = Attributes.builder();
if (span.getKind() == SpanKind.SERVER && status != null) {
Expand All @@ -101,7 +98,6 @@ public void onEnd(ReadableSpan span) {

String errorKey = "sw.is_error";
responseTimeAttr.put(errorKey, hasError);

responseTime.record(
duration, responseTimeAttr.put(TRANSACTION_NAME_KEY, transactionName).build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.solarwinds.joboe.core.metrics.histogram.HistogramMetricsEntry;
import com.solarwinds.joboe.core.metrics.measurement.SummaryLongMeasurement;
import com.solarwinds.joboe.core.metrics.measurement.SummaryMeasurementMetricsEntry;
import com.solarwinds.joboe.core.util.HttpUtils;
import com.solarwinds.joboe.logging.Logger;
import com.solarwinds.joboe.logging.LoggerFactory;
import com.solarwinds.joboe.metrics.SpanMetricsCollector;
Expand Down Expand Up @@ -162,14 +161,6 @@ private void reportMetrics(SpanData spanData) {
final Long status =
spanData.getAttributes().get(SemanticAttributes.HTTP_RESPONSE_STATUS_CODE);

// special handling for status code
if (!hasError && status != null) {
hasError =
HttpUtils.isServerErrorStatusCode(
status.intValue()); // do not attempt to override the property if it's already
// explicitly set
}

if (status != null) {
aoSecondaryKey.put("HttpStatus", String.valueOf(status));
swoTags.put("http.status_code", String.valueOf(status));
Expand Down Expand Up @@ -230,7 +221,6 @@ protected void recordMeasurementEntryForSwo(Map<String, String> tags, long durat
// TODO copied from Core, should improve to avoid code duplication
private static class OpenTelemetryInboundHistogramReporter extends MetricSpanReporter {
public static final String TRANSACTION_LATENCY_METRIC_NAME = "TransactionResponseTime";
public static final String TRANSACTION_NAME_TAG_KEY = "TransactionName";
private static final HistogramFactory.HistogramType HISTOGRAM_TYPE =
HistogramFactory.HistogramType.HDR;

Expand Down

0 comments on commit 02e400a

Please sign in to comment.