elastic / elastic/apm-server

processor/otel: translate OpenTelemetry exceptions from .net

Open
#5,795 7 comments 2 reactions 0 assignees View on GitHub
enhancement OpenTelemetry
Dominant language
Go
Stars
1.3k
Forks
543
Avg merge
1d 18h
Merged PRs (30d)
109

Description

**APM Server version:** apm-server:7.13.4
**Elastic version:** elasticsearch:7.13.4
**Kibana version:** kibana:7.13.4
**Otel-Collector version:** otelcontribcol v0.30.

When I send a span with a span event exception to apm-server via the OTLP protocol apm-server correctly translates the span into an error but the stacktrace does not show on the kibana UI.
I can see the Spans coming through into Elastic and view them in the Kibana UI.
I can see that the SpanEvent has been correctly translated into an error but the dotnet stacktrace is missing from the UI. In the apm-7.13.4-error-000001 index i can see the error created.

**Steps to reproduce**:

1. Run APM Server
2. Instrument a .Net application with OpenTelemetry, configure it with an OtlpExporter and an endpoint of the Otel-Collector.
3.Configure the Otel-Collector to receive otlp and export to otlp/elastic
3. Simulate application exception
4. Check that the exception is recorded as an error in Elasticsearch, and observe that the stack trace is missing from the span or error UI.

**Otel-Collector Config**
```
...
pipelines:
metrics:
receivers:
[otlp]
processors:
[batch]
exporters:
[otlp/elastic]
traces:
receivers: [otlp]
processors: [batch]
exporters: [logging, otlp/elastic]
```

**Output from Otel-Collector**
```
Span #1
Trace ID : ce85f09822e57f438662c0f264fd5628
Parent ID : c7c38a5214f06e49
ID : 31244485eda65d44
Name : Sub Work
Kind : SPAN_KIND_INTERNAL
Start time : 2021-07-23 09:17:15.8080915 +0000 UTC
End time : 2021-07-23 09:17:15.8941822 +0000 UTC
Status code : STATUS_CODE_ERROR
Status message :
Attributes:
-> exception.type: STRING(ActivityTracker)
-> exception.message: STRING(Message:SomethingBroke)
-> exception.stacktrace: STRING(System.ArgumentNullException: Message:SomethingBroke
---> System.Exception: new-exception
--- End of inner exception stack trace ---)
-> telemetry.sdk.language: STRING(dotnet)
Events:
SpanEvent #0
-> Name: exception
-> Timestamp: 2021-07-23 09:17:15.8930924 +0000 UTC
-> DroppedAttributesCount: 0
-> Attributes:
-> exception.type: STRING(ActivityTracker)
-> exception.message: STRING(Message:SomethingBroke)
-> exception.stacktrace: STRING(System.ArgumentNullException: Message:SomethingBroke
---> System.Exception: new-exception
--- End of inner exception stack trace ---)
```

**Screenshots showing the expected error but missing the stacktrace**

![image](https://user-images.githubusercontent.com/30926895/126794027-a0a1cfdb-7c96-4ae9-86c2-409a4f7353e1.png)
![image (2)](https://user-images.githubusercontent.com/30926895/126794021-449ac75e-294d-49e5-a422-ce984ad648a0.png)
![image (1)](https://user-images.githubusercontent.com/30926895/126794023-a1fa1a36-b90f-43dc-96e2-d8580ab3bb84.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.