Backport monitoring_prometheus from 13.0

This commit is contained in:
Yannick Vaucher committed 2021-11-15 12:53:34 +01:00
1 parent 11391132a3
commit b20a5e46fb
3 files changed
+18 -4

No files matched your search

+2 -2
View File
@@ -1,10 +1,10 @@
# Copyright 2016-2019 Camptocamp SA
# Copyright 2016-2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
{
"name": "Monitoring: Prometheus Metrics",
"version": "13.0.1.0.0",
"version": "11.0.1.0.0",
"author": "Camptocamp,Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "category",
@@ -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):
+8 -1
View File
@@ -1,9 +1,16 @@
# Copyright 2016-2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
import logging
from odoo import models
from odoo.http import request
from prometheus_client import Summary, Counter
_logger = logging.getLogger(__name__)
try:
from prometheus_client import Summary, Counter
except (ImportError, IOError) as err:
_logger.warning(err)
REQUEST_TIME = Summary(
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.