42 lines
871 B
Ruby
42 lines
871 B
Ruby
#
|
|
# Cookbook:: kosmos_prometheus
|
|
# Recipe:: server
|
|
#
|
|
|
|
include_recipe "firewall"
|
|
|
|
prometheus_install "prometheus" do
|
|
version node["prometheus"]["version"]
|
|
checksum node["prometheus"]["checksum"]
|
|
end
|
|
|
|
prometheus_config "prometheus" do
|
|
# scrape_interval "60s"
|
|
# evaluation_interval "60s"
|
|
end
|
|
|
|
prometheus_job "prometheus" do
|
|
target "localhost:9090"
|
|
end
|
|
|
|
prometheus_service "prometheus" do
|
|
cli_options({
|
|
"config.file" => "/opt/prometheus/prometheus.yml",
|
|
"log.level" => "info",
|
|
"query.max-concurrency" => 20,
|
|
"query.lookback-delta" => "5m",
|
|
"query.timeout" => "2m",
|
|
"storage.tsdb.path" => "/var/lib/prometheus",
|
|
"storage.tsdb.retention.time" => "15d",
|
|
"web.listen-address" => ":9090",
|
|
"web.telemetry-path" => ""
|
|
})
|
|
end
|
|
|
|
firewall_rule "prometheus web" do
|
|
port 9090
|
|
source "10.1.1.0/24"
|
|
protocol :tcp
|
|
command :allow
|
|
end
|