How to Use PromQueen: Backfilling Prometheus Metrics Offline

Apr 23, 2022 | Programming

PromQueen is a powerful tool designed to help you record Prometheus metrics offline and backfill them into your Prometheus database. This guide will walk you through the installation and usage of PromQueen, making it seamless for you to start using this innovative solution.

What is PromQueen?

PromQueen consists of two main components:

  • promrec: This tool is responsible for capturing Prometheus metrics and saving them to a specified output file.
  • promplay: This tool backfills the metrics into the Prometheus database from scratch.

Installation Instructions

To get started with PromQueen, follow these detailed steps to install it on your Linux or OSX system:

  1. Clone the PromQueen repository:
    $ mkdir -p $GOPATH/src/github.com/Cleafy
    $ cd $GOPATH/src/github.com/Cleafy
    $ git clone https://github.com/Cleafy/promqueen.git
  2. Navigate to the PromQueen directory and install the required dependencies using the Go package manager:
    $ cd $GOPATH/src/github.com/Cleafy/promqueen
    $ dep ensure
  3. Build the appropriate binaries for promrec and promplay:
    $ cd $GOPATH/src/github.com/Cleafy/promqueen/bin/promrec
    $ go build
    $ cd $GOPATH/src/github.com/Cleafy/promqueen/bin/promplay
    $ go build

Usage Instructions

With PromQueen installed, you can now start using it to record and backfill data.

Using PromREC

To use promrec, run the following command structure:

promrec [flags]

You can utilize various flags, such as:

  • –help: Show context-sensitive help
  • –debug: Enable debug mode
  • –gzip: Enable gzip mode
  • -i, –interval=60s: Set the timeout for waiting for ping
  • -u, –umap=UMAP: Specify the service mapping
  • -o, –output=metrics: Define the output file
  • –version: Show the application version

Using PromPLAY

To backfill data with promplay, use the following command:

promplay [flags]

Available flags include:

  • –help: Show context-sensitive help
  • –debug: Enable very verbose debug mode
  • –verbose (-v): Enable info-level messages
  • –nopromcfg: Disable generation of the prometheus configuration file
  • -d, –dir=tmp: Define the input directory
  • –version: Show the application version
  • –storage.path=data: Set directory path for data store
  • –storage.retention-period=360h: Define storage period
  • –storage.checkpoint-interval=30m: Define checkpoint interval
  • –storage.checkpoint-dirty-series-limit=10000: Limit dirty series at checkpoint

Environment Variables

PromQueen also supports several environment variables for configuration:

  • PROM_ARGS: Arguments for the PromQueen service, which must include output, interval, and at least one service.
  • ROTATION_FILE_LOG: Set where the log rotation occurs, matching the output parameter.
  • ROTATION_PERIOD: Frequency of rotation (default: daily).
  • ROTATION_COUNT: Number of rotations to be retained (default: 10).
  • ROTATION_SIZE: Size of each rotation file in bytes (default: -1 for no limit).
  • Example command:
    docker run -d --network=host --name promqueen -e ROTATION_FILE_LOG=varlogpromqueenmetricsmetrics.prom -e PROM_ARGS=--output=varlogpromqueenmetricsmetrics.prom --interval=30s -u service1=URL1 -u service2=URL2 promqueen_image

Troubleshooting

If you encounter issues while using PromQueen, here are some common troubleshooting tips:

  • Ensure that all dependencies are properly installed.
  • Double-check your environment variable settings for accuracy.
  • Check the output logs for any error messages that could provide additional insights.
  • If you’re still stuck, consider reaching out for help or reviewing the documentation for additional guidance.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Final Thoughts

PromQueen is a reliable solution for managing Prometheus metrics offline. By following the installation and usage instructions, you will be able to effectively capture and backfill your metrics effortlessly!

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox