Skip to main content

FIWARE Prometheus Publisher

This software (fiprom) allows to publish metrics generated by Ceilometer in Prometheus. It allows to modify/enrich metrics before publishing them.

This project started from the need of collecting metrics generated by the FIWARE node located in Vicenza that is running an old version of Ceilometer (v 2015.1.1). Newer version of Ceilometer have a Prometheus publisher distributed along with Ceilometer itself and, therefore, there is no need for this custom publisher (excepting for customizing metrics metadata).

Installation

Fiprom works as a Ceilometer plugin loaded at runtime. It must be installed as library in the same environment where Ceilometer services are installed. It can be done simply:

pip install fiware-prometheus-publisher

An alternative way is to install the component in a Python virtualenv. In this case, also Ceilometer must be installed and executed from the virtualenv.

export PBR_VERSION=0.10.0
pip install -U 'pbr==0.11.0' testrepository setuptools

wget https://github.com/openstack/ceilometer/archive/2015.1.1.zip && unzip 2015.1.1.zip
RUN cd ceilometer-2015.1.1 && pip install .

pip install fiware-prometheus-publisher

Alternatively, the Docker image fiware-prometheus-publisher can be used. The image runs a Ceilometer Collector service configured to use fiprom as storage backend.

Configuration

Fiprom load its configuration through the ceilometer.conf file in the [fiprom] section. These are the supported keys and their default values:

[fiprom]

# URL of the Push Gateway where metrics created will be publihsed
push_gateway = http://localhost:9091/metrics/job/fiprom/infrastructure/fiware

# Configuration file for the conversion of Ceilometer samples to Prometheus metrics
converter_conf_file =

# Customize the location of the labels cache
cache_file=/tmp/fiprom.cache

# Mapping file for names of VMs, hosts and users
names_file =

# Mapping file for tenant groups
tenant_group_file =

# If set, logs samples received and metrics created in this file
log_file =

# If true, do not  make the call to the Push Gateway
dryrun = False

In addition to this configuration, the following has to be added:

  • to use as Ceilomter pipeline publisher, add the following in your pipeline.yaml :

    - publishers:
      - fiprom://
    
  • to use as backend for the Ceilometer Collector, add the following to your ceilometer.conf

    [database]
    metering_connection=fiprom://
    # also the key connection can be used
    

Further configuration files

The basic configuration (see Configuration) activate fiprom, but to be useful it needs further configuration on how to convert metrics from Ceilometer to Prometheus.

Converter Conf file

This file (converter_conf_file) tells fiprom which metrics should be converted and how labels of each metric should be mapped. It is in YAML format and must follow this schema:

enabled:
  - '<sample_name_pattern_1>'
  - '<sample_name_pattern_2>'
  - ...
labels:
  - <sample_name_pattern_x>:
    - <label_name_1>: '<python_expression>'
    - <label_name_2>: '<python_expression>'
    - ...
  - <sample_name_pattern_y>:
  	- ...

A working configuration with detailed comments can be found at fiprom_converter_conf.yaml file.

Names file

This file (names_file) contains the mapping between IDs of OpenStack objects and their names. Since most of the metrics created by Ceilometer only contain IDs of objects, this mapping file is required to add label with names (more human readable) to Prometheus metrics.

The file must contain one mapping for each line in the format:

<id> <delimiter> <name>

'=' or ':' characters are used as delimiter if found in the row, otherwise space, tab or comma characters are used. All of these are valid lines:

acede503-78e4-49cf-adbc-bd87390d4f6a helloworld
4c9e370ae557689709a64e9b543d50fd0f1538d0c5a22ac30c5afb41,  host1.eng.it
f7eb45f96d62423a805bd2ee5734d961: admin
f00a0cba70174563b6deef58dffebda2  = This is a demo, project 

Tenant Group file

This file (tenant_group_file) is used to assign a group to each tenant. Fiprom will add a tenant_group label when a mapping is found. The file is in the format:

<tenant_id_or_name> <delimiter> <group>

Same rules on delimiters applies of the names file.

Metadata

Release files for fiware-prometheus-publisher 0.0.40

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fiware-prometheus-publisher 0.0.40
File Size Uploaded Provenance
fiware-prometheus-publisher-0.0.40.tar.gz 9.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fiware-prometheus-publisher 0.0.40
File Interpreter ABI Platform
fiware_prometheus_publisher-0.0.40-py2-none-any.whl Python 2 none any Details

Total release size: 26.8 kB

Release files / fiware-prometheus-publisher-0.0.40.tar.gz

Download URL fiware-prometheus-publisher-0.0.40.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f2ad0146b748902d70f9ee281342c569c5db211b472190e4f158215bdadd1130
BLAKE2b-256 checksum
How to use checksums
8004062c58b62eeb159c8200ce9b88cb1e2e28ac642a1170e20020c3a915a15e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.14

Release files / fiware_prometheus_publisher-0.0.40-py2-none-any.whl

Download URL fiware_prometheus_publisher-0.0.40-py2-none-any.whl
Size 17.6 kB
Tags Python 2
SHA-256 checksum
How to use checksums
38471ab6d6743585999af158ac1896114dc975a1d6744c0f816f19797b75222f
BLAKE2b-256 checksum
How to use checksums
b934891e87429468c02bc1c199d4fe92e584e13dfb29e2036031c9815cc5511d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.14

Security for fiware-prometheus-publisher 0.0.40

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.40 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page