Monitoring
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 statsd section of zuul.conf
.
Metrics
These metrics are emitted by the Zuul Scheduler:
- zuul.event.<driver>.<type> (counter)
Zuul will report counters for each type of event it receives from each of its configured drivers.
- zuul.connection.<connection>
Holds metrics specific to connections. This hierarchy includes:
- zuul.connection.<connection>.cache.data_size_compressed (gauge)
The number of bytes stored in ZooKeeper for all items in this connection’s change cache.
- zuul.connection.<connection>.cache.data_size_uncompressed (gauge)
The number of bytes required to for the change cache (the decompressed value of
data_size_compressed
).
- zuul.tenant.<tenant>.event_enqueue_processing_time (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.
- zuul.tenant.<tenant>.event_enqueue_time (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 zuul.tenant.<tenant>.event_enqueue_processing_time and any driver-specific pre-processing of the event.
- zuul.tenant.<tenant>.management_events (gauge)
The size of the tenant’s management event queue.
- zuul.tenant.<tenant>.reconfiguration_time (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.
- zuul.tenant.<tenant>.trigger_events (gauge)
The size of the tenant’s trigger event queue.
- zuul.tenant.<tenant>.pipeline
Holds metrics specific to jobs. This hierarchy includes:
- zuul.tenant.<tenant>.pipeline.<pipeline>
A set of metrics for each pipeline named as defined in the Zuul config.
- zuul.tenant.<tenant>.pipeline.<pipeline>.event_enqueue_time (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.
- zuul.tenant.<tenant>.pipeline.<pipeline>.merge_request_time (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 zuul.tenant.<tenant>.pipeline.<pipeline>.merger_merge_op_time and zuul.tenant.<tenant>.pipeline.<pipeline>.merger_files_changes_op_time.
- zuul.tenant.<tenant>.pipeline.<pipeline>.merger_merge_op_time (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.
- zuul.tenant.<tenant>.pipeline.<pipeline>.merger_files_changes_op_time (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.
- zuul.tenant.<tenant>.pipeline.<pipeline>.layout_generation_time (timer)
The amount of time spent generating a dynamic configuration layout.
- zuul.tenant.<tenant>.pipeline.<pipeline>.job_freeze_time (timer)
The amount of time spent freezing the inheritance hierarchy and parameters of a job.
- zuul.tenant.<tenant>.pipeline.<pipeline>.repo_state_time (timer)
The amount of time waiting for a secondary Zuul merger operation to collect additional information about the repo state of required projects. Includes zuul.tenant.<tenant>.pipeline.<pipeline>.merger_repo_state_op_time.
- zuul.tenant.<tenant>.pipeline.<pipeline>.merger_repo_state_op_time (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.
- zuul.tenant.<tenant>.pipeline.<pipeline>.node_request_time (timer)
The amount of time spent waiting for each node request to be fulfilled.
- zuul.tenant.<tenant>.pipeline.<pipeline>.job_wait_time (timer)
How long a job waited for an executor to start running it after the build was requested.
- zuul.tenant.<tenant>.pipeline.<pipeline>.event_job_time (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.
- zuul.tenant.<tenant>.pipeline.<pipeline>.all_jobs (counter)
Number of jobs triggered by the pipeline.
- zuul.tenant.<tenant>.pipeline.<pipeline>.current_changes (gauge)
The number of items currently being processed by this pipeline.
- zuul.tenant.<tenant>.pipeline.<pipeline>.window (gauge)
The configured window size for the pipeline. Note that this will not change during operation. This value is used to initialize each project queue, and as changes in that queue succeed or fail, that queue’s window will adjust.
- zuul.tenant.<tenant>.pipeline.<pipeline>.handling (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.
- zuul.tenant.<tenant>.pipeline.<pipeline>.event_process (timer)
The time taken to process the event queues for the pipeline. This is emitted only if there are events to process.
- zuul.tenant.<tenant>.pipeline.<pipeline>.process (timer)
The time taken to process the pipeline. This is emitted only if there were events to process.
- zuul.tenant.<tenant>.pipeline.<pipeline>.data_size_compressed (gauge)
The number of bytes stored in ZooKeeper to represent the serialized state of the pipeline.
- zuul.tenant.<tenant>.pipeline.<pipeline>.data_size_uncompressed (gauge)
The number of bytes required to represent the serialized state of the pipeline (the decompressed value of
data_size_compressed
).
- zuul.tenant.<tenant>.pipeline.<pipeline>.queue
This hierarchy holds more specific metrics for each project queue in the pipeline.
- zuul.tenant.<tenant>.pipeline.<pipeline>.queue.<queue>
The name of the queue. If the queue is automatically generated for a single project, the name of the project is used by default. Embedded
.
characters will be translated to_
, and/
to.
.If the queue is configured as per-branch, the metrics below are omitted and instead found under zuul.tenant.<tenant>.pipeline.<pipeline>.queue.<queue>.branch.
- zuul.tenant.<tenant>.pipeline.<pipeline>.queue.<queue>.current_changes (gauge)
The number of items currently in this queue.
- zuul.tenant.<tenant>.pipeline.<pipeline>.queue.<queue>.window (gauge)
The window size for the queue. This will change as individual changes in the queue succeed or fail.
- zuul.tenant.<tenant>.pipeline.<pipeline>.queue.<queue>.resident_time (timer)
A timer metric reporting how long each item has been in the queue.
- zuul.tenant.<tenant>.pipeline.<pipeline>.queue.<queue>.total_changes (counter)
The number of changes processed by the queue.
- zuul.tenant.<tenant>.pipeline.<pipeline>.queue.<queue>.branch
If the queue is configured as per-branch, this hierarchy will be present and will hold stats for each branch seen.
- zuul.tenant.<tenant>.pipeline.<pipeline>.queue.<queue>.branch.<branch>
The name of the branch. Embedded
.
characters will be translated to_
, and/
to.
.Underneath this key are per-branch values of the metrics above.
- zuul.tenant.<tenant>.pipeline.<pipeline>.project
This hierarchy holds more specific metrics for each project participating in the pipeline.
- zuul.tenant.<tenant>.pipeline.<pipeline>.project.<canonical_hostname>
The canonical hostname for the triggering project. Embedded
.
characters will be translated to_
.- zuul.tenant.<tenant>.pipeline.<pipeline>.project.<canonical_hostname>.<project>
The name of the triggering project. Embedded
/
or.
characters will be translated to_
.- zuul.tenant.<tenant>.pipeline.<pipeline>.project.<canonical_hostname>.<project>.<branch>
The name of the triggering branch. Embedded
/
or.
characters will be translated to_
.- zuul.tenant.<tenant>.pipeline.<pipeline>.project.<canonical_hostname>.<project>.<branch>.job
Subtree detailing per-project job statistics:
- zuul.tenant.<tenant>.pipeline.<pipeline>.project.<canonical_hostname>.<project>.<branch>.job.<jobname>
The triggered job name.
- zuul.tenant.<tenant>.pipeline.<pipeline>.project.<canonical_hostname>.<project>.<branch>.job.<jobname>.<result> (counter, timer)
A counter for each type of result (e.g.,
SUCCESS
orFAILURE
,ERROR
, etc.) for the job. If the result isSUCCESS
orFAILURE
, Zuul will additionally report the duration of the build as a timer.
- zuul.tenant.<tenant>.pipeline.<pipeline>.project.<canonical_hostname>.<project>.<branch>.job.<jobname>.wait_time (timer)
How long the job waited for an executor to start running it after the build was requested.
- zuul.tenant.<tenant>.pipeline.<pipeline>.project.<canonical_hostname>.<project>.<branch>.current_changes (gauge)
The number of items of this project currently being processed by this pipeline.
- zuul.tenant.<tenant>.pipeline.<pipeline>.project.<canonical_hostname>.<project>.<branch>.resident_time (timer)
A timer metric reporting how long each item for this project has been in the pipeline.
- zuul.tenant.<tenant>.pipeline.<pipeline>.project.<canonical_hostname>.<project>.<branch>.total_changes (counter)
The number of changes for this project processed by the pipeline.
- zuul.tenant.<tenant>.pipeline.<pipeline>.read_time (timer)
The time spent reading data from ZooKeeper during a single pipeline processing run.
- zuul.tenant.<tenant>.pipeline.<pipeline>.read_znodes (gauge)
The number of ZNodes read from ZooKeeper during a single pipeline processing run.
- zuul.tenant.<tenant>.pipeline.<pipeline>.read_objects (gauge)
The number of Zuul data model objects read from ZooKeeper during a single pipeline processing run.
- zuul.tenant.<tenant>.pipeline.<pipeline>.read_bytes (gauge)
The amount of data read from ZooKeeper during a single pipeline processing run.
- zuul.tenant.<tenant>.pipeline.<pipeline>.refresh (timer)
The time taken to refresh the state from ZooKeeper.
- zuul.tenant.<tenant>.pipeline.<pipeline>.resident_time (timer)
A timer metric reporting how long each item has been in the pipeline.
- zuul.tenant.<tenant>.pipeline.<pipeline>.total_changes (counter)
The number of changes processed by the pipeline.
- zuul.tenant.<tenant>.pipeline.<pipeline>.trigger_events (gauge)
The size of the pipeline’s trigger event queue.
- zuul.tenant.<tenant>.pipeline.<pipeline>.result_events (gauge)
The size of the pipeline’s result event queue.
- zuul.tenant.<tenant>.pipeline.<pipeline>.management_events (gauge)
The size of the pipeline’s management event queue.
- zuul.tenant.<tenant>.pipeline.<pipeline>.write_time (timer)
The time spent writing data to ZooKeeper during a single pipeline processing run.
- zuul.tenant.<tenant>.pipeline.<pipeline>.write_znodes (gauge)
The number of ZNodes written to ZooKeeper during a single pipeline processing run.
- zuul.tenant.<tenant>.pipeline.<pipeline>.write_objects (gauge)
The number of Zuul data model objects written to ZooKeeper during a single pipeline processing run.
- zuul.tenant.<tenant>.pipeline.<pipeline>.write_bytes (gauge)
The amount of data written to ZooKeeper during a single pipeline processing run.
- zuul.executor.<executor>
Holds metrics emitted by individual executors. The
<executor>
component of the key will be replaced with the hostname of the executor.- zuul.executor.<executor>.merger.<result> (counter)
Incremented to represent the status of a Zuul executor’s merger operations.
<result>
can be eitherSUCCESS
orFAILURE
. A failed merge operation which would be accounted for as aFAILURE
is what ends up being returned by Zuul as aMERGE_CONFLICT
.
- zuul.executor.<executor>.builds (counter)
Incremented each time the executor starts a build.
- zuul.executor.<executor>.starting_builds (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.
- zuul.executor.<executor>.running_builds (gauge)
The number of builds currently running on this executor. This includes starting builds.
- zuul.executor.<executor>.paused_builds (gauge)
The number of currently paused builds on this executor.
- zuul.executor.<executor>.phase
Subtree detailing per-phase execution statistics:
- zuul.executor.<executor>.phase.<phase>
<phase>
represents a phase in the execution of a job. This can be an internal phase (such assetup
orcleanup
) as well as job phases such aspre
,run
orpost
.- zuul.executor.<executor>.phase.<phase>.<result> (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
.
- zuul.executor.<executor>.load_average (gauge)
The one-minute load average of this executor, multiplied by 100.
- zuul.executor.<executor>.pause (gauge)
Indicates if the executor is paused. 1 means paused else 0.
- zuul.executor.<executor>.pct_used_hdd (gauge)
The used disk on this executor, as a percentage multiplied by 100.
- zuul.executor.<executor>.pct_used_inodes (gauge)
The used inodes on this executor, as a percentage multiplied by 100.
- zuul.executor.<executor>.pct_used_ram (gauge)
The used RAM (excluding buffers and cache) on this executor, as a percentage multiplied by 100.
- zuul.executor.<executor>.pct_used_ram_cgroup (gauge)
The used RAM (excluding buffers and cache) on this executor allowed by the cgroup, as percentage multiplied by 100.
- 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
- zuul.nodepool.requests.<state> (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 eachstatsd
flush interval.A lower value for fulfilled requests is better. Ideally, there will be no failed requests.
- zuul.nodepool.requests.<state>.total (counter)
Incremented when nodes are assigned or removed as described in the states above.
- zuul.nodepool.requests.<state>.size.<size> (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 withzuul.nodepool.requests.fulfilled.size.3
.The timer is implemented for
fulfilled
andfailed
requests. For example, the timerzuul.nodepool.requests.failed.size.3.mean
gives the average time of 3-node failed requests within thestatsd
flush interval. A lower value for fulfilled requests is better. Ideally, there will be no failed requests.
- zuul.nodepool.requests.<state>.label.<label> (counter, timer)
Increments for the label of each request. For example, requests for centos7 nodes could be tracked with
zuul.nodepool.requests.requested.centos7
.The timer is implemented for
fulfilled
andfailed
requests. For example, the timerzuul.nodepool.requests.fulfilled.label.centos7.mean
gives the average time ofcentos7
fulfilled requests within thestatsd
flush interval. A lower value for fulfilled requests is better. Ideally, there will be no failed requests.
- zuul.nodepool
- zuul.nodepool.current_requests (gauge)
The number of outstanding nodepool requests from Zuul. Ideally this will be at zero, meaning all requests are fulfilled. Persistently high values indicate more testing node resources would be helpful.
- zuul.nodepool.tenant.<tenant>.current_requests (gauge)
The number of outstanding nodepool requests from Zuul drilled down by <tenant>. If a tenant for a node request cannot be determed, it is reported as
unknown
. This relates tozuul.nodepool.current_requests
.
- zuul.nodepool.resources
Holds metrics about resource usage by tenant or project if resources of nodes are reported by nodepool.
- zuul.nodepool.resources.in_use
Holds metrics about resources currently in use by a build.
- zuul.nodepool.resources.total
Holds metrics about resources allocated in total. This includes resources that are currently in use, allocated but not yet in use, and scheduled to be deleted.
- zuul.mergers
Holds metrics related to Zuul mergers.
- zuul.mergers.online (gauge)
The number of Zuul merger processes online.
- zuul.mergers.jobs_running (gauge)
The number of merge jobs running.
- zuul.mergers.jobs_queued (gauge)
The number of merge jobs waiting for a merger. This should ideally be zero; persistent higher values indicate more merger resources would be useful.
- zuul.executors
Holds metrics related to unzoned executors.
This is a copy of zuul.executors.unzoned. It does not include information about zoned executors.
Warning
The metrics at this location are deprecated and will be removed in a future version. Please begin using zuul.executors.unzoned instead.
- zuul.executors.online (gauge)
The number of Zuul executor processes online.
- zuul.executors.accepting (gauge)
The number of Zuul executor processes accepting new jobs.
- zuul.executors.jobs_running (gauge)
The number of executor jobs running.
- zuul.executors.jobs_queued (gauge)
The number of jobs allocated nodes, but queued waiting for an executor to run on. This should ideally be at zero; persistent higher values indicate more executor resources would be useful.
- zuul.executors.unzoned
Holds metrics related to unzoned executors.
- zuul.executors.unzoned.online (gauge)
The number of unzoned Zuul executor processes online.
- zuul.executors.unzoned.accepting (gauge)
The number of unzoned Zuul executor processes accepting new jobs.
- zuul.executors.unzoned.jobs_running (gauge)
The number of unzoned executor jobs running.
- zuul.executors.unzoned.jobs_queued (gauge)
The number of jobs allocated nodes, but queued waiting for an unzoned executor to run on. This should ideally be at zero; persistent higher values indicate more executor resources would be useful.
- zuul.executors.zone
Holds metrics related to zoned executors.
- zuul.executors.zone.<zone>.online (gauge)
The number of Zuul executor processes online in this zone.
- zuul.executors.zone.<zone>.accepting (gauge)
The number of Zuul executor processes accepting new jobs in this zone.
- zuul.executors.zone.<zone>.jobs_running (gauge)
The number of executor jobs running in this zone.
- zuul.executors.zone.<zone>.jobs_queued (gauge)
The number of jobs allocated nodes, but queued waiting for an executor in this zone to run on. This should ideally be at zero; persistent higher values indicate more executor resources would be useful.
- zuul.scheduler
Holds metrics related to the Zuul scheduler.
- zuul.scheduler.eventqueues
Holds metrics about the event queue lengths in the Zuul scheduler.
- zuul.scheduler.eventqueues.management (gauge)
The size of the current reconfiguration event queue.
- zuul.scheduler.eventqueues.connection.<connection-name> (gauge)
The size of the current connection event queue.
- zuul.scheduler.run_handler (timer)
A timer metric reporting the time taken for one scheduler run handler iteration.
- zuul.scheduler.time_query (timer)
Each time the scheduler performs a query against the SQL database in order to determine an estimated time for a job, it emits this timer of the duration of the query. Note this is a performance metric of how long the SQL query takes; it is not the estimated time value itself.
- zuul.web
Holds metrics related to the Zuul web component.
- zuul.web.server.<hostname>
Holds metrics from a specific zuul-web server.
- zuul.web.server.<hostname>.threadpool
Metrics related to the web server thread pool.
- zuul.web.server.<hostname>.threadpool.idle (gauge)
The number of idle workers.
- zuul.web.server.<hostname>.threadpool.queue (gauge)
The number of requests queued for workers.
- zuul.web.server.<hostname>.streamers (gauge)
The number of log streamers currently in operation.
As an example, given a job named myjob in mytenant triggered by a change to myproject on the master branch in the gate pipeline which took 40 seconds to build, the Zuul scheduler will emit the following statsd events:
zuul.tenant.mytenant.pipeline.gate.project.example_com.myproject.master.job.myjob.SUCCESS
+1
zuul.tenant.mytenant.pipeline.gate.project.example_com.myproject.master.job.myjob.SUCCESS
40 seconds
zuul.tenant.mytenant.pipeline.gate.all_jobs
+1
Prometheus monitoring
Zuul comes with support to start a prometheus metric server to be added as prometheus’s target.
Configuration
To enable the service, set the prometheus_port
in a service section of
zuul.conf
. For example setting scheduler.prometheus_port to 9091
starts a HTTP server to expose metrics to a prometheus services at:
http://scheduler:9091/metrics
Metrics
These metrics are exposed by default:
- process_virtual_memory_bytes (gauge)
- process_resident_memory_bytes (gauge)
- process_open_fds (gauge)
- process_start_time_seconds (gauge)
- process_cpu_seconds_total (counter)
On web servers the following additional metrics are exposed:
- web_threadpool_idle (gauge)
The number of idle workers in the thread pool.
- web_threadpool_queue (gauge)
The number of requests queued for thread pool workers.
- web_streamers (gauge)
The number of log streamers currently in operation.
Liveness Probes
The Prometheus server also supports liveness and ready probes at the following URIS:
-
/health/live
Returns 200 as long as the process is running.
-
/health/ready
Returns 200 if the process is in RUNNING or PAUSED states. Otherwise, returns 503. Note that 503 is returned for INITIALIZED, so this may be used to determine when a component has completely finished loading configuration.
-
/health/status
This always returns 200, but includes the component status as the text body of the response.