Comment on page
Prometheus provider
The Prometheus provider collects metrics from a Prometheus instance and makes them available to Akamas.
This provider includes support for several technologies (Prometheus exporters). In any case, custom queries can be defined to gather the desired metrics.
This section provides the minimum requirements that you should match before using the Prometheus provider.
Akamas supports Prometheus starting from version
2.26.
Using also the
prometheus-operator
requires Prometheus 0.47 or greater. This version is bundled with the kube-prometheus-stack
since version 15.
Connectivity between the Akamas server and the Prometheus server is also required. By default, Prometheus is run on port 9090.
The Prometheus provider includes queries for most of the monitoring use cases these exporters cover. If you need to specify custom queries or make use of exporters not currently supported you can specify them as described in creating Prometheus telemetry instances.
- Kubernetes (Pod, Container, Workload, Namespace)
- Web Application
- Java (java-ibm-j9vm-6, java-ibm-j9vm-8, java-eclipse-openj9-11, java-openjdk-8, java-openjdk-11, java-openjdk-17)
- Linux (Ubuntu-16.04, Rhel-7.6)
Refer to Prometheus provider metrics mapping to see how component-type metrics are extracted by this provider.
Akamas reasons in terms of a system to be optimized and in terms of parameters and metrics of components of that system. To understand which metrics collected from Prometheus should be mapped to a component, the Prometheus provider looks up some properties in the components of a system grouped under
prometheus
property. These properties depend on the exporter and the component type.Nested under this property you can also include any additional field your use case may require to filter the imported metrics further. These fields will be appended in queries to the list of label matches in the form
field_name=~'field_value'
, and can specify either exact values or patterns.Notice: you should configure your Prometheus instances so that the Prometheus provider can leverage the
instance
property of components, as described in the Setup datasource section here above.It is important that you add
instance
and, optionally, the job
properties to the components of a system so that the Prometheus provider can gather metrics from them:1
# Specification for a component, whose metrics should be collected by the Prometheus Provider
2
name: jvm1 # name of the component
3
description: jvm1 for payment services # description of the component
4
properties:
5
prometheus:
6
instance: service0001 # instance of the component: where the component is located relative to Prometheus
7
job: jmx # job of the component: which prom exporter is gathering metrics from the component
The Prometheus provider does not usually require a specific configuration of the Prometheus instance it uses.
When gathering metrics for hosts it's usually convenient to set the value of the
instance
label so that it matches the value of the instance
property in a component; in this way, the Prometheus provider knows which system component each data point refers to.Here’s an example configuration for Prometheus that sets the
instance
label:1
# Custom global config
2
global:
3
scrape_interval: 5s # Set the scrape interval to every 15 seconds. The default is every 1 minute.
4
evaluation_interval: 5s # Evaluate rules every 15 seconds. The default is every 1 minute.
5
# scrape_timeout is set to the global default (10s).
6
7
# A scrape configuration containing exactly one endpoint to scrape:
8
scrape_configs:
9
# Node Exporter
10
- job_name: 'node'
11
static_configs:
12
- targets: ["localhost:9100"]
13
relabel_configs:
14
- source_labels: ["__address__"]
15
regex: "(.*):.*"
16
target_label: instance
17
replacement: value_of_instance_property_in_the_component_the_data_points_should_refer_to
Last modified 3mo ago