-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[FEATURE REQ] Very difficult to know what went wrong when posts to Azure Monitor fail #34483
Comments
If you enabled "Error" level, and nothing of Error severity has occurred then that file will be basically empty (apart from the opened file message..TODO: I think this message should be improved to call out that...) Could you make it Verbose? Anyway, if nothing of Error severity has occurred, then its a good indication everything is working well. What was the issue you were having that you attempted to troubleshoot? |
I put a bad connection string, so I am getting a 400 when logs are posted. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @cijothomas, @reyang, @rajkumar-rangaraj, @TimothyMothra, @vishweshbankwar. Issue DetailsLibrary nameAzure.Monitor.OpenTelemetry.Exporter Please describe the feature.Diagnosing why the OpenTelemetry SDK is not working is too hard and un-obvious to non-team members. Currently errors in reporting are logged as EventSource events, and unbeknownst to me, in the Visual Studio output window. This needs to be made much more obvious to developers. I was running dotnet-monitor and having to do a post to configure the event collection as it's not a standard source, and having to break in the debugger to enable the collection before some of the events are fired. curl -X 'POST' \
'https://localhost:52323/trace?name=loadtest&durationSeconds=30' \
-H 'accept: application/octet-stream' \
-H 'Content-Type: application/json' \
-d '{
"providers": [
{"name": "OpenTelemetry-Sdk","eventLevel": "5"},
{"name": "OpenTelemetry-AzureMonitor-Exporter","eventLevel": "5"},
{"name": "Azure-Core","5": "Debug"}
],
"requestRundown": true,
"bufferSizeInMB": 1024
}' When running ASP.NET Core Apps, typically I look to the console output to tell me what is going wrong. If Open Telemetry is failing, it should probably be using ILogger to write output to the console, and use appropriate levels so only error information is included by default (that can be changed through config). Similarly, when I have problems with the deployed app, the first place to look is the console. Azure App-Service, Functions and Container Apps all have support for streaming the console output. So reporting to the console is the first place to look for explanations of issues. I tried using OTEL_DIAGNOSTICS.json - and the file just contained
|
If you mean the connectionstring was malformatted/unparseable, I'd expect AzMon exporter to throw and let app crash on startup. If you mean your connectionstring was correct, but it had wrong ikey or wrong endpoint, then I'd expect AzMon Exporter to log the fact that it received failure (400) and optionally return "ExportFailed" back to the OTel SDK (which would log it). @vishweshbankwar - Please confirm if Exporter is doing this logging or not. |
Multiple points to respond to :)
|
OpenTelemetry .NET as a general purpose library, it cannot write to console by default since this would break the user's expectation (especially if the user is expecting certain console output format). It is possible to allow the internal error logs to be configured to output to the console (e.g. it'll be even better if the internal logs are exposed via ILogger so we have the flexibility to write to file/console/etc.). @samsp-msft Is there a contract between hosting environments (e.g. Functions) and libraries (e.g. OTel.NET) so libraries can expose the logs that hosting environments could subscribe to? |
AFAIK the only service that has a specific contract around logging is Functions as they pass you an ILogger instance as part of the entrypoint into your function. The various flavors of app-service don't have a specific contract with .NET around logging. They primarily rely on providing environment variables for app-insights. They have the ability to view the console output from the process that they are hosting via a Log Stream blade. Container Apps relies on console output as its built-in logging mechanism, and provides a log stream, and collection of those entries into an azure monitor table configured as part of creation of the app. There seems to be some precedent for directly outputting to the console from OTEL - that seems to be what using |
^ Is only for learning purposes. It emits the actual telemetry itself, not the SDK internal logs. Not for production usage. |
e.g. it'll be even better if the internal logs are exposed via ILogger so we have the flexibility to write to file/console/etc. Yes, this is the tracking issue for that : open-telemetry/opentelemetry-dotnet#3881 |
I'm going to close this issue. |
Library name
Azure.Monitor.OpenTelemetry.Exporter
Please describe the feature.
Diagnosing why the OpenTelemetry SDK is not working is too hard and un-obvious to non-team members.
Currently errors in reporting are logged as EventSource events, and unbeknownst to me, in the Visual Studio output window. This needs to be made much more obvious to developers. I was running dotnet-monitor and having to do a post to configure the event collection as it's not a standard source, and having to break in the debugger to enable the collection before some of the events are fired.
When running ASP.NET Core Apps, typically I look to the console output to tell me what is going wrong. If Open Telemetry is failing, it should probably be using ILogger to write output to the console, and use appropriate levels so only error information is included by default (that can be changed through config).
Similarly, when I have problems with the deployed app, the first place to look is the console. Azure App-Service, Functions and Container Apps all have support for streaming the console output. So reporting to the console is the first place to look for explanations of issues.
I tried using OTEL_DIAGNOSTICS.json - and the file just contained
Successfully opened file.
The text was updated successfully, but these errors were encountered: