# Access to prometheus is directly through the API
prop_accessor:api_url
with_optionspresence: true,if: :activated?do
validates:api_url,url: true
end
after_save:clear_reactive_cache!
definitialize_properties
ifproperties.nil?
self.properties={}
end
end
deftitle
'Prometheus'
end
defdescription
'Prometheus monitoring'
end
defhelp
'Retrieves `container_cpu_usage_seconds_total` and `container_memory_usage_bytes` from the configured Prometheus server. An `environment` label is required on each metric to identify the Environment.'
end
defself.to_param
'prometheus'
end
deffields
[
{
type: 'text',
name: 'api_url',
title: 'API URL',
placeholder: 'Prometheus API Base URL, like http://prometheus.example.com/'