Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Aug 2, 2024
1 parent fd58b9b commit 4512672
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.azure.monitor.opentelemetry.exporter.implementation.builders.AbstractTelemetryBuilder;
import com.azure.monitor.opentelemetry.exporter.implementation.builders.ExceptionDetailBuilder;
import com.azure.monitor.opentelemetry.exporter.implementation.builders.ExceptionTelemetryBuilder;
import com.azure.monitor.opentelemetry.exporter.implementation.builders.Exceptions;
import com.azure.monitor.opentelemetry.exporter.implementation.builders.MessageTelemetryBuilder;
import com.azure.monitor.opentelemetry.exporter.implementation.builders.RemoteDependencyTelemetryBuilder;
import com.azure.monitor.opentelemetry.exporter.implementation.builders.RequestTelemetryBuilder;
Expand Down Expand Up @@ -37,6 +36,7 @@

import static com.azure.monitor.opentelemetry.exporter.implementation.MappingsBuilder.MappingType.SPAN;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static java.util.concurrent.TimeUnit.NANOSECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;

Expand Down Expand Up @@ -849,17 +849,17 @@ private TelemetryItem createExceptionTelemetryItem(
}

static void setExceptions(String stack, Attributes attributes, ExceptionTelemetryBuilder telemetryBuilder) {
List<ExceptionDetailBuilder> builders = Exceptions.minimalParse(stack);
ExceptionDetailBuilder exceptionDetailBuilder = builders.get(0);
ExceptionDetailBuilder builder = new ExceptionDetailBuilder();
String type = attributes.get(SemanticAttributes.EXCEPTION_TYPE);
if (type != null && !type.isEmpty()) {
exceptionDetailBuilder.setTypeName(type);
builder.setTypeName(type);
}
String message = attributes.get(SemanticAttributes.EXCEPTION_MESSAGE);
if (message != null && !message.isEmpty()) {
exceptionDetailBuilder.setMessage(message);
builder.setMessage(message);
}
telemetryBuilder.setExceptions(builders);
builder.setStack(stack);
telemetryBuilder.setExceptions(singletonList(builder));
}


Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 4512672

Please sign in to comment.