+
+package %w[
+ ruby-pg
+ ruby-webrick
+]
+
+prometheus_exporter "osm2pgsql" do
+ port 10027
+ user "tileupdate"
+ restrict_address_families "AF_UNIX"
+ options [
+ "--database-name=spirit"
+ ]
+end
+
+systemd_service "tilekiln-prometheus" do
+ description "Tilekiln vector tile server"
+ user "tilekiln"
+ after "postgresql.service"
+ wants "postgresql.service"
+ sandbox :enable_network => true
+ restrict_address_families "AF_UNIX"
+ exec_start "#{tilekiln_directory}/bin/tilekiln prometheus --bind-host #{node[:prometheus][:address]} --storage-dbname tiles"
+end
+
+service "tilekiln-prometheus" do
+ action [:enable, :start]
+end
+
+node.default[:prometheus][:exporters][10013] = {
+ :name => "tilekiln",
+ :address => "#{node[:prometheus][:address]}:10013",
+}