Table of contents
1.
Introduction
2.
PuppetDB
3.
Metrics API
3.1.
Among these endpoints are. 
4.
Metrics endpoint
4.1.
Re-enable metrics v1 endpoint
4.2.
Listing available metrics
4.2.1.
Request format
4.2.2.
Response format
4.3.
Retrieving a specific metric
4.3.1.
Request format
4.3.2.
Response format
4.4.
Bulk retrieving metrics
4.4.1.
Request format
4.4.2.
Response format
4.5.
Useful metrics
5.
Metrics API changes in PuppetDB 4
5.1.
Population Metrics
5.2.
HTTP Metrics
5.3.
Message Queue (MQ) Metrics
5.4.
Dead Letter Office (DLO) Metrics
5.5.
Storage Metrics
6.
Frequently Asked Questions
6.1.
How do you measure API performance?
6.2.
What are the most common API metrics?
6.3.
What is the purpose of PuppetDB?
6.4.
What information is stored in PuppetDB?
6.5.
What is a Puppet?
7.
Conclusion
Last Updated: Aug 13, 2025
Medium

Metrics API version 1 in PuppetDB

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Hello Ninjas!! In this article, the topic we'll discuss is  Metrics API version 1 in  PuppetDB. PuppetDB is a stable and flexible data storage.

Introduction

There are two main sub-topics in this topic: Metrics endpoint and Metrics API changes in PuppetDB 4.

Before starting, if you have not installed Puppet, you may check this out,  how to Install and Set up Puppet Enterprise

First, let's understand what is PuppetDB and Metrics API.

PuppetDB

It is an open-source storage solution for data generated by Puppet. The initial release offers a drop-in data storing service and also stores configs.

PuppetDB

It is made with very advanced technology which uses all resources. Also, the master is free to create other collections because it consistently stores all of its data.

puppetDb

Credit: https://opengraph.githubassets.com

Metrics API

An additional, by default active web interface for Java Management Extension metrics, specifically managed beans, is included in Puppet Enterprise (MBeans).

Among these endpoints are.
 

  • POST /metrics/v1/mbeans.
     
  • GET /metrics/v1/mbeans.
     
  • GET /metrics/v1/mbeans/<name>.

Metrics endpoint

Querying PuppetDB metrics is done by sending an HTTP request to the /metrics/v1 REST endpoint. The metrics v1 API is deleted and disabled by default. Please use the /metrics/v2 endpoint instead.

🧠 Because of a CVE (Common Vulnerabilities and Exposures) described in CVE-2020-7943, the metrics/v1 endpoint has been disabled by default.

🧠If needed, you can re-enable this endpoint from config settings from the section Re-enable metrics v1 endpoints.

🧠Please remember that, in most cases, PuppetDB is simply a channel to MBeans has given access by its parts. 

Re-enable metrics v1 endpoint

Create metrics.conf file in the /etc/puppetlabs/puppetdb/conf.d/ directory, or wherever your PuppetDB conf.d/ directory is located to re-enable this endpoint.The following file should include the information.

  metrics: {
        metrics-webservice: {
            mbeans: {
                enabled: true
            }
        }
    }

To re-enable the endpoint, restart the PuppetDB service.

Listing available metrics

Listing available metrics

Request format

To obtain a list of all available metric names, follow these steps:

  • Obtain /metrics/v1/mbeans.
     
  • Use the GET method.

Response format

Responses contain a JSON object that maps a string to another string:

  • The name of a valid MBean is used as the key.
     
  • The value is a URI to use when asking for the attributes of an MBean.

Retrieving a specific metric

Retrieving a specific metric

Request format

To obtain the characteristics of a specific metric:

  • Request </metrics/v1/mbeans/name>, where <name> is a metric from the list of available metrics specified above.
     
  • Use the GET method.

Response format

The responses contain a JSON object that maps strings to (strings/numbers/Booleans).

Bulk retrieving metrics

Request format

By POSTING a JSON array to the Mbeans endpoint, the Request format can retrieve multiple metrics in a single call. Here's an example:

 curl -X POST \
   -H "Content-Type: application/json" \
   -d '["puppetlabs.puppetdb.storage:name=replace-facts-time", "puppetlabs.puppetdb.storage:name=replace-catalog-time"]' \
   http://localhost:8081/metrics/v1/mbeans

 

Response format

The result is a collection of JSON objects. The results are displayed in the order they were supplied in the POSTED array. The JSON objects are identical to those obtained individually via the MBean/name> endpoint.

Useful metrics

These are some useful metrics:

  • Population Metrics.
     
  • Database Metrics.
     
  • Message Queue Metrics.

          ⭐Global Metrics.

          ⭐Metrics for each Command Version.

  • HTTP Metrics.
     
  • Storage Metrics.
     
  • JVM Metrics.

Metrics API changes in PuppetDB 4

The names of most metrics were changed in PuppetDB 4 to be constant with other Puppet parts and to provide a more reflexive naming scheme. This document describes the relationship between the metric names before and after PuppetDB 4.

Population Metrics

Population Metrics

Consider the following metrics:

Population Metrics

Now respectively.

Population Metrics

HTTP Metrics

Before PuppetDB 4, HTTP metrics were distributed across multiple namespaces. All HTTP metrics are now grouped in the same namespace.

HTTP Metrics

Here are some specific examples:

HTTP Metrics

HTTP Metrics

Message Queue (MQ) Metrics

The puppetlabs.puppetdb.mq namespace now contains command processing metrics related to the message queue.

The following terms are now in use.

Message Queue (MQ) Metrics

Message Queue (MQ) Metrics

Consider the following message queue metrics:

Message Queue (MQ) Metrics

Would now be as follows:

Message Queue (MQ) Metrics

Dead Letter Office (DLO) Metrics

The DLO metrics now have the following structure:

Dead Letter Office (DLO) Metrics

Dead Letter Office (DLO) Metrics

Storage Metrics

The names of the storage metrics have been shortened using the following event:

Storage Metrics

Example: 

Storage Metrics

Frequently Asked Questions

How do you measure API performance?

The most basic set of metrics for measuring API performance is operational metrics. The metrics include the number of API calls and CPU and memory usage.

What are the most common API metrics?

CPU and memory usage are the two most crucial API infra metrics that we monitor. A high CPU usage can indicate server overloading, resulting in severe obstacles. Memory usage provides insight into the amount of resource utilization.

What is the purpose of PuppetDB?

PuppetDB is a scalable and dependable Puppet data store. PuppetDB collects Puppet-generated data and also provides advanced functionality through a powerful API. Zabbix is a distributed monitoring solution that is open-source and enterprise-class.

What information is stored in PuppetDB?

PuppetDB is an open-source storage service for Puppet-generated data. This currently includes catalogues and facts but will be expanded shortly. The first release includes a drop-in replacement for store configs and the inventory service.

What is a Puppet?

Puppet offers the capability to specify the software and config that a system needs and then, after initial setup, to maintain a given state. To specify config options for a particular environment or infrastructure, you utilise a declarative Domain Specific Language (DSL). 

Conclusion

In this article we learned about the Metrics API version 1 in PuppetDB. This topic contains metrics endpoint and Metrics API changes in PuppetDB4 You can refer to the articles below if you want to learn more about Puppet and Metrics API

Refers to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. Enroll in our courses and refer to the mock test and problems available. Take a look at the interview experiences and interview bundle for placement preparations.

Do upvote our blog to help other ninjas grow. 
Comment here with any questions you may have about the post. I hope this article might help you.

Happy Learning Ninja! 

Live masterclass