Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-3774

Refactor local/ephemeral testing for swatch-metrics using Prometheus

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Undefined Undefined
    • Next - API
    • None
    • None
    • None

      When running IQE component tests for SWATCH metrics which depends on a running Prometheus instance, what we do is:

      • create a prometheus file with the metrics
      • import this file directly to the Prometheus instance
      • wait for the swatch metrics to watch the metrics from the file we imported

      However, depending on the environment where we run the test, how we do the above is different.

      • For an ephemeral environment:
        We use the OpenShift client tool to get the prometheus pod
        Then, copy the file with the metrics directly to the pod
        And finally, we execute an internal tool called promtool directly into the prometheus pod
      • For a local environment:
        We use the Podman client tool to copy the file with the metrics using "podman cp"
        And finally, we execute the same internal tool called promtool directly into the container

      These two different implementations has the following drawbacks:

      • We depend on internal client tools like the OpenShift client binary and the Podman client binary
      • The logic is different for ephemeral and for local environments, so we need to maintain two logics that serve the same purpose
      • For local testing, If we intend to run this IQE test inside another container, the local logic won't work since we can't connect to a container from another container.

      In order to address all the above limitations:

      This API will listen for new files and internally it will call the promtool internal tool.

      • And then, we can now use the same logic that calls this new API to do this import.

              jcarvaja@redhat.com Jose Carvajal Hilario
              jcarvaja@redhat.com Jose Carvajal Hilario
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: