Repository: openshift/microshift
Pull request #4769: USHIFT-2575: add 2 telemetry test cases
Author: login: agullon
Labels: name: lgtm
description: Indicates that a PR is ready to be merged.
name: approved
description: Indicates a PR has been approved by an approver from all required OWNERS files.
name: jira/valid-reference
description: Indicates that this PR references a valid Jira ticket of any type.
Created: 2025-04-04T10:00:48Z | Merged: 2025-05-09T06:17:51Z

Add 2 telemetry test cases:
- MicroShift Fails to Report Metrics To Server: Telemetry Disabled
- MicroShift Fails to Report Metrics To Server: Wrong Pull Secret


Diff:
diff --git a/test/bin/ci_phase_boot_and_test.sh b/test/bin/ci_phase_boot_and_test.sh
index 0549656de3..5042285c81 100755
--- a/test/bin/ci_phase_boot_and_test.sh
+++ b/test/bin/ci_phase_boot_and_test.sh
@@ -51,12 +51,6 @@ cd "${ROOTDIR}/test"
 # Set up the hypervisor configuration for the tests and start webserver
 bash -x ./bin/manage_hypervisor_config.sh create
 
-# Setup a prometheus server for metrics testing
-bash -x ./bin/manage_prometheus.sh start
-
-# Setup a loki server for metrics testing
-bash -x ./bin/manage_loki.sh start
-
 # Setup a container registry and mirror images.
 bash -x ./bin/mirror_registry.sh
 
diff --git a/test/resources/observability.resource b/test/resources/observability.resource
new file mode 100644
index 0000000000..2eb613c32e
--- /dev/null
+++ b/test/resources/observability.resource
@@ -0,0 +1,20 @@
+*** Settings ***
+Documentation       Keywords common to observability test suites
+
+
+*** Keywords ***
+Start Prometheus Server
+    [Documentation]    Start a Prometheus Server on port 9092
+    Local Command Should Work    bash -x ./bin/manage_prometheus.sh start
+
+Stop Prometheus Server
+    [Documentation]    Stop the Prometheus Server
+    Local Command Should Work    bash -x ./bin/manage_prometheus.sh stop
+
+Start Loki Server
+    [Documentation]    Start a Loki Server on port 3100
+    Local Command Should Work    bash -x ./bin/manage_loki.sh start
+
+Stop Loki Server
+    [Documentation]    Stop the Loki Server
+    Local Command Should Work    bash -x ./bin/manage_loki.sh stop
diff --git a/test/resources/prometheus.py b/test/resources/prometheus.py
index 68126858cc..ae61203049 100644
--- a/test/resources/prometheus.py
+++ b/test/resources/prometheus.py
@@ -3,7 +3,7 @@
 import libipv6
 
 
-def check_prometheus_query(host: str, port: int, query: str) -> None:
+def _run_prometheus_query(host: str, port: int, query: str) -> requests.Response:
     """Executes the given query against the prometheus instance.
     Fails if the response is empty."""
     base_url = f"http://{host}:{port}/api/v1/query"
@@ -16,10 +16,23 @@ def check_prometheus_query(host: str, port: int, query: str) -> None:
         raise Exception(f"Prometheus query failed with status code {response.status_code}")
     if response.json().get("status") != "success":
         raise Exception(f"Prometheus query failed with status: {response.json().get('status')}")
-    if not response.json().get("data", {}).get("result") or len(response.json().get("data", {}).get("result")) == 0:
+    return response
+
+
+def check_prometheus_query(host: str, port: int, query: str) -> None:
+    response = _run_prometheus_query(host, port, query)
+    data_result_list: list = response.json().get("data", {}).get("result")
+    if not data_result_list or len(data_result_list) == 0:
         raise Exception("Prometheus query returned no results")
 
 
+def check_prometheus_query_is_missing(host: str, port: int, query: str) -> None:
+    response = _run_prometheus_query(host, port, query)
+    data_result_list: list = response.json().get("data", {}).get("result")
+    if data_result_list and len(data_result_list) > 0:
+        raise Exception("Prometheus query returned results")
+
+
 def check_prometheus_exporter(host: str, port: int, query: str) -> None:
     """Check the metric is available int Prometheus Exporter
     Fails if the response is empty."""
diff --git a/test/suites/optional/observability.robot b/test/suites/optional/observability.robot
index 8c24e30c3a..1ae65ce56d 100644
--- a/test/suites/optional/observability.robot
+++ b/test/suites/optional/observability.robot
@@ -10,6 +10,7 @@ Library             ../../resources/loki.py
 Resource            ../../resources/kubeconfig.resource
 Resource            ../../resources/common.resource
 Resource            ../../resources/systemd.resource
+Resource            ../../resources/observability.resource
 
 Suite Setup         Setup Suite And Prepare Test Host
 Suite Teardown      Teardown Suite And Revert Test Host
@@ -31,15 +32,9 @@ Host Metrics Are Exported
     ...    \ [0-9]+, "metrics": [0-9]+, "data points": [0-9]+}
     Pattern Should Appear In Log Output    ${JOURNAL_CUR}    ${pattern}    unit="microshift-observability"
 
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    system_cpu_time_seconds_total{cpu="cpu0",state="idle"}
-
-    Check Prometheus Exporter
-    ...    ${USHIFT_HOST}
-    ...    ${PROM_EXPORTER_PORT}
-    ...    system_cpu_time_seconds_total{cpu="cpu0",state="idle"}
+    Set Test Variable    ${METRIC}    system_cpu_time_seconds_total{cpu="cpu0",state="idle"}
+    Check Prometheus Query    ${PROMETHEUS_HOST}    ${PROMETHEUS_PORT}    ${METRIC}
+    Check Prometheus Exporter    ${USHIFT_HOST}    ${PROM_EXPORTER_PORT}    ${METRIC}
 
 Kube Metrics Are Exported
     [Documentation]    The opentelemetry-collector should be able to export kube metrics.
@@ -49,25 +44,13 @@ Kube Metrics Are Exported
     ...    \ [0-9]+, "metrics": [0-9]+, "data points": [0-9]+}
     Pattern Should Appear In Log Output    ${JOURNAL_CUR}    ${pattern}    unit="microshift-observability"
 
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    container_cpu_time_seconds_total
-
-    Check Prometheus Exporter
-    ...    ${USHIFT_HOST}
-    ...    ${PROM_EXPORTER_PORT}
-    ...    container_cpu_time_seconds_total
-
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    k8s_pod_cpu_time_seconds_total
+    Set Test Variable    ${METRIC}    container_cpu_time_seconds_total
+    Check Prometheus Query    ${PROMETHEUS_HOST}    ${PROMETHEUS_PORT}    ${METRIC}
+    Check Prometheus Exporter    ${USHIFT_HOST}    ${PROM_EXPORTER_PORT}    ${METRIC}
 
-    Check Prometheus Exporter
-    ...    ${USHIFT_HOST}
-    ...    ${PROM_EXPORTER_PORT}
-    ...    k8s_pod_cpu_time_seconds_total
+    Set Test Variable    ${METRIC}    k8s_pod_cpu_time_seconds_total
+    Check Prometheus Query    ${PROMETHEUS_HOST}    ${PROMETHEUS_PORT}    ${METRIC}
+    Check Prometheus Exporter    ${USHIFT_HOST}    ${PROM_EXPORTER_PORT}    ${METRIC}
 
 Journald Logs Are Exported
     [Documentation]    The opentelemetry-collector should be able to export logs to journald.
@@ -78,10 +61,7 @@ Journald Logs Are Exported
     ...    \ "log records": [0-9]+\\}
     Pattern Should Appear In Log Output    ${JOURNAL_CUR}    ${pattern}    unit="microshift-observability"
 
-    Check Loki Query
-    ...    ${LOKI_HOST}
-    ...    ${LOKI_PORT}
-    ...    {job="journald",exporter="OTLP"}
+    Check Loki Query    ${LOKI_HOST}    ${LOKI_PORT}    {job="journald",exporter="OTLP"}
 
 Kube Events Logs Are Exported
     [Documentation]    The opentelemetry-collector should be able to export logs to journald.
@@ -92,10 +72,7 @@ Kube Events Logs Are Exported
     ...    \ "log records": [0-9]+\\}
     Pattern Should Appear In Log Output    ${JOURNAL_CUR}    ${pattern}    unit="microshift-observability"
 
-    Check Loki Query
-    ...    ${LOKI_HOST}
-    ...    ${LOKI_PORT}
-    ...    {job="kube_events",exporter="OTLP"}
+    Check Loki Query    ${LOKI_HOST}    ${LOKI_PORT}    {job="kube_events",exporter="OTLP"}
 
 Logs Should Not Contain Receiver Errors
     [Documentation]    Internal receiver errors are not treated as fatal. Typically these are due to a misconfiguration
@@ -110,6 +87,8 @@ Logs Should Not Contain Receiver Errors
 Setup Suite And Prepare Test Host
     [Documentation]    The service starts after MicroShift starts and thus will start generating pertinent log data
     ...    right away. When the suite is executed, immediately get the cursor for the microshift-observability unit.
+    Start Prometheus Server
+    Start Loki Server
     Setup Suite
     Check Required Observability Variables
     Set Test OTEL Configuration
@@ -153,6 +132,8 @@ Teardown Suite And Revert Test Host
     [Documentation]    Set back original OTEL config and teardown Suite
     Set Back Original OTEL Configuration
     Teardown Suite
+    Stop Loki Server
+    Stop Prometheus Server
 
 Set Back Original OTEL Configuration
     [Documentation]    Set Back Original OTEL Configuration
diff --git a/test/suites/telemetry/telemetry.robot b/test/suites/telemetry/telemetry.robot
index 8336e5061b..36662a380a 100644
--- a/test/suites/telemetry/telemetry.robot
+++ b/test/suites/telemetry/telemetry.robot
@@ -5,6 +5,7 @@ Resource            ../../resources/common.resource
 Resource            ../../resources/microshift-host.resource
 Resource            ../../resources/microshift-config.resource
 Resource            ../../resources/microshift-process.resource
+Resource            ../../resources/observability.resource
 Library             ../../resources/journalctl.py
 Library             ../../resources/prometheus.py
 Library             ../../resources/ProxyLibrary.py
@@ -16,107 +17,106 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                           ${EMPTY}
+${PROXY_PORT}                           ${EMPTY}
+${PROMETHEUS_HOST}                      ${EMPTY}
+${PROMETHEUS_PORT}                      ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}             https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                       http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                     SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY_TO_PROMETHEUS}      SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Disabled
+...                                     \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${ENABLE_TELEMETRY_WITH_PROXY}          SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                     \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}        SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                       ${EMPTY}
+${PULL_SECRET}                          /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}                  /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}               /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
-MicroShift Reports Metrics To Server
+MicroShift Reports Metrics To Default Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
+    [Setup]    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
 
     [Teardown]    Remove Telemetry Configuration
 
-MicroShift Reports Metrics To Server Through Proxy
+MicroShift Reports Metrics To Default Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
+    [Setup]    Run Keywords
+    ...    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    ...    AND
+    ...    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
 
-    [Teardown]    Remove Telemetry Configuration
+    [Teardown]    Run Keywords
+    ...    Remove Telemetry Configuration
+    ...    AND
+    ...    Stop Proxy Server
 
-Check MicroShift Metrics In Local Server    # robocop: disable=too-long-test-case,too-many-calls-in-test-case
-    [Documentation]    Check the expected metrics are sent to the local server.
-    [Setup]    Setup Local Telemetry Configuration
+MicroShift Fails to Report Metrics To Prometheus Server With Telemetry Disabled
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when it is disabled.
+    [Setup]    Run Keywords
+    ...    Start Prometheus Server
+    ...    AND
+    ...    Setup Telemetry Configuration    ${DISABLE_TELEMETRY_TO_PROMETHEUS}    ${PULL_SECRET_METRICS}
 
-    ${system_arch}=    Get System Architecture
-    ${deployment_type}=    Get Deployment Type
-    ${arch}=    Set Variable If    "${system_arch}" == "x86_64"    amd64    arm64
-    ${cluster_id}=    Get MicroShift Cluster ID From File
-    ${os_id}=    Get Host OS Id
-    ${os_version}=    Get Host OS Version
-    ${microshift_ver}=    MicroShift Version
-    ${microshift_version}=    Set Variable    ${microshift_ver.major}.${microshift_ver.minor}.${microshift_ver.patch}
+    Should Find Metrics In Journal Log Success    Telemetry is disabled
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
 
-    # Ensure metrics have been sent before checking in Prometheus.
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    @{metrics_to_check}=    Get List Prometheus Metrics To Check
+    FOR    ${metric}    IN    @{metrics_to_check}
+        Check Prometheus Query Is Missing    ${PROMETHEUS_HOST}    ${PROMETHEUS_PORT}    ${metric}
+    END
 
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    cluster:capacity_cpu_cores:sum{_id="${cluster_id}",label_beta_kubernetes_io_instance_type="rhde",label_node_openshift_io_os_id="${os_id}",label_kubernetes_io_arch="${arch}"}
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    cluster:capacity_memory_bytes:sum{_id="${cluster_id}",label_beta_kubernetes_io_instance_type="rhde",label_node_openshift_io_os_id="${os_id}",label_kubernetes_io_arch="${arch}"}
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    cluster:cpu_usage_cores:sum{_id="${cluster_id}"}
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    cluster:memory_usage_bytes:sum{_id="${cluster_id}"}
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    cluster:usage:resources:sum{_id="${cluster_id}",resource="pods"}
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    cluster:usage:resources:sum{_id="${cluster_id}",resource="namespaces"}
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    cluster:usage:resources:sum{_id="${cluster_id}",resource="services"}
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    cluster:usage:resources:sum{_id="${cluster_id}",resource="ingresses.networking.k8s.io"}
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    cluster:usage:resources:sum{_id="${cluster_id}",resource="routes.route.openshift.io"}
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    cluster:usage:resources:sum{_id="${cluster_id}",resource="customresourcedefinitions.apiextensions.k8s.io"}
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    cluster:usage:containers:sum{_id="${cluster_id}"}
-    Check Prometheus Query
-    ...    ${PROMETHEUS_HOST}
-    ...    ${PROMETHEUS_PORT}
-    ...    microshift_version{_id="${cluster_id}",deployment_type="${deployment_type}",os_version_id="${os_version}",version="${microshift_version}"}
+    [Teardown]    Run Keywords
+    ...    Remove Telemetry Configuration
+    ...    AND
+    ...    Stop Prometheus Server
+
+MicroShift Fails to Report Metrics To Default Server With Wrong Pull Secret
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when the pull secret is wrong.
+    [Setup]    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_NO_METRICS}
+
+    Should Find Metrics In Journal Log Success    Unable to get pull secret: cloud.openshift.com not found
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
 
     [Teardown]    Remove Telemetry Configuration
 
+MicroShift Reports Metrics To Prometheus Server
+    [Documentation]    Check the expected metrics are sent to the local server.
+    [Setup]    Run Keywords
+    ...    Start Prometheus Server
+    ...    AND
+    ...    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_TO_PROMETHUS}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+
+    @{metrics_to_check}=    Get List Prometheus Metrics To Check
+    FOR    ${metric}    IN    @{metrics_to_check}
+        Check Prometheus Query    ${PROMETHEUS_HOST}    ${PROMETHEUS_PORT}    ${metric}
+    END
+
+    [Teardown]    Run Keywords
+    ...    Remove Telemetry Configuration
+    ...    AND
+    ...    Stop Prometheus Server
+
 
 *** Keywords ***
 Setup
@@ -124,76 +124,49 @@ Setup
     Check Required Env Variables
     Check Required Telemetry Variables
     Login MicroShift Host
-    Configure Pull Secrets
     Setup Kubeconfig
 
 Teardown
     [Documentation]    Test suite teardown
-    Restore Pull Secrets
-    Restart MicroShift
     Logout MicroShift Host
     Remove Kubeconfig
 
 Check Required Telemetry Variables
-    [Documentation]    Check if the required proxy variables are set
+    [Documentation]    Check if the required telemetry variables are set
     Should Not Be Empty    ${PROXY_HOST}    PROXY_HOST variable is required
     ${string_value}=    Convert To String    ${PROXY_PORT}
     Should Not Be Empty    ${string_value}    PROXY_PORT variable is required
     Should Not Be Empty    ${PROMETHEUS_HOST}    PROMETHEUS_HOST variable is required
     ${string_value}=    Convert To String    ${PROMETHEUS_PORT}
     Should Not Be Empty    ${string_value}    PROMETHEUS_PORT variable is required
+    Should Not Be Empty    ${PROXY_HOST}    PROXY_HOST variable is required
+    ${string_value}=    Convert To String    ${PROXY_PORT}
+    Should Not Be Empty    ${string_value}    PROXY_PORT variable is required
 
 Setup Telemetry Configuration
     [Documentation]    Enables the telemetry feature in MicroShift configuration file
     ...    and restarts microshift.service
-    ${config}=    Catenate
-    ...    SEPARATOR=\n
-    ...    ${ENABLE_TELEMETRY}
-    ...    \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
-    Drop In MicroShift Config    ${config}    10-telemetry
-    Stop MicroShift
-    ${cursor}=    Get Journal Cursor
-    Set Suite Variable    \${CURSOR}    ${cursor}
-    Restart MicroShift
-
-Setup Telemetry Configuration With Proxy
-    [Documentation]    Enables the telemetry feature in MicroShift configuration file
-    ...    and restarts microshift.service
-    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
-    ${proxy_config}=    Catenate
-    ...    SEPARATOR=\n
-    ...    ${ENABLE_TELEMETRY}
-    ...    \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
-    ...    \ \ proxy: http://${PROXY_HOST}:${PROXY_PORT}
-    Drop In MicroShift Config    ${proxy_config}    10-telemetry
-    Stop MicroShift
-    ${cursor}=    Get Journal Cursor
-    Set Suite Variable    \${CURSOR}    ${cursor}
-    Restart MicroShift
-
-Setup Local Telemetry Configuration
-    [Documentation]    Enables the telemetry feature in MicroShift configuration file
-    ...    and restarts microshift.service
-    ${config}=    Catenate
-    ...    SEPARATOR=\n
-    ...    ${ENABLE_TELEMETRY}
-    ...    \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+    [Arguments]    ${config}    ${new_pull_secret}
+    Configure Pull Secrets    ${new_pull_secret}
     Drop In MicroShift Config    ${config}    10-telemetry
     Stop MicroShift
     ${cursor}=    Get Journal Cursor
-    Set Suite Variable    \${CURSOR}    ${cursor}
+    Set Test Variable    \${CURSOR}    ${cursor}
     Restart MicroShift
 
 Remove Telemetry Configuration
     [Documentation]    Removes the telemetry feature from MicroShift configuration file
     ...    and restarts microshift.service
     Remove Drop In MicroShift Config    10-telemetry
+    Restore Pull Secrets
     Restart MicroShift
 
 Configure Pull Secrets
     [Documentation]    Sets up the pull secrets for the MicroShift cluster.
+    [Arguments]    ${new_pull_secret}
+
     ${rc}=    SSHLibrary.Execute Command
-    ...    grep -q cloud.openshift.com ${PULL_SECRET} || sudo ln -sf ${PULL_SECRET_METRICS} ${PULL_SECRET}
+    ...    grep -q cloud.openshift.com ${PULL_SECRET} || sudo ln -sf ${new_pull_secret} ${PULL_SECRET}
     ...    sudo=True
     ...    return_rc=True
     ...    return_stderr=False
@@ -207,6 +180,42 @@ Restore Pull Secrets
     ...    sudo=True    return_rc=True    return_stderr=False    return_stdout=False
     Should Be Equal As Integers    ${rc}    0
 
-Should Find Metrics Success
-    [Documentation]    Logs should contain metrics success message
-    Pattern Should Appear In Log Output    ${CURSOR}    Metrics sent successfully
+Should Find Metrics In Journal Log Success
+    [Documentation]    Logs should contain metrics message
+    [Arguments]    ${pattern}
+    Wait Until Keyword Succeeds    10x    10s
+    ...    Pattern Should Appear In Log Output    ${CURSOR}    ${pattern}
+
+Should Find Metrics In Journal Log Fails
+    [Documentation]    Logs should not contain metrics message
+    [Arguments]    ${pattern}
+    Pattern Should Not Appear In Log Output    ${CURSOR}    ${pattern}
+
+Get List Prometheus Metrics To Check
+    [Documentation]    Create a list of Prometheus metrics
+
+    ${system_arch}=    Get System Architecture
+    ${deployment_type}=    Get Deployment Type
+    ${arch}=    Set Variable If    "${system_arch}" == "x86_64"    amd64    arm64
+    ${cluster_id}=    Get MicroShift Cluster ID From File
+    ${os_id}=    Get Host OS Id
+    ${os_version}=    Get Host OS Version
+    ${microshift_ver}=    MicroShift Version
+    ${microshift_version}=    Set Variable    ${microshift_ver.major}.${microshift_ver.minor}.${microshift_ver.patch}
+
+    Set Local Variable
+    ...    @{METRICS_TO_CHECK}
+    ...    cluster:capacity_cpu_cores:sum{_id="${cluster_id}",label_beta_kubernetes_io_instance_type="rhde",label_node_openshift_io_os_id="${os_id}",label_kubernetes_io_arch="${arch}"}
+    ...    cluster:capacity_memory_bytes:sum{_id="${cluster_id}",label_beta_kubernetes_io_instance_type="rhde",label_node_openshift_io_os_id="${os_id}",label_kubernetes_io_arch="${arch}"}
+    ...    cluster:cpu_usage_cores:sum{_id="${cluster_id}"}
+    ...    cluster:memory_usage_bytes:sum{_id="${cluster_id}"}
+    ...    cluster:usage:resources:sum{_id="${cluster_id}",resource="pods"}
+    ...    cluster:usage:resources:sum{_id="${cluster_id}",resource="namespaces"}
+    ...    cluster:usage:resources:sum{_id="${cluster_id}",resource="services"}
+    ...    cluster:usage:resources:sum{_id="${cluster_id}",resource="ingresses.networking.k8s.io"}
+    ...    cluster:usage:resources:sum{_id="${cluster_id}",resource="routes.route.openshift.io"}
+    ...    cluster:usage:resources:sum{_id="${cluster_id}",resource="customresourcedefinitions.apiextensions.k8s.io"}
+    ...    cluster:usage:containers:sum{_id="${cluster_id}"}
+    ...    microshift_version{_id="${cluster_id}",deployment_type="${deployment_type}",os_version_id="${os_version}",version="${microshift_version}"}
+
+    RETURN    @{METRICS_TO_CHECK}


Reviews:
user: login: pacevedom
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-06T13:00:46Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T08:59:20Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T08:59:29Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T08:59:51Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T09:00:30Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T09:01:05Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T09:01:22Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T09:01:33Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T09:01:46Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T09:01:54Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T09:02:24Z
user: login: pacevedom
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-08T08:28:17Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-08T08:39:29Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-08T08:54:05Z
user: login: agullon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-08T09:02:17Z
user: login: pacevedom
body: /lgtm
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-09T06:12:34Z

Review comments:
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
path: test/suites/telemetry/telemetry.robot
user: login: pacevedom
body: Is this needed if its disabled?
created_at: 2025-05-06T12:51:32Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
path: test/suites/telemetry/telemetry.robot
user: login: pacevedom
body: If `Metrics sent successfully` appear in the logs it implies this line was also present.
created_at: 2025-05-06T12:53:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
path: test/suites/telemetry/telemetry.robot
user: login: pacevedom
body: This should be part of setup instead?
created_at: 2025-05-06T12:54:09Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
     [Teardown]    Remove Telemetry Configuration
 
 MicroShift Reports Metrics To Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
path: test/suites/telemetry/telemetry.robot
user: login: pacevedom
body: Why not part of the setup?
created_at: 2025-05-06T12:54:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
     [Teardown]    Remove Telemetry Configuration
 
 MicroShift Reports Metrics To Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
path: test/suites/telemetry/telemetry.robot
user: login: pacevedom
body: Same comment.
created_at: 2025-05-06T12:54:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
     [Teardown]    Remove Telemetry Configuration
 
 MicroShift Reports Metrics To Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
+    Stop Proxy Server
     [Teardown]    Remove Telemetry Configuration
 
-Check MicroShift Metrics In Local Server    # robocop: disable=too-long-test-case,too-many-calls-in-test-case
+MicroShift Fails to Report Metrics To Server Telemetry Disabled
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when it is disabled.
+    Setup Telemetry Configuration    ${DISABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
path: test/suites/telemetry/telemetry.robot
user: login: pacevedom
body: Setup?
created_at: 2025-05-06T12:57:22Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
     [Teardown]    Remove Telemetry Configuration
 
 MicroShift Reports Metrics To Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
+    Stop Proxy Server
     [Teardown]    Remove Telemetry Configuration
 
-Check MicroShift Metrics In Local Server    # robocop: disable=too-long-test-case,too-many-calls-in-test-case
+MicroShift Fails to Report Metrics To Server Telemetry Disabled
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when it is disabled.
+    Setup Telemetry Configuration    ${DISABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Telemetry is disabled
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
path: test/suites/telemetry/telemetry.robot
user: login: pacevedom
body: I would do it differently here. Instead of being based in logs, what about setting up prometheus and checking there is nothing there after checking the `Telemetry is disabled` message?
created_at: 2025-05-06T12:58:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
     [Teardown]    Remove Telemetry Configuration
 
 MicroShift Reports Metrics To Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
+    Stop Proxy Server
     [Teardown]    Remove Telemetry Configuration
 
-Check MicroShift Metrics In Local Server    # robocop: disable=too-long-test-case,too-many-calls-in-test-case
+MicroShift Fails to Report Metrics To Server Telemetry Disabled
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when it is disabled.
+    Setup Telemetry Configuration    ${DISABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Telemetry is disabled
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
+
+    [Teardown]    Remove Telemetry Configuration
+
+MicroShift Fails to Report Metrics To Server Wrong Pull Secret
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when the pull secret is wrong.
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_NO_METRICS}
+
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
+    Should Find Metrics In Journal Log Success    Unable to get pull secret: cloud.openshift.com not found
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
path: test/suites/telemetry/telemetry.robot
user: login: pacevedom
body: Same as above.
created_at: 2025-05-06T12:59:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
     [Teardown]    Remove Telemetry Configuration
 
 MicroShift Reports Metrics To Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
+    Stop Proxy Server
     [Teardown]    Remove Telemetry Configuration
 
-Check MicroShift Metrics In Local Server    # robocop: disable=too-long-test-case,too-many-calls-in-test-case
+MicroShift Fails to Report Metrics To Server Telemetry Disabled
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when it is disabled.
+    Setup Telemetry Configuration    ${DISABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Telemetry is disabled
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
+
+    [Teardown]    Remove Telemetry Configuration
+
+MicroShift Fails to Report Metrics To Server Wrong Pull Secret
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when the pull secret is wrong.
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_NO_METRICS}
+
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
+    Should Find Metrics In Journal Log Success    Unable to get pull secret: cloud.openshift.com not found
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
+
+    [Teardown]    Remove Telemetry Configuration
+
+Check MicroShift Metrics Sent To Prometheus Server    # robocop: disable=too-many-calls-in-test-case
     [Documentation]    Check the expected metrics are sent to the local server.
-    [Setup]    Setup Local Telemetry Configuration
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_TO_PROMETHUS}    ${PULL_SECRET_METRICS}
path: test/suites/telemetry/telemetry.robot
user: login: pacevedom
body: Why not [Setup]?
created_at: 2025-05-06T12:59:20Z
author_association: CONTRIBUTOR
diff_hunk: @@ -122,15 +132,13 @@ Check MicroShift Metrics In Local Server    # robocop: disable=too-long-test-cas
 Setup
     [Documentation]    Test suite setup
     Check Required Env Variables
+    Check Required Proxy Variables
path: test/suites/telemetry/telemetry.robot
user: login: pacevedom
body: Embed this one in `Check Required Telemetry Variables` and remove one keyword?
created_at: 2025-05-06T13:00:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
path: test/suites/telemetry/telemetry.robot
user: login: agullon
body: fix it in https://github.com/openshift/microshift/pull/4769/commits/d712e5f1af81adb4021d2ba93407ae42b78cb200 commit
created_at: 2025-05-07T08:59:20Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
     [Teardown]    Remove Telemetry Configuration
 
 MicroShift Reports Metrics To Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
path: test/suites/telemetry/telemetry.robot
user: login: agullon
body: fix it in https://github.com/openshift/microshift/pull/4769/commits/d712e5f1af81adb4021d2ba93407ae42b78cb200 commit
created_at: 2025-05-07T08:59:29Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
     [Teardown]    Remove Telemetry Configuration
 
 MicroShift Reports Metrics To Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
+    Stop Proxy Server
     [Teardown]    Remove Telemetry Configuration
 
-Check MicroShift Metrics In Local Server    # robocop: disable=too-long-test-case,too-many-calls-in-test-case
+MicroShift Fails to Report Metrics To Server Telemetry Disabled
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when it is disabled.
+    Setup Telemetry Configuration    ${DISABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Telemetry is disabled
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
+
+    [Teardown]    Remove Telemetry Configuration
+
+MicroShift Fails to Report Metrics To Server Wrong Pull Secret
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when the pull secret is wrong.
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_NO_METRICS}
+
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
+    Should Find Metrics In Journal Log Success    Unable to get pull secret: cloud.openshift.com not found
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
path: test/suites/telemetry/telemetry.robot
user: login: agullon
body: fix it in https://github.com/openshift/microshift/pull/4769/commits/d712e5f1af81adb4021d2ba93407ae42b78cb200 commit
created_at: 2025-05-07T08:59:50Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
     [Teardown]    Remove Telemetry Configuration
 
 MicroShift Reports Metrics To Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
+    Stop Proxy Server
     [Teardown]    Remove Telemetry Configuration
 
-Check MicroShift Metrics In Local Server    # robocop: disable=too-long-test-case,too-many-calls-in-test-case
+MicroShift Fails to Report Metrics To Server Telemetry Disabled
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when it is disabled.
+    Setup Telemetry Configuration    ${DISABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Telemetry is disabled
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
path: test/suites/telemetry/telemetry.robot
user: login: agullon
body: done it in https://github.com/openshift/microshift/pull/4769/commits/727a92eedada0b85728ffdf277d37026def7efee commit
created_at: 2025-05-07T09:00:30Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
path: test/suites/telemetry/telemetry.robot
user: login: agullon
body: fix it in https://github.com/openshift/microshift/commit/d712e5f1af81adb4021d2ba93407ae42b78cb200 commit
created_at: 2025-05-07T09:01:04Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
path: test/suites/telemetry/telemetry.robot
user: login: agullon
body: fix it in https://github.com/openshift/microshift/commit/d712e5f1af81adb4021d2ba93407ae42b78cb200 commit
created_at: 2025-05-07T09:01:22Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
     [Teardown]    Remove Telemetry Configuration
 
 MicroShift Reports Metrics To Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
path: test/suites/telemetry/telemetry.robot
user: login: agullon
body: fix it in https://github.com/openshift/microshift/commit/d712e5f1af81adb4021d2ba93407ae42b78cb200 commit
created_at: 2025-05-07T09:01:33Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
     [Teardown]    Remove Telemetry Configuration
 
 MicroShift Reports Metrics To Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
+    Stop Proxy Server
     [Teardown]    Remove Telemetry Configuration
 
-Check MicroShift Metrics In Local Server    # robocop: disable=too-long-test-case,too-many-calls-in-test-case
+MicroShift Fails to Report Metrics To Server Telemetry Disabled
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when it is disabled.
+    Setup Telemetry Configuration    ${DISABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
path: test/suites/telemetry/telemetry.robot
user: login: agullon
body: fix it in https://github.com/openshift/microshift/commit/d712e5f1af81adb4021d2ba93407ae42b78cb200 commit
created_at: 2025-05-07T09:01:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,42 +16,80 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                       ${EMPTY}
+${PROXY_PORT}                       ${EMPTY}
+${PROMETHEUS_HOST}                  ${EMPTY}
+${PROMETHEUS_PORT}                  ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}         https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                   http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                 SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY}                SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Disabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${ENABLE_TELEMETRY_WITH_PROXY}      SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                 \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}    SEPARATOR=\n
+...                                 telemetry:
+...                                 \ \ status: Enabled
+...                                 \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                   ${EMPTY}
+${PULL_SECRET}                      /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}              /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}           /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
 MicroShift Reports Metrics To Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
     [Teardown]    Remove Telemetry Configuration
 
 MicroShift Reports Metrics To Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
 
+    Stop Proxy Server
     [Teardown]    Remove Telemetry Configuration
 
-Check MicroShift Metrics In Local Server    # robocop: disable=too-long-test-case,too-many-calls-in-test-case
+MicroShift Fails to Report Metrics To Server Telemetry Disabled
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when it is disabled.
+    Setup Telemetry Configuration    ${DISABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Telemetry is disabled
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
+
+    [Teardown]    Remove Telemetry Configuration
+
+MicroShift Fails to Report Metrics To Server Wrong Pull Secret
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when the pull secret is wrong.
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_NO_METRICS}
+
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
+    Should Find Metrics In Journal Log Success    Unable to get pull secret: cloud.openshift.com not found
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
+
+    [Teardown]    Remove Telemetry Configuration
+
+Check MicroShift Metrics Sent To Prometheus Server    # robocop: disable=too-many-calls-in-test-case
     [Documentation]    Check the expected metrics are sent to the local server.
-    [Setup]    Setup Local Telemetry Configuration
+    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_TO_PROMETHUS}    ${PULL_SECRET_METRICS}
path: test/suites/telemetry/telemetry.robot
user: login: agullon
body: fix it in https://github.com/openshift/microshift/commit/d712e5f1af81adb4021d2ba93407ae42b78cb200 commit
created_at: 2025-05-07T09:01:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -122,15 +132,13 @@ Check MicroShift Metrics In Local Server    # robocop: disable=too-long-test-cas
 Setup
     [Documentation]    Test suite setup
     Check Required Env Variables
+    Check Required Proxy Variables
path: test/suites/telemetry/telemetry.robot
user: login: agullon
body: fix it in https://github.com/openshift/microshift/commit/d712e5f1af81adb4021d2ba93407ae42b78cb200 commit
created_at: 2025-05-07T09:02:24Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,10 +16,21 @@ def check_prometheus_query(host: str, port: int, query: str) -> None:
         raise Exception(f"Prometheus query failed with status code {response.status_code}")
     if response.json().get("status") != "success":
         raise Exception(f"Prometheus query failed with status: {response.json().get('status')}")
+    return response
+
+
+def check_prometheus_query(host: str, port: int, query: str) -> None:
+    response = _run_prometheus_query(host, port, query)
     if not response.json().get("data", {}).get("result") or len(response.json().get("data", {}).get("result")) == 0:
         raise Exception("Prometheus query returned no results")
 
 
+def check_prometheus_query_is_missing(host: str, port: int, query: str) -> None:
+    response = _run_prometheus_query(host, port, query)
+    if response.json().get("data", {}).get("result") and len(response.json().get("data", {}).get("result")) == 1:
path: test/resources/prometheus.py
user: login: pacevedom
body: Is the result always 1, or should the exception be raised if `!=0`?
created_at: 2025-05-08T08:23:17Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,106 +17,109 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                           ${EMPTY}
+${PROXY_PORT}                           ${EMPTY}
+${PROMETHEUS_HOST}                      ${EMPTY}
+${PROMETHEUS_PORT}                      ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}             https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                       http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                     SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY_TO_PROMETHEUS}      SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Disabled
+...                                     \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${ENABLE_TELEMETRY_WITH_PROXY}          SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                     \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}        SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                       ${EMPTY}
+${PULL_SECRET}                          /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}                  /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}               /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
-MicroShift Reports Metrics To Server
+MicroShift Reports Metrics To Default Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
+    [Setup]    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
path: test/suites/telemetry/telemetry.robot
user: login: pacevedom
body: I meant removing this line, as line 55 also ensures that this one is present. Mentioning this because relying on logs is usually not very robust, but for the next line we have no other option unless we implement yet more metrics in microshift (which we dont have, might be a good idea for the future).
created_at: 2025-05-08T08:26:25Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,106 +17,109 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                           ${EMPTY}
+${PROXY_PORT}                           ${EMPTY}
+${PROMETHEUS_HOST}                      ${EMPTY}
+${PROMETHEUS_PORT}                      ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}             https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                       http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                     SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY_TO_PROMETHEUS}      SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Disabled
+...                                     \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${ENABLE_TELEMETRY_WITH_PROXY}          SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                     \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}        SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                       ${EMPTY}
+${PULL_SECRET}                          /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}                  /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}               /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
-MicroShift Reports Metrics To Server
+MicroShift Reports Metrics To Default Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
+    [Setup]    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
 
     [Teardown]    Remove Telemetry Configuration
 
-MicroShift Reports Metrics To Server Through Proxy
+MicroShift Reports Metrics To Default Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
-
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    [Setup]    Run Keywords
+    ...    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    ...    AND
+    ...    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+
+    [Teardown]    Run Keywords
+    ...    Remove Telemetry Configuration
+    ...    AND
+    ...    Stop Proxy Server
+
+MicroShift Fails to Report Metrics To Prometheus Server With Telemetry Disabled
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when it is disabled.
+    [Setup]    Run Keywords
+    ...    Start Prometheus Server
+    ...    AND
+    ...    Setup Telemetry Configuration    ${DISABLE_TELEMETRY_TO_PROMETHEUS}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Telemetry is disabled
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
path: test/suites/telemetry/telemetry.robot
user: login: pacevedom
body: This should be redundant in the presence of previous line and the prometheus checks below.
created_at: 2025-05-08T08:27:32Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,106 +17,109 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                           ${EMPTY}
+${PROXY_PORT}                           ${EMPTY}
+${PROMETHEUS_HOST}                      ${EMPTY}
+${PROMETHEUS_PORT}                      ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}             https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                       http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                     SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY_TO_PROMETHEUS}      SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Disabled
+...                                     \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${ENABLE_TELEMETRY_WITH_PROXY}          SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                     \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}        SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                       ${EMPTY}
+${PULL_SECRET}                          /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}                  /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}               /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
-MicroShift Reports Metrics To Server
+MicroShift Reports Metrics To Default Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
+    [Setup]    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
path: test/suites/telemetry/telemetry.robot
user: login: agullon
body: I agree, I'll keep the log message check as simple as possible. So I'll remove all code lines:
`Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.`
created_at: 2025-05-08T08:39:28Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,106 +17,109 @@ Test Tags           restart    slow
 
 
 *** Variables ***
-${PROXY_HOST}                   ${EMPTY}
-${PROXY_PORT}                   ${EMPTY}
-${PROMETHEUS_HOST}              ${EMPTY}
-${PROMETHEUS_PORT}              ${EMPTY}
-${TELEMETRY_WRITE_ENDPOINT}     https://infogw.api.openshift.com/metrics/v1/receive
-${ENABLE_TELEMETRY}             SEPARATOR=\n
-...                             telemetry:
-...                             \ \ status: Enabled
-${JOURNAL_CURSOR}               ${EMPTY}
-${PULL_SECRET}                  /etc/crio/openshift-pull-secret
-${PULL_SECRET_METRICS}          /etc/crio/openshift-pull-secret-with-telemetry
-${PULL_SECRET_NO_METRICS}       /etc/crio/openshift-pull-secret-without-telemetry
+${PROXY_HOST}                           ${EMPTY}
+${PROXY_PORT}                           ${EMPTY}
+${PROMETHEUS_HOST}                      ${EMPTY}
+${PROMETHEUS_PORT}                      ${EMPTY}
+${TELEMETRY_WRITE_ENDPOINT}             https://infogw.api.openshift.com/metrics/v1/receive
+${PROXY_ENDPOINT}                       http://${PROXY_HOST}:${PROXY_PORT}/api/v1/write
+${ENABLE_TELEMETRY}                     SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+${DISABLE_TELEMETRY_TO_PROMETHEUS}      SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Disabled
+...                                     \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${ENABLE_TELEMETRY_WITH_PROXY}          SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: ${TELEMETRY_WRITE_ENDPOINT}
+...                                     \ \ proxy: ${PROXY_ENDPOINT}
+${ENABLE_TELEMETRY_TO_PROMETHUS}        SEPARATOR=\n
+...                                     telemetry:
+...                                     \ \ status: Enabled
+...                                     \ \ endpoint: http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}/api/v1/write
+${JOURNAL_CURSOR}                       ${EMPTY}
+${PULL_SECRET}                          /etc/crio/openshift-pull-secret
+${PULL_SECRET_METRICS}                  /etc/crio/openshift-pull-secret-with-telemetry
+${PULL_SECRET_NO_METRICS}               /etc/crio/openshift-pull-secret-without-telemetry
 
 
 *** Test Cases ***
-MicroShift Reports Metrics To Server
+MicroShift Reports Metrics To Default Server
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server without errors.
-    [Setup]    Setup Telemetry Configuration
+    [Setup]    Setup Telemetry Configuration    ${ENABLE_TELEMETRY}    ${PULL_SECRET_METRICS}
 
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
 
     [Teardown]    Remove Telemetry Configuration
 
-MicroShift Reports Metrics To Server Through Proxy
+MicroShift Reports Metrics To Default Server Through Proxy
     [Documentation]    Check MicroShift is able to send metrics to the telemetry server through a proxy without errors.
-    [Setup]    Setup Telemetry Configuration With Proxy
-
-    Wait Until Keyword Succeeds    10x    10s
-    ...    Should Find Metrics Success
+    [Setup]    Run Keywords
+    ...    Start Proxy Server    host=${PROXY_HOST}    port=${PROXY_PORT}
+    ...    AND
+    ...    Setup Telemetry Configuration    ${ENABLE_TELEMETRY_WITH_PROXY}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    MicroShift telemetry starting, sending first metrics collection.
+    Should Find Metrics In Journal Log Success    Metrics sent successfully
+
+    [Teardown]    Run Keywords
+    ...    Remove Telemetry Configuration
+    ...    AND
+    ...    Stop Proxy Server
+
+MicroShift Fails to Report Metrics To Prometheus Server With Telemetry Disabled
+    [Documentation]    Check MicroShift is not able to send metrics to the telemetry server when it is disabled.
+    [Setup]    Run Keywords
+    ...    Start Prometheus Server
+    ...    AND
+    ...    Setup Telemetry Configuration    ${DISABLE_TELEMETRY_TO_PROMETHEUS}    ${PULL_SECRET_METRICS}
+
+    Should Find Metrics In Journal Log Success    Telemetry is disabled
+    Should Find Metrics In Journal Log Fails    Metrics sent successfully
path: test/suites/telemetry/telemetry.robot
user: login: agullon
body: I agree, although I prefer to keep this line because it's the only way we can be sure metrics are not sent when it shouldn't be sent.
created_at: 2025-05-08T08:54:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,10 +16,21 @@ def check_prometheus_query(host: str, port: int, query: str) -> None:
         raise Exception(f"Prometheus query failed with status code {response.status_code}")
     if response.json().get("status") != "success":
         raise Exception(f"Prometheus query failed with status: {response.json().get('status')}")
+    return response
+
+
+def check_prometheus_query(host: str, port: int, query: str) -> None:
+    response = _run_prometheus_query(host, port, query)
     if not response.json().get("data", {}).get("result") or len(response.json().get("data", {}).get("result")) == 0:
         raise Exception("Prometheus query returned no results")
 
 
+def check_prometheus_query_is_missing(host: str, port: int, query: str) -> None:
+    response = _run_prometheus_query(host, port, query)
+    if response.json().get("data", {}).get("result") and len(response.json().get("data", {}).get("result")) == 1:
path: test/resources/prometheus.py
user: login: agullon
body: fixed in https://github.com/openshift/microshift/pull/4769/commits/b2563d6a8d2d84ae0d2d9b6e433c20e630e46faa commit
created_at: 2025-05-08T09:02:17Z
author_association: CONTRIBUTOR

PR comments:
user: login: openshift-ci-robot
created_at: 2025-04-04T10:00:51Z
body: @agullon: This pull request references [USHIFT-2575](https://issues.redhat.com//browse/USHIFT-2575) which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set.

<details>

In response to [this](https://github.com/openshift/microshift/pull/4769):

>Add 2 telemetry test cases:
>- MicroShift Fails to Report Metrics To Server: Telemetry Disabled
>- MicroShift Fails to Report Metrics To Server: Wrong Pull Secret


Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fmicroshift).  If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
</details>
author_association: NONE
user: login: agullon
created_at: 2025-04-04T10:01:20Z
body: /hold until all PR form telemetry feature are merged
author_association: CONTRIBUTOR
user: login: agullon
created_at: 2025-04-14T10:33:30Z
body: Rebase it to main after https://github.com/openshift/microshift/pull/4780 is merged
author_association: CONTRIBUTOR
user: login: agullon
created_at: 2025-04-30T12:33:13Z
body: /hold until https://github.com/openshift/microshift/pull/4825 PR is merged
author_association: CONTRIBUTOR
user: login: agullon
created_at: 2025-05-06T10:15:29Z
body: /hold cancel
author_association: CONTRIBUTOR
user: login: agullon
created_at: 2025-05-08T10:12:24Z
body: /retest-required
author_association: CONTRIBUTOR
user: login: openshift-ci[bot]
created_at: 2025-05-08T11:22:14Z
body: @agullon: all tests **passed!**


[Full PR test history](https://prow.ci.openshift.org/pr-history?org=openshift&repo=microshift&pr=4769). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:agullon).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
author_association: CONTRIBUTOR
user: login: openshift-ci[bot]
created_at: 2025-05-09T06:12:54Z
body: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/openshift/microshift/pull/4769#" title="Author self-approved">agullon</a>*, *<a href="https://github.com/openshift/microshift/pull/4769#pullrequestreview-2827130183" title="LGTM">pacevedom</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=openshift%2Fmicroshift).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/openshift/microshift/blob/main/OWNERS)~~ [agullon,pacevedom]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
author_association: CONTRIBUTOR
user: login: agullon
created_at: 2025-05-09T07:04:20Z
body: /cherry-pick release-4.19
author_association: CONTRIBUTOR
user: login: openshift-cherrypick-robot
created_at: 2025-05-09T07:05:02Z
body: @agullon: #4769 failed to apply on top of branch "release-4.19":
```
Applying: add 2 telemetry test cases
Using index info to reconstruct a base tree...
A	test/suites/standard2/telemetry.robot
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): test/suites/standard2/telemetry.robot deleted in HEAD and modified in add 2 telemetry test cases. Version add 2 telemetry test cases of test/suites/standard2/telemetry.robot left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 add 2 telemetry test cases

```

<details>

In response to [this](https://github.com/openshift/microshift/pull/4769#issuecomment-2865379665):

>/cherry-pick release-4.19


Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
</details>
author_association: NONE