Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception Logging #5719

Closed
joaoluizalbuquerque opened this issue Jun 25, 2024 · 3 comments
Closed

Exception Logging #5719

joaoluizalbuquerque opened this issue Jun 25, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@joaoluizalbuquerque
Copy link

joaoluizalbuquerque commented Jun 25, 2024

What is the question?

Hi, guys.

Recently I've been trying to figure out why some of my API's don't log exceptions. When I call _logger.LogError(ex, "Error message"); it seems like the log is ignored by the SDK, although it's shown in stdout.

I tried taking a look at the open telemetry collector logs and I can see the following three attributes for another API with the same instrumentation: exception.type, exception.message, exception.stacktrace, but they don't appear for the API in question. I also tried using the self diagnose tool but it don't show any Waning/Error logs.

So my question is: Is there any SDK setting for disabling logs with exceptions? Or disabling stack traces? (It also doesn't seem like a log length limit as I have already tried logging a really long string and it worked)

Additional context

I'm using
.Net 7;
"OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.1";
"OpenTelemetry" Version="1.7.0"

@joaoluizalbuquerque joaoluizalbuquerque added the question Further information is requested label Jun 25, 2024
@xiang17
Copy link
Contributor

xiang17 commented Jun 26, 2024

Hi @joaoluizalbuquerque, how are you calling the APIs and how is it shown in stdout? (With any exporter?) Can you provide a minimal reproduce app to showcase your issue?

@cijothomas
Copy link
Member

If using OTLPExporter and exception was missing - then simply update to the newest stable (1.9.0).

Exceptions were not exported by default in OTLP until recently...
https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md#180-beta1

@joaoluizalbuquerque
Copy link
Author

Sorry for the delayed response. Updating to OpenTelemetry.Exporter.OpenTelemetryProtocol to 1.9.0 did the job. Thanks @cijothomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants