Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


prometheus (6) Versions 0.7.4

Installs/Configures Prometheus

cookbook 'prometheus', '~> 0.7.4', :supermarket
cookbook 'prometheus', '~> 0.7.4'
knife supermarket install prometheus
knife supermarket download prometheus
Quality 33%

prometheus Cookbook

Build Status
Gitter chat

This cookbook installs the Prometheus monitoring system and time-series database.


  • Chef 12 or higher
  • Ruby 2.2 or higher


Tested on

  • Ubuntu 14.04
  • Ubuntu 12.04
  • Debian 7.7
  • Centos 6.6
  • Centos 7.0


In order to keep the README managable and in sync with the attributes, this
cookbook documents attributes inline. The usage instructions and default
values for attributes can be found in the individual attribute files.



The default recipe installs creates all the default Prometheus directories,
config files and and users. Default also calls the configured install_method
recipe and finally calls the prometheus service recipe.


The source recipe builds Prometheus from a Github source tag.


The binary recipe retrieves and installs a pre-compiled Prometheus build from
a user-defined location.


The service recipe configures Prometheus to run under a process supervisor.
Default supervisors are chosen based on distribution. Currently supported
supervisors are init, runit, systemd, and upstart.



This resource adds a job definition to the Prometheus config file. Here is an
example of using this resource to define the default Prometheus job:

prometheus_job 'prometheus' do
  scrape_interval   '15s'
  target            "http://localhost#{node['prometheus']['flags']['web.listen-address']}#{node['prometheus']['flags']['web.telemetry-path']}"

Note: This cookbook uses the accumulator pattern so you can define multiple
prometheus_job’s and they will all be added to the Prometheus config.

Externally managing prometheus.conf

If you prefer to manage your prometheus.conf file externally using your own
inventory or service discovery mechanism you can set
default['prometheus']['allow_external_config'] to true.


The following cookbooks are dependencies:



Include prometheus in your node's run_list to execute the standard deployment of prometheus:

  "run_list": [


Used to load promethus cookbook from wrapper cookbook.

prometheus::use_lwrp doesn't do anything other than allow you to include the
Prometheus cookbook into your wrapper or app cookbooks. Doing this allows you to
override prometheus attributes and use the prometheus LWRP (prometheus_job) in
your wrapper cookbooks.

# Load the promethues cookbook into your wrapper so you have access to the LWRP and attributes

include_recipe "prometheus::use_lwrp"

# Add a rule filename under `rule_files` in prometheus.yml.erb
node.normal['prometheus']['rule_filenames'] = ["#{node['prometheus']['dir']}/alert.rules"]

# Example of using search to populate prometheus.yaml jobs using the prometheus_job LWRP
# Finds all the instances that are in the current environment and are taged with "node_exporter"
# Assumes that the service instances were tagged in their own recipes.
client_servers = search(:node, "environment:#{node.chef_environment} AND tags:node_exporter")

# Assumes service_name is an attribute of each node
client_servers.each do |server|
  prometheus_job server.service_name do
      scrape_interval   ‘15s’
    target            “#{server.fqdn}#{node[‘prometheus’][‘flags’][‘web.listen-address’]}"
    metrics_path       "#{node[‘prometheus’][‘flags’][‘web.telemetry-path’]}”

# Now run the default recipe that does all the work configuring and deploying prometheus
include_recipe "prometheus::default"


Please see the [Contributing]( and [Issue Reporting]( Guidelines.

License & Authors

Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

apt >= 0.0.0
yum >= 0.0.0
runit >= 1.5
ark >= 0.0.0
golang >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Change Log

All notable changes to this project will be documented in this file.

0.7.4 - 2024-05-06

0.7.3 - 2023-11-06

0.7.2 - 2022-02-08

  • Remove delivery folder

Standardise files with files in sous-chefs/repo-management

0.7.1 - 2021-06-01

  • resolved cookstyle error: Thorfile:1:1 convention: Style/Encoding
  • resolved cookstyle error: test/shared/spec_helper.rb:6:10 convention: Style/ExpandPathArguments

0.7.1 - 2021-06-01


  • Updated attributes and templates for Prometheus 0.15 release.


  • Added upstart init for ubuntu platform.

0.5.1 - 2015-03-25


  • Updated documentation.

0.5.0 - 2015-03-25


  • Added systemd init for redhat platform family version 7 or greater.
  • Default init style per platform.
  • Install Prometheus via pre-compiled binary.
  • Added the prometheus_job resource for defining Prometheus scraping jobs.
  • Attribute flag to externally manage prometheus.conf file.


  • Removed flags that were deprecated in the prometheus 0.12.0 release.

Contributors for this release

Thank You!

0.4.0 - 2015-03-12


  • Fix init template path bug on chef 11.x.

0.3.0 - 2015-03-11


  • Fixed cookbook badge in README

0.2.0 - 2015-03-11


  • License defined in metadata.

0.1.0 - 2015-03-11


  • Initial release of prometheus cookbook

Collaborator Number Metric

0.7.4 passed this metric

Contributing File Metric

0.7.4 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Cookstyle Metric

0.7.4 failed this metric

Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. ( prometheus/resources/job.rb: 1

Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations

No Binaries Metric

0.7.4 passed this metric

Testing File Metric

0.7.4 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

0.7.4 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must include a tag that matches this cookbook version number