Skip to content

system metrics (CPU/memory) #361

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

Closed
wants to merge 17 commits into from

Conversation

beniwohli
Copy link
Contributor

@beniwohli beniwohli commented Dec 14, 2018

No description provided.

Copy link
Member

@graphaelli graphaelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great on first pass. I'd like to spend some more time with it and try collecting real metrics if time permits.

@beniwohli beniwohli changed the title first stab at implementing metrics [WIP] system metrics (CPU/memory) Dec 18, 2018
Copy link
Member

@graphaelli graphaelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I doing something wrong? This shows a warning on python2.7:

>>> from elasticapm import Client
>>> client = Client()
No handlers could be found for logger "elasticapm.metrics"

and this has a different result in python3.7:

>>> from elasticapm import Client
>>> client = Client()
Could not register elasticapm.metrics.sets.cpu.CPUMetricSet metricset: psutil not found. Install it to get system and process metrics

@beniwohli
Copy link
Contributor Author

@graphaelli re logging: can you use https://pypi.org/project/logging_tree/ to print the logger tree in both environments?

@graphaelli
Copy link
Member

The warnings (of course) goes away in 2.7 with psutil installed. Without, here is the logging_tree printout:

python2.7:

>>> from elasticapm import Client
>>> client = Client()
No handlers could be found for logger "elasticapm.metrics"
>>> from logging_tree import printout
>>> printout()
<--""
   Level WARNING
   |
   o<--"elasticapm"
   |   Level NOTSET so inherits level WARNING
   |   |
   |   o<--[elasticapm.base]
   |   |   |
   |   |   o<--"elasticapm.base.Client"
   |   |       Level NOTSET so inherits level WARNING
   |   |
   |   o<--"elasticapm.errors"
   |   |   Level NOTSET so inherits level WARNING
   |   |
   |   o<--"elasticapm.metrics"
   |   |   Level NOTSET so inherits level WARNING
   |   |
   |   o<--"elasticapm.traces"
   |   |   Level NOTSET so inherits level WARNING
   |   |
   |   o<--"elasticapm.transport"
   |   |   Level NOTSET so inherits level WARNING
   |   |   |
   |   |   o<--"elasticapm.transport.http"
   |   |       Level NOTSET so inherits level WARNING
   |   |
   |   o<--"elasticapm.utils"
   |       Level NOTSET so inherits level WARNING
   |
   o<--"urllib3"
       Level NOTSET so inherits level WARNING
       Handler <logging.NullHandler object at 0x10af1e150>
       |
       o<--"urllib3.connection"
       |   Level NOTSET so inherits level WARNING
       |
       o<--"urllib3.connectionpool"
       |   Level NOTSET so inherits level WARNING
       |
       o<--"urllib3.poolmanager"
       |   Level NOTSET so inherits level WARNING
       |
       o<--"urllib3.response"
       |   Level NOTSET so inherits level WARNING
       |
       o<--[urllib3.util]
           |
           o<--"urllib3.util.retry"
               Level NOTSET so inherits level WARNING

Copy link
Member

@graphaelli graphaelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recapping offline discussion.. Code looks great and I will follow up with real life testing on mac os. I do think there's a chance non-linux + non-psutil users will complain about that logging warning but we can address that later, if needed.

@beniwohli beniwohli closed this in faea3fb Jan 2, 2019
@beniwohli beniwohli deleted the metrics-support branch January 4, 2019 13:28
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

Successfully merging this pull request may close these issues.

5 participants