:title: Monitoring Monitoring ========== .. _statsd: Statsd reporting ---------------- Zuul comes with support for the statsd protocol, when enabled and configured (see below), the Zuul scheduler will emit raw metrics to a statsd receiver which let you in turn generate nice graphics. Configuration ~~~~~~~~~~~~~ Statsd support uses the ``statsd`` python module. Note that support is optional and Zuul will start without the statsd python module present. Configuration is in the :attr:`statsd` section of ``zuul.conf``. Metrics ~~~~~~~ These metrics are emitted by the Zuul :ref:`scheduler`: .. stat:: zuul.event.. :type: counter Zuul will report counters for each type of event it receives from each of its configured drivers. .. stat:: zuul.connection. Holds metrics specific to connections. This hierarchy includes: .. stat:: cache.data_size_compressed :type: gauge The number of bytes stored in ZooKeeper for all items in this connection's change cache. .. stat:: cache.data_size_uncompressed :type: gauge The number of bytes required to for the change cache (the decompressed value of ``data_size_compressed``). .. stat:: zuul.tenant..event_enqueue_processing_time :type: timer A timer metric reporting the time from when the scheduler receives a trigger event from a driver until the corresponding item is enqueued in a pipeline. This measures the performance of the scheduler in dispatching events. .. stat:: zuul.tenant..event_enqueue_time :type: timer A timer metric reporting the time from when a trigger event was received from the remote system to when the corresponding item is enqueued in a pipeline. This includes :stat:`zuul.tenant..event_enqueue_processing_time` and any driver-specific pre-processing of the event. .. stat:: zuul.tenant..management_events :type: gauge The size of the tenant's management event queue. .. stat:: zuul.tenant..reconfiguration_time :type: timer A timer metric reporting the time taken to reconfigure a tenant. This is performed by one scheduler after a tenant reconfiguration event is received. During this time, all processing of that tenant's pipelines are halted. This measures that time. Once the first scheduler completes a tenant reconfiguration, other schedulers may update their layout in the background without interrupting processing. That is not reported in this metric. .. stat:: zuul.tenant..trigger_events :type: gauge The size of the tenant's trigger event queue. .. stat:: zuul.tenant..pipeline Holds metrics specific to jobs. This hierarchy includes: .. stat:: A set of metrics for each pipeline named as defined in the Zuul config. .. stat:: event_enqueue_time :type: timer The time elapsed from when a trigger event was received from the remote system to when the corresponding item is enqueued in a pipeline. .. stat:: merge_request_time :type: timer The amount of time spent waiting for the initial merge operation(s). This will always include a request to a Zuul merger to speculatively merge the change, but it may also include a second request submitted in parallel to identify the files altered by the change. Includes :stat:`zuul.tenant..pipeline..merger_merge_op_time` and :stat:`zuul.tenant..pipeline..merger_files_changes_op_time`. .. stat:: merger_merge_op_time :type: timer The amount of time the merger spent performing a merge operation. This does not include any of the round-trip time from the scheduler to the merger, or any other merge operations. .. stat:: merger_files_changes_op_time :type: timer The amount of time the merger spent performing a files-changes operation to detect changed files (this is sometimes performed if the source does not provide this information). This does not include any of the round-trip time from the scheduler to the merger, or any other merge operations. .. stat:: layout_generation_time :type: timer The amount of time spent generating a dynamic configuration layout. .. stat:: job_freeze_time :type: timer The amount of time spent freezing the inheritance hierarchy and parameters of a job. .. stat:: repo_state_time :type: timer The amount of time waiting for a secondary Zuul merger operation to collect additional information about the repo state of required projects. Includes :stat:`zuul.tenant..pipeline..merger_repo_state_op_time`. .. stat:: merger_repo_state_op_time :type: timer The amount of time the merger spent performing a repo state operation to collect additional information about the repo state of required projects. This does not include any of the round-trip time from the scheduler to the merger, or any other merge operations. .. stat:: node_request_time :type: timer The amount of time spent waiting for each node request to be fulfilled. .. stat:: job_wait_time :type: timer How long a job waited for an executor to start running it after the build was requested. .. stat:: event_job_time :type: timer The total amount of time elapsed from when a trigger event was received from the remote system until the item's first job is run. This is only emitted once per queue item, even if its buildset is reset due to a speculative execution failure. .. stat:: all_jobs :type: counter Number of jobs triggered by the pipeline. .. stat:: current_changes :type: gauge The number of items currently being processed by this pipeline. .. stat:: handling :type: timer The total time taken to refresh and process the pipeline. This is emitted every time a scheduler examines a pipeline regardless of whether it takes any actions. .. stat:: event_process :type: timer The time taken to process the event queues for the pipeline. This is emitted only if there are events to process. .. stat:: process :type: timer The time taken to process the pipeline. This is emitted only if there were events to process. .. stat:: data_size_compressed :type: gauge The number of bytes stored in ZooKeeper to represent the serialized state of the pipeline. .. stat:: data_size_uncompressed :type: gauge The number of bytes required to represent the serialized state of the pipeline (the decompressed value of ``data_size_compressed``). .. stat:: project This hierarchy holds more specific metrics for each project participating in the pipeline. .. stat:: The canonical hostname for the triggering project. Embedded ``.`` characters will be translated to ``_``. .. stat:: The name of the triggering project. Embedded ``/`` or ``.`` characters will be translated to ``_``. .. stat:: The name of the triggering branch. Embedded ``/`` or ``.`` characters will be translated to ``_``. .. stat:: job Subtree detailing per-project job statistics: .. stat:: The triggered job name. .. stat:: :type: counter, timer A counter for each type of result (e.g., ``SUCCESS`` or ``FAILURE``, ``ERROR``, etc.) for the job. If the result is ``SUCCESS`` or ``FAILURE``, Zuul will additionally report the duration of the build as a timer. .. stat:: wait_time :type: timer How long the job waited for an executor to start running it after the build was requested. .. stat:: current_changes :type: gauge The number of items of this project currently being processed by this pipeline. .. stat:: resident_time :type: timer A timer metric reporting how long each item for this project has been in the pipeline. .. stat:: total_changes :type: counter The number of changes for this project processed by the pipeline since Zuul started. .. stat:: read_time :type: timer The time spent reading data from ZooKeeper during a single pipeline processing run. .. stat:: read_znodes :type: gauge The number of ZNodes read from ZooKeeper during a single pipeline processing run. .. stat:: read_objects :type: gauge The number of Zuul data model objects read from ZooKeeper during a single pipeline processing run. .. stat:: read_bytes :type: gauge The amount of data read from ZooKeeper during a single pipeline processing run. .. stat:: refresh :type: timer The time taken to refresh the state from ZooKeeper. .. stat:: resident_time :type: timer A timer metric reporting how long each item has been in the pipeline. .. stat:: total_changes :type: counter The number of changes processed by the pipeline since Zuul started. .. stat:: trigger_events :type: gauge The size of the pipeline's trigger event queue. .. stat:: result_events :type: gauge The size of the pipeline's result event queue. .. stat:: management_events :type: gauge The size of the pipeline's management event queue. .. stat:: write_time :type: timer The time spent writing data to ZooKeeper during a single pipeline processing run. .. stat:: write_znodes :type: gauge The number of ZNodes written to ZooKeeper during a single pipeline processing run. .. stat:: write_objects :type: gauge The number of Zuul data model objects written to ZooKeeper during a single pipeline processing run. .. stat:: write_bytes :type: gauge The amount of data written to ZooKeeper during a single pipeline processing run. .. stat:: zuul.executor. Holds metrics emitted by individual executors. The ```` component of the key will be replaced with the hostname of the executor. .. stat:: merger. :type: counter Incremented to represent the status of a Zuul executor's merger operations. ```` can be either ``SUCCESS`` or ``FAILURE``. A failed merge operation which would be accounted for as a ``FAILURE`` is what ends up being returned by Zuul as a ``MERGE_CONFLICT``. .. stat:: builds :type: counter Incremented each time the executor starts a build. .. stat:: starting_builds :type: gauge, timer The number of builds starting on this executor and a timer containing how long jobs were in this state. These are builds which have not yet begun their first pre-playbook. The timer needs special thoughts when interpreting it because it aggregates all jobs. It can be useful when aggregating it over a longer period of time (maybe a day) where fast rising graphs could indicate e.g. IO problems of the machines the executors are running on. But it has to be noted that a rising graph also can indicate a higher usage of complex jobs using more required projects. Also comparing several executors might give insight if the graphs differ a lot from each other. Typically the jobs are equally distributed over all executors (in the same zone when using the zone feature) and as such the starting jobs timers (aggregated over a large enough interval) should not differ much. .. stat:: running_builds :type: gauge The number of builds currently running on this executor. This includes starting builds. .. stat:: paused_builds :type: gauge The number of currently paused builds on this executor. .. stat:: phase Subtree detailing per-phase execution statistics: .. stat:: ```` represents a phase in the execution of a job. This can be an *internal* phase (such as ``setup`` or ``cleanup``) as well as *job* phases such as ``pre``, ``run`` or ``post``. .. stat:: :type: counter A counter for each type of result. These results do not, by themselves, determine the status of a build but are indicators of the exit status provided by Ansible for the execution of a particular phase. Example of possible counters for each phase are: ``RESULT_NORMAL``, ``RESULT_TIMED_OUT``, ``RESULT_UNREACHABLE``, ``RESULT_ABORTED``. .. stat:: load_average :type: gauge The one-minute load average of this executor, multiplied by 100. .. stat:: pause :type: gauge Indicates if the executor is paused. 1 means paused else 0. .. stat:: pct_used_ram :type: gauge The used RAM (excluding buffers and cache) on this executor, as a percentage multiplied by 100. .. stat:: pct_used_ram_cgroup :type: gauge The used RAM (excluding buffers and cache) on this executor allowed by the cgroup, as percentage multiplied by 100. .. stat:: zuul.nodepool.requests Holds metrics related to Zuul requests and responses from Nodepool. States are one of: *requested* Node request submitted by Zuul to Nodepool *canceled* Node request was canceled by Zuul *failed* Nodepool failed to fulfill a node request *fulfilled* Nodes were assigned by Nodepool .. stat:: :type: timer Records the elapsed time from request to completion for states `failed` and `fulfilled`. For example, ``zuul.nodepool.request.fulfilled.mean`` will give the average time for all fulfilled requests within each ``statsd`` flush interval. A lower value for `fulfilled` requests is better. Ideally, there will be no `failed` requests. .. stat:: .total :type: counter Incremented when nodes are assigned or removed as described in the states above. .. stat:: .size. :type: counter, timer Increments for the node count of each request. For example, a request for 3 nodes would use the key ``zuul.nodepool.requests.requested.size.3``; fulfillment of 3 node requests can be tracked with ``zuul.nodepool.requests.fulfilled.size.3``. The timer is implemented for ``fulfilled`` and ``failed`` requests. For example, the timer ``zuul.nodepool.requests.failed.size.3.mean`` gives the average time of 3-node failed requests within the ``statsd`` flush interval. A lower value for `fulfilled` requests is better. Ideally, there will be no `failed` requests. .. stat:: .label.