Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add prometheus_flask_exporter #233

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dmci/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import logging

from dmci.config import Config
from prometheus_flask_exporter import PrometheusMetrics


def _init_logging(log_obj):
Expand Down Expand Up @@ -80,6 +81,7 @@ def api_main():
sys.exit(1)

dmci_app = App()
PrometheusMetrics(dmci_app)
sys.exit(dmci_app.run())

# END api_main entry point
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ solrindexer @ git+https://github.com/metno/[email protected]
requests>=2.22
pyyaml>=5.1
flask>=1.0
prometheus_flask_exporter
lxml>=4.2.0
2 changes: 2 additions & 0 deletions tests/test_core/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def __init__(self):
def run(self):
return

monkeypatch.setattr("dmci.PrometheusMetrics", lambda x: False)

exampleConf = os.path.join(rootDir, "example_config.yaml")
monkeypatch.setenv("DMCI_CONFIG", exampleConf)
monkeypatch.setattr("dmci.api.App", mockAPI)
Expand Down
Loading