X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=robot-systest%2Flib%2Fprometheus_lib.robot;h=0f4f07c0a8ff14bf5754b2091bff1f84eee8f8f7;hb=db73aa70f10d7da6ee7387b1854c6b22d871b6f3;hp=5fdda496a7e38b1dd407095b4b847c000afc9baf;hpb=063677c719bd33d8674903ed5b7f11e7368da23a;p=osm%2Ftests.git diff --git a/robot-systest/lib/prometheus_lib.robot b/robot-systest/lib/prometheus_lib.robot index 5fdda49..0f4f07c 100644 --- a/robot-systest/lib/prometheus_lib.robot +++ b/robot-systest/lib/prometheus_lib.robot @@ -15,15 +15,34 @@ Documentation Library to obtain metrics from Prometheus. Library String Library Collections +Library OperatingSystem Library RequestsLibrary *** Variables *** ${timeout} 30 ${max_retries} 1 +${prometheus_host} %{PROMETHEUS_HOSTNAME=UNKNOWN} +${prometheus_port} %{PROMETHEUS_PORT=9090} +${prometheus_user} %{PROMETHEUS_USER=""} +${prometheus_password} %{PROMETHEUS_PASSWORD=""} *** Keywords *** +Set Testsuite Prometheus Variables + [Documentation] Set Testsuite Prometheus Variables to be used in subsequent test cases + + IF '${prometheus_host}' == 'UNKNOWN' + ${local_prometheus_host}= Get Environment Variable OSM_HOSTNAME + Set Suite Variable ${prometheus_host} ${local_prometheus_host} + Set Suite Variable ${prometheus_port} 9091 + END + Log ${prometheus_port} + Log ${prometheus_host} + Log ${prometheus_user} + Log ${prometheus_password} + + Get Metric [Documentation] Get the instant value of a metric from Prometheus using multiple filter parameters. ... The filter parameters are given to this function in key=value format (one argument per key/value pair).