Backport monitoring_prometheus from 13.0

This commit is contained in:
Yannick Vaucher
2021-11-15 12:53:34 +01:00
parent 11391132a3
commit b20a5e46fb
3 changed files with 18 additions and 4 deletions
@@ -1,8 +1,15 @@
# Copyright 2016-2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
import logging
from odoo.http import Controller, route
from prometheus_client import generate_latest
_logger = logging.getLogger(__name__)
try:
from prometheus_client import generate_latest
except (ImportError, IOError) as err:
_logger.warning(err)
class PrometheusController(Controller):