.. csv-table::
:file: csv/metrics.csv
:widths: 50, 50
+ :header-rows: 1
Prometheus Metrics can be checked at the following endpoint
# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Nordix Foundation
+# Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
from docutils.parsers.rst import directives
+import subprocess
+
project = "onap"
release = "master"
version = "master"
html_last_updated_fmt = '%d-%b-%y %H:%M'
+# Run ScrapeMetrics.py
+subprocess.run(["python3", "ScrapeMetrics.py"], check=True)
+
+# Run test_ScrapeMetrics.py
+subprocess.run(["python3", "test_ScrapeMetrics.py"], check=True)
+
def setup(app):
app.add_css_file("css/ribbon.css")
@Timed(value="timed", description="A timed metric")
public void anotherMethod() {}
- @TimedCustom(name="cps_ncmp_inventory_cm_handles_by_state{state=DELETING}", description="A custom timed metric")
+ @TimedCustom(name="custom counter name", description="A custom timed metric")
public void anotherMethod() {}
@NotTimed
expected_metrics = [
'"cm_handle_search_invocation_total","A description does not fit the a single line"',
'"timed","A timed metric"',
- '"cps_ncmp_inventory_cm_handles_by_state{state=DELETING}","A custom timed metric"'
+ '"custom counter name","A custom timed metric"'
]
result = scrape_all_metrics_from_file(test_file)
self.assertEqual(len(result), 3)