[AIAB-02] Create the Telemetry Provider

It is time now to configure Akamas telemetry to collect the relevant JMeter performance metrics. You will use the out-of-the-box Prometheus provider for that purpose.

The Prometheus telemetry provider collects metrics for a variety of technologies, including JVM and Linux OS metrics. Moreover, you can easily extend it to import additional metrics via custom promQL queries. In this example, you are collecting JMeter performance test metrics that are exposed by the JMeter Prometheus exporter already configured in the Konakart performance environment.

The file tel_prometheus.yaml defines the telemetry instance as follows - make sure to replace the target_host placeholder with the address of your Konakart instance:

provider: Prometheus

config:
  address: target_host
  port: 9090

metrics:
  - metric: transactions_throughput
    datasourceMetric: 'sum(rate(Ratio_success{instance=~"$INSTANCE$"}[30s]))'
  - metric: transactions_response_time
    datasourceMetric: 'avg((rate(ResponseTime_sum{instance=~"$INSTANCE$",code="200"}[30s])/(rate(ResponseTime_count{instance=~"$INSTANCE$",code="200"}[30s])>0)))'
  - metric: transactions_response_time_p90
    datasourceMetric: 'avg(ResponseTime{instance="$INSTANCE$", code="200", quantile="0.9"})'
  - metric: transactions_error_rate
    datasourceMetric: 'sum(rate(Ratio_failure{instance="$INSTANCE$"}[30s]) ) / sum(rate(Ratio_total{instance=~"$INSTANCE$"}[30s]))'
  - metric: users
    datasourceMetric: 'sum(jmeter_threads{instance=~"$INSTANCE$",state="active"})'

Now create a telemetry instance associated with the konakart system:

akamas create telemetry-instance tel_prometheus.yaml konakart

Now you can test the Prometheus integration by running again the baseline study you have created before (you can simply press again the Start button in the Study page). At the end of the experiment, you should see JMeter performance metrics such as transactions_throughput and transactions_response_time displayed as time series in the Metrics tab, and as aggregated metrics in the Analysis tab:

At this point, you can launch your JMeter performance tests from Akamas and see the relevant performance metrics imported from Prometheus.

Add the JVM component

Before starting the optimization, you need to also add the JVM component to your system.

First of all, install the Java optimization pack:

The file comp_jvm.yaml defines the JVM as follows:

name: jvm
description: The JVM running e-commerce platform
componentType: java-openjdk-11
properties:
  prometheus:
    instance: sut_konakart
    job: jmx

Notice that the jvm component has some additional properties, instance and job, under the prometheus group. These properties are used by the Prometheus telemetry provider as values for the corresponding instance and job labels used in Prometheus queries to collect JVM metrics (e.g. JVM garbage collection time or heap utilization). The Prometheus telemetry provider collects these metrics out-of-the-box - no query needs to be specified.

You can create the JVM component as follows:

akamas create component comp_jvm.yaml konakart

You can now see all the JVM parameters and metrics from the UI:

At this point, your system is composed of the web application and the JVM component you need to perform the optimization study.

Last updated