Add support for meta-metrics in exporter library

Description

Requirement

Exporters which connect to Prometheus do not provide any metrics about collectors. Collector level information (such as time taken for scrape, number of metrics generated, number of unique labels generated, etc) is neither generated, nor stored anywhere.

We need to generate such metrics, like other metrics, per scrape by Prometheus.

Scope

We only target following exporters in this ticket:

  • MongoDB exporter

  • MySQL exporter

  • Postgres exporter

Any other exporter is out of scope for this ticket.

Acceptance Criteria

(Scope reduced for 2.29 release) - only mongodb_exporter supported.

Following metrics should be generated at exporter level:

  • Memory usage

  • File descriptors in use

  • Uptime

  • Total collector execution time

  • Exporter errors

  • Scrape rate

  • Service availability check

(Exporter level metrics are already in place before this change)

Following metrics should be generated at collector level :

  • Scrape rate

  • Total execution time

Suggested Implementation

We should create our own fork of Golang client library. This will allow us to reuse logic for metric generation across collectors. This would also allow us to upstream our changes.

How to test

None

How to document

None

Smart Checklist

Activity

Puneet Kala July 13, 2022 at 9:39 AM

verified metrics for total execution time on RC

Alexey Mukas July 1, 2022 at 9:01 AM

the root cause was non-unique ID of metric, so if we generate few metrics for collectors it will fail due to attempt of caching 2 metrics with the same ID.

https://github.com/Percona-Lab/client_golang/pull/1#discussion_r911520046

 

Roma Novikov May 18, 2022 at 1:12 PM

The ideal case will be to have the metrics collected and exposed on https://pmmdemo.percona.com/graph/d/prometheus-status/prometheus-exporter-status  (like we have MysqlD metrics) so we can see and analyze them 

Done

Details

Assignee

Reporter

Priority

Components

Needs QA

Yes

Needs Doc

Yes

Fix versions

Story Points

Smart Checklist

Created April 26, 2022 at 12:42 PM
Updated November 13, 2024 at 9:48 AM
Resolved August 5, 2022 at 9:00 AM