Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.prometheus Namespace Reference

Classes

class  PrometheusMetrics
 
class  PrometheusView
 

Functions

bool setup (HomeAssistant hass, ConfigType config)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 ALLOWED_METRIC_CHARS = set(string.ascii_letters + string.digits + "_:")
 
string API_ENDPOINT = "/api/prometheus"
 
 COMPONENT_CONFIG_SCHEMA_ENTRY
 
string CONF_COMPONENT_CONFIG = "component_config"
 
string CONF_COMPONENT_CONFIG_DOMAIN = "component_config_domain"
 
string CONF_COMPONENT_CONFIG_GLOB = "component_config_glob"
 
string CONF_DEFAULT_METRIC = "default_metric"
 
string CONF_FILTER = "filter"
 
string CONF_OVERRIDE_METRIC = "override_metric"
 
string CONF_PROM_NAMESPACE = "namespace"
 
string CONF_REQUIRES_AUTH = "requires_auth"
 
 CONFIG_SCHEMA
 
string DEFAULT_NAMESPACE = "homeassistant"
 
string DOMAIN = "prometheus"
 
 IGNORED_STATES = frozenset({STATE_UNAVAILABLE, STATE_UNKNOWN})
 

Detailed Description

Support for Prometheus metrics export.

Function Documentation

◆ setup()

bool homeassistant.components.prometheus.setup ( HomeAssistant  hass,
ConfigType  config 
)
Activate Prometheus component.

Definition at line 123 of file __init__.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.prometheus._LOGGER = logging.getLogger(__name__)
private

Definition at line 76 of file __init__.py.

◆ ALLOWED_METRIC_CHARS

homeassistant.components.prometheus.ALLOWED_METRIC_CHARS = set(string.ascii_letters + string.digits + "_:")

Definition at line 94 of file __init__.py.

◆ API_ENDPOINT

string homeassistant.components.prometheus.API_ENDPOINT = "/api/prometheus"

Definition at line 78 of file __init__.py.

◆ COMPONENT_CONFIG_SCHEMA_ENTRY

homeassistant.components.prometheus.COMPONENT_CONFIG_SCHEMA_ENTRY
Initial value:
1 = vol.Schema(
2  {vol.Optional(CONF_OVERRIDE_METRIC): cv.string}
3 )

Definition at line 91 of file __init__.py.

◆ CONF_COMPONENT_CONFIG

string homeassistant.components.prometheus.CONF_COMPONENT_CONFIG = "component_config"

Definition at line 86 of file __init__.py.

◆ CONF_COMPONENT_CONFIG_DOMAIN

string homeassistant.components.prometheus.CONF_COMPONENT_CONFIG_DOMAIN = "component_config_domain"

Definition at line 88 of file __init__.py.

◆ CONF_COMPONENT_CONFIG_GLOB

string homeassistant.components.prometheus.CONF_COMPONENT_CONFIG_GLOB = "component_config_glob"

Definition at line 87 of file __init__.py.

◆ CONF_DEFAULT_METRIC

string homeassistant.components.prometheus.CONF_DEFAULT_METRIC = "default_metric"

Definition at line 89 of file __init__.py.

◆ CONF_FILTER

string homeassistant.components.prometheus.CONF_FILTER = "filter"

Definition at line 83 of file __init__.py.

◆ CONF_OVERRIDE_METRIC

string homeassistant.components.prometheus.CONF_OVERRIDE_METRIC = "override_metric"

Definition at line 90 of file __init__.py.

◆ CONF_PROM_NAMESPACE

string homeassistant.components.prometheus.CONF_PROM_NAMESPACE = "namespace"

Definition at line 85 of file __init__.py.

◆ CONF_REQUIRES_AUTH

string homeassistant.components.prometheus.CONF_REQUIRES_AUTH = "requires_auth"

Definition at line 84 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.prometheus.CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  DOMAIN: vol.All(
4  {
5  vol.Optional(CONF_FILTER, default={}): entityfilter.FILTER_SCHEMA,
6  vol.Optional(CONF_PROM_NAMESPACE, default=DEFAULT_NAMESPACE): cv.string,
7  vol.Optional(CONF_REQUIRES_AUTH, default=True): cv.boolean,
8  vol.Optional(CONF_DEFAULT_METRIC): cv.string,
9  vol.Optional(CONF_OVERRIDE_METRIC): cv.string,
10  vol.Optional(CONF_COMPONENT_CONFIG, default={}): vol.Schema(
11  {cv.entity_id: COMPONENT_CONFIG_SCHEMA_ENTRY}
12  ),
13  vol.Optional(CONF_COMPONENT_CONFIG_GLOB, default={}): vol.Schema(
14  {cv.string: COMPONENT_CONFIG_SCHEMA_ENTRY}
15  ),
16  vol.Optional(CONF_COMPONENT_CONFIG_DOMAIN, default={}): vol.Schema(
17  {cv.string: COMPONENT_CONFIG_SCHEMA_ENTRY}
18  ),
19  }
20  )
21  },
22  extra=vol.ALLOW_EXTRA,
23 )

Definition at line 98 of file __init__.py.

◆ DEFAULT_NAMESPACE

string homeassistant.components.prometheus.DEFAULT_NAMESPACE = "homeassistant"

Definition at line 96 of file __init__.py.

◆ DOMAIN

string homeassistant.components.prometheus.DOMAIN = "prometheus"

Definition at line 82 of file __init__.py.

◆ IGNORED_STATES

homeassistant.components.prometheus.IGNORED_STATES = frozenset({STATE_UNAVAILABLE, STATE_UNKNOWN})

Definition at line 79 of file __init__.py.