You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I personally don't know much about Prometheus, so I'm not sure that I
personally am the right person to answer this. I don't know what level of
information is appropriate for prometheus endpoints. Perhaps @beberg can
help here ?
Prometheus by default is built to handle a huge amount of metrics and since it's intended as a systems monitoring system, exposing verbose information is (imho) feasible.
the cost of collecting the data (usually repeatedly)
The number of tasks in states requires a full pass over the current tasks. There are possibly 1000 to 100000 tasks on a worker at any given time. Checking the status of each is probably fine to do every time prometheus checks in, assuming that happens every second or so. You might want to consider the cytoolz.frequencies function, which is fairly fast at counting things like this.
d=frequencies(self.task_state.values())
Tick duration seems fine. You might consider generalizing this to all current counters and digests. For background, we keep track of various metrics in code like this:
This actually gets plotted in Dask's dashboard in the hidden /counters page. (mostly for internal development work). Exposing these same counters and digests through Prometheus seems natural. I would prefer a general solution here for all of them rather than one that focused on tick duration.
high-level questions like "does exposing this value have security implications"
From a security perspective I see nothing wrong with publishing this data.
Ah, thanks @mrocklin for the insights. So the tick duration could be added in the similar fashion then. Just read it directly into the metric collector (see the linked scheduler implementation for an example).
In [1]: from dask.distributed import Client
In [2]: client = Client(processes=False)
In [3]: worker = client.cluster.workers[0]
In [4]: tdigest = worker.digests['tick-duration'].components[1] # grab the middle-time component
In [5]: tdigest.quantile(50)
Out[5]: 0.0224759578704834
Ideally we would do this for every digest and counter
In [1]: from dask.distributed import Client
In [2]: client = Client(processes=False)
In [3]: worker = client.cluster.workers[0]
In [4]: tdigest = worker.digests['tick-duration'].components[1] # grab the middle-time component
In [5]: tdigest.quantile(50)
Out[5]: 0.0224759578704834
Ideally we would do this for every digest and counter
@mrocklin Thank you very much for the help!
I cannot reproduce your minimal example using python3.7 with distributed version 2.1.0.
For me the values of digests is None using the provided example.
What environment were you using providing the example?
On Thu, Jul 11, 2019 at 7:24 AM Gabriel Sailer ***@***.***> wrote:
Right, here is a minimal example:
In [1]: from dask.distributed import Client
In [2]: client = Client(processes=False)
In [3]: worker = client.cluster.workers[0]
In [4]: tdigest = worker.digests['tick-duration'].components[1] # grab the middle-time component
In [5]: tdigest.quantile(50)
Out[5]: 0.0224759578704834
Ideally we would do this for every digest and counter
@mrocklin <https://github.com/mrocklin> Thank you very much for the help!
I cannot reproduce your minimal example using python3.7 with distributed
version 2.1.0.
For me the values of digests is None using the provided example.
What environment were you using providing the example?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2792?email_source=notifications&email_token=AACKZTDKBKEBMPG5KKBZIO3P64Q77A5CNFSM4H2O2AS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZWQ5FY#issuecomment-510463639>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACKZTDAF5HBD2XUWCUXIEDP64Q77ANCNFSM4H2O2ASQ>
.
Activity
mrocklin commentedon Jun 21, 2019
Fra-nk commentedon Jun 25, 2019
Prometheus by default is built to handle a huge amount of metrics and since it's intended as a systems monitoring system, exposing verbose information is (imho) feasible.
→ I think the deciding factors if a metric should (not) be exposed should be
mrocklin commentedon Jun 25, 2019
Under the criteria that @Fra-nk suggests:
The number of tasks in states requires a full pass over the current tasks. There are possibly 1000 to 100000 tasks on a worker at any given time. Checking the status of each is probably fine to do every time prometheus checks in, assuming that happens every second or so. You might want to consider the
cytoolz.frequenciesfunction, which is fairly fast at counting things like this.Tick duration seems fine. You might consider generalizing this to all current counters and digests. For background, we keep track of various metrics in code like this:
distributed/distributed/worker.py
Lines 1880 to 1884 in 991391c
This actually gets plotted in Dask's dashboard in the hidden
/counterspage. (mostly for internal development work). Exposing these same counters and digests through Prometheus seems natural. I would prefer a general solution here for all of them rather than one that focused on tick duration.From a security perspective I see nothing wrong with publishing this data.
crepererum commentedon Jun 25, 2019
Since I have worked on this, here are some details:
At least
number of tasks in statesshould not be a global metric but should rather be generated on demand in the metrics collector, similar to the implementation on the scheduler and the already existing template on the worker.For the tick duration, I'm not sure how this should be measured.
crepererum commentedon Jun 25, 2019
Ah, thanks @mrocklin for the insights. So the tick duration could be added in the similar fashion then. Just read it directly into the metric collector (see the linked scheduler implementation for an example).
mrocklin commentedon Jun 25, 2019
Right, here is a minimal example:
Ideally we would do this for every digest and counter
crepererum commentedon Jun 25, 2019
IMHO that would work. The mapped prometheus types are Counter and Summary.
gsailer commentedon Jul 11, 2019
@mrocklin Thank you very much for the help!
I cannot reproduce your minimal example using python3.7 with distributed version 2.1.0.
For me the values of digests is None using the provided example.
What environment were you using providing the example?
mrocklin commentedon Jul 11, 2019
jcrist commentedon Jul 15, 2019
Yes, crick is available on conda-forge and PyPI.
Extend prometheus metrics endpoint (#2792) (#2833)
Merge remote-tracking branch 'upstream/master'