mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 08:47:40 +00:00
9 azure backport (#353)
* fix: backport fix + backport modules to azure
This commit is contained in:
co-authored by
GitHub
parent
92bf8210ef
commit
61a7d392ff
@@ -0,0 +1,2 @@
|
||||
from __future__ import absolute_import
|
||||
from . import prometheus_metrics
|
||||
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016-2021 Camptocamp SA
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||
from __future__ import absolute_import
|
||||
import logging
|
||||
|
||||
from openerp.http import Controller, route
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
from prometheus_client import generate_latest
|
||||
except (ImportError, IOError), err:
|
||||
_logger.warning(err)
|
||||
|
||||
|
||||
class PrometheusController(Controller):
|
||||
@route(u'/metrics', auth=u'public')
|
||||
def metrics(self):
|
||||
return generate_latest()
|
||||
Reference in New Issue
Block a user