prometheus

command module
v0.0.0-...-e0aed73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 22 Imported by: 0

README

Prometheus remote storage adapter for Alluvio Aternity APM

With this remote storage adapter, the prometheus metrics can be collected in Alluvio Aternity APM and visualized in the dashboards. For example, in this Custom Dashboard made for Kubernetes clusters:

Custom Dashboard kubernetes metrics

Notes This remote storage adapter for Alluvio Aternity APM is an experimental write adapter that receives metrics via Prometheus's remote write protocol and stores them in Alluvio Aternity APM. The code is based on Prometheus remote_storage_adapter example. remote_storage_adapter is meant as a replacement for the built-in specific remote storage implementations that have been removed from Prometheus.

Prerequisite

  1. Docker host or Kubernetes cluster with a container image repository
  2. a running Prometheus instance
  3. an Aternity APM account (SaaS), check the website for trials
  4. a running Aternity APM Agent exposing CMX (default is port 7074)

Build

for plain binary

go build -o remote-storage-adapter main.go

for docker image

docker build . -t YOUR_IMAGE_REPO/atny-remote-storage-adapter:0.1.0

Running

Configure the arguments and set the variables, replacing the following token:

  • YOUR_ATERNITY_AGENT_HOST is an ip/DNS record to your Aternity APM agent exposing CMX
  • YOUR_CMX_PORT is the CMX port, usually 7074
  • YOUR_ENV_NAME and YOUR_REGION for tagging metrics with ENV and REGION
Running the binary on a host
[REGION=YOUR_REGION] [ENV=YOUR_ENV_NAME] ./remote_storage_adapter --atny-url=https://YOUR_ATERNITY_AGENT_HOST:YOUR_CMX_PORT/ [--atny-cmx-dimensions="yourextraDim0,Dim0Val,yourextraDim1,Dim1Val"]

Note [...] parts are optional

For example

REGION=francecentral ENV=prod ./remote_storage_adapter --atny-url=https://aternity_agent_cmx:7074/
Running as docker container
docker run [-e REGION=YOUR_REGION] [-e ENV=YOUR_ENV_NAME] YOUR_IMAGE_REPO/atny-remote-storage-adapter:0.1.0 --atny-url=https://YOUR_ATERNITY_AGENT_HOST:YOUR_CMX_PORT/ [--atny-cmx-dimensions="yourextraDim0,Dim0Val,yourextraDim1,Dim1Val"]

Note [...] parts are optional

Running in Kubernetes

Configure the yaml template

kubectl apply -f ./remote_storage_adapter.yaml

Configuring Prometheus

To configure Prometheus to send samples to this binary, add the following to your prometheus.yml:

remote_write:
    # if you run remote storage adapter on an arbitrary host outside your k8s, make sure your prometheus server is able to reach it
    - url: http://HOSTNAME:9201/write

    # if you run remote storage adapter on k8s cluster:
    # SERVICE_NAME is the name of the remote storage adapter service
    # NAMESPACE is the name of the NAMESPACE where you run this remote storage adapter
    - url: http://SERVICE_NAME.NAMESPACE/write

    # if you deploy using the remote-storage-adapter.yaml we provide and didn't change the K8s Service manifest, you can use:
    - url: http://prometheus-remote-storage-adapter.monitoring/write

Warning Make sure you only use one url

Viewing in Aternity APM WebUI in a custom dashboard

We have a starting custom dashboard, "K8s dashboard", for you to play around with.

  1. Make sure you are have permission to modify Custom Dashboards

  2. Click "Create New Dashboard"

  3. In the new CMX dashboard, click the gear button and "Edit JSON"

  4. Copy and paste the content of dashboard.json to the dialog.

  5. Save the dashboard

License

Copyright (c) 2022 Riverbed Technology, Inc.

The contents provided here are licensed under the terms and conditions of the MIT License accompanying the software ("License"). The scripts are distributed "AS IS" as set forth in the License. The script also include certain third party code. All such third party code is also distributed "AS IS" and is licensed by the respective copyright holders under the applicable terms and conditions (including, without limitation, warranty and liability disclaimers) identified in the license notices accompanying the software.

Documentation

Overview

The main package for the Prometheus server executable.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL