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

Errors/Warnings in service's log #10995

Open
guyzmo opened this issue Oct 9, 2024 · 2 comments
Open

Errors/Warnings in service's log #10995

guyzmo opened this issue Oct 9, 2024 · 2 comments
Assignees

Comments

@guyzmo
Copy link

guyzmo commented Oct 9, 2024

When I look at the logs in google cloud (like for the deployments), I have many warnings like:

/usr/local/lib/python3.12/site-packages/ddtrace/vendor/psutil/_pslinux.py:527: RuntimeWarning: 'sin' and 'sout' swap memory stats couldn't be determined and were set to 0 ([Errno 2] No such file or directory: '/proc/vmstat'

or like:

2024-10-09 17:18:04,601 WARNING [ddtrace.internal.writer.writer] [writer.py:255] [dd.service=core dd.env=staging dd.version=1 dd.trace_id=0 dd.span_id=0] - sent 2.79KB in 5.23711s to http://localhost:8126/v0.5/traces

or

failed to submit span stats to the Datadog agent at http://localhost:8126/v0.6/stats, 2 additional messages skipped

Is there a way to silence them? Or maybe I have something wrong that I should fix? Or maybe there's some env variables I should turn off (for swap memory stats)?

@hulkholden
Copy link

In our logger setup we do this to silence these chatty messages:

    logging.getLogger("ddtrace.internal.writer").setLevel(logging.FATAL)

(I don't know if it's the best way to handle them but it works for us).

@github-actions github-actions bot added the stale label Dec 15, 2024
@wantsui
Copy link
Collaborator

wantsui commented Jan 2, 2025

@guyzmo - Does the application use logging in general?

If so, by default dd-trace-py respects the logging level configured for it, so what @hulkholden is suggesting would be the best path!

More details can be found in Scenario 1: ddtrace version 2.x and higher .

To apply this to all of the logs emitted by dd-trace-py instead of only the internal writer, you can also just target ddtrace, ie:

logging.getLogger("ddtrace").setLevel(logging.WARNING)

However, if you ever do want to us to debug/troubleshoot the various error messages, like the ones involving failing to send stats, then we'd need the ddtrace in debug mode or higher.


Regarding your sample logs:

Example 1:

/usr/local/lib/python3.12/site-packages/ddtrace/vendor/psutil/_pslinux.py:527: RuntimeWarning: 'sin' and 'sout' swap memory stats couldn't be determined and were set to 0 ([Errno 2] No such file or directory: '/proc/vmstat'

There are a few causes of this happening, so if you open a support ticket with us and tell us more about the environment and google cloud deployment, we may be able to provide some suggestions.

Example 2:

2024-10-09 17:18:04,601 WARNING [ddtrace.internal.writer.writer] [writer.py:255] [dd.service=core dd.env=staging dd.version=1 dd.trace_id=0 dd.span_id=0] - sent 2.79KB in 5.23711s to http://localhost:8126/v0.5/traces

This message isn't an error but just the Python tracer saying it submitted data to the Trace Agent in the Datadog Agent

Example 3:

failed to submit span stats to the Datadog agent at http://localhost:8126/v0.6/stats, 2 additional messages skipped

This indicates an issue sending data to the Datadog Agent, but if this occurred before the log about sending traces, it might be okay depending on when your Datadog Agent in this set up is ready to collect the traces. It's hard to confirm the impact without knowing more of the frequency. (If it's a concern, a support ticket would be the best path forward so we can fully study the logs).

@wantsui wantsui self-assigned this Jan 2, 2025
@github-actions github-actions bot removed the stale label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants