new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMonitoringExporter.java
private static void checkMetricsViaPrometheus(String searchKey, String expectedVal)
      throws Exception {

    // url
    String curlCmd =
        String.format("curl --silent --show-error --noproxy '*'  http://%s:%s/api/v1/query?query=%s",
            K8S_NODEPORT_HOST, nodeportserver, searchKey);

    logger.info("Executing Curl cmd {0}", curlCmd);
    logger.info("Checking searchKey: {0}", searchKey);
    logger.info(" expected Value {0} ", expectedVal);


    withStandardRetryPolicy
            .conditionEvaluationListener(
                condition -> logger.info("Check prometheus metric {0} against expected {1} "
                                + "(elapsed time {2}ms, remaining time {3}ms)",
                        searchKey,
                        expectedVal,
                        condition.getElapsedTimeInMS(),
                        condition.getRemainingTimeInMS()))
            .until(searchForKey(curlCmd, expectedVal));
  }
/**
   * Check metrics using Prometheus.
   *
   * @param searchKey   - metric query expression
   * @param expectedVal - expected metrics to search
   * @throws Exception if command to check metrics fails
   */
Check metrics using Prometheus.
@param searchKey   - metric query expression
@param expectedVal - expected metrics to search
@throws Exception if command to check metrics fails
Check metrics using Prometheus . @param searchKey - metric query expression @param expectedVal - expected metrics to search @throws Exception if command to check metrics fails
private static void checkMetricsViaPrometheus(String searchKey, String expectedVal)
      throws Exception {
    String curlCmd =
        String.format("curl --silent --show-error --noproxy '*'  http://%s:%s/api/v1/query?query=%s",
            K8S_NODEPORT_HOST, nodeportserver, searchKey);
    logger.info("Executing Curl cmd {0}", curlCmd);
    logger.info("Checking searchKey: {0}", searchKey);
    logger.info(" expected Value {0} ", expectedVal);
    withStandardRetryPolicy
            .conditionEvaluationListener(
                condition -> logger.info("Check prometheus metric {0} against expected {1} "
                                + "(elapsed time {2}ms, remaining time {3}ms)",
                        searchKey,
                        expectedVal,
                        condition.getElapsedTimeInMS(),
                        condition.getRemainingTimeInMS()))
            .until(searchForKey(curlCmd, expectedVal));
  }
private static void checkMetricsViaPrometheus ( String searchKey , String expectedVal ) throws Exception { String curlCmd = String . format ( "curl --silent --show-error --noproxy '*'  http://%s:%s/api/v1/query?query=%s" , K8S_NODEPORT_HOST , nodeportserver , searchKey ) ; logger . info ( "Executing Curl cmd {0}" , curlCmd ) ; logger . info ( "Checking searchKey: {0}" , searchKey ) ; logger . info ( " expected Value {0} " , expectedVal ) ; withStandardRetryPolicy . conditionEvaluationListener ( condition -> logger . info ( "Check prometheus metric {0} against expected {1} " + "(elapsed time {2}ms, remaining time {3}ms)" , searchKey , expectedVal , condition . getElapsedTimeInMS ( ) , condition . getRemainingTimeInMS ( ) ) ) . until ( searchForKey ( curlCmd , expectedVal ) ) ; }
Check metrics using Prometheus.
Check metrics using Prometheus .
// url