All Projects → crate → cratedb-prometheus-adapter

crate / cratedb-prometheus-adapter

Licence: Apache-2.0 license
CrateDB Prometheus Adapter

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to cratedb-prometheus-adapter

modbus exporter
Exporter which retrieves stats from a modbus system and exports them via HTTP for Prometheus consumption.
Stars: ✭ 16 (-69.81%)
Mutual labels:  prometheus-exporter
crate-admin
An admin user interface for CrateDB.
Stars: ✭ 25 (-52.83%)
Mutual labels:  cratedb
radosgw usage exporter
Prometheus exporter for scraping Ceph RADOSGW usage data.
Stars: ✭ 34 (-35.85%)
Mutual labels:  prometheus-exporter
opentracing-metrics-tracer
Exports cross-process metrics via OpenTracing to Prometheus.
Stars: ✭ 13 (-75.47%)
Mutual labels:  prometheus-exporter
tado-exporter
A Prometheus exporter for tado smart heating solution
Stars: ✭ 32 (-39.62%)
Mutual labels:  prometheus-exporter
jmx exporter-cloudera-hadoop
Prometheus jmx_exporter configurations for Cloudera Hadoop
Stars: ✭ 33 (-37.74%)
Mutual labels:  prometheus-exporter
pgbouncer exporter
Prometheus exporter for Pgbouncer metrics.
Stars: ✭ 19 (-64.15%)
Mutual labels:  prometheus-exporter
ansible-prometheus
Ansible role for the management of Prometheus software and Prometheus exporters
Stars: ✭ 63 (+18.87%)
Mutual labels:  prometheus-exporter
pagerduty-exporter
Prometheus exporter for PagerDuty informations
Stars: ✭ 38 (-28.3%)
Mutual labels:  prometheus-exporter
pika exporter
Prometheus expoter for Qihoo360/Pika metrics. Suppots Pika 2.x, 3.x
Stars: ✭ 39 (-26.42%)
Mutual labels:  prometheus-exporter
temp-probe-exporter
Export Prometheus data from 1-Wire temperature sensors, using an Arduino or Linux system
Stars: ✭ 17 (-67.92%)
Mutual labels:  prometheus-exporter
falco-exporter
Prometheus Metrics Exporter for Falco output events
Stars: ✭ 84 (+58.49%)
Mutual labels:  prometheus-exporter
mq-java-exporter
Exporter for IBM MQ metrics https://prometheus.io/
Stars: ✭ 19 (-64.15%)
Mutual labels:  prometheus-exporter
azure-metrics-exporter
Azure Monitor metrics exporter for Prometheus with dimension support, template engine and ServiceDiscovery
Stars: ✭ 54 (+1.89%)
Mutual labels:  prometheus-exporter
node exporter
Exporter for machine metrics
Stars: ✭ 7,897 (+14800%)
Mutual labels:  prometheus-exporter
kafka-consumer-lag-monitoring
Client tool that exports the consumer lag of Kafka consumer groups to Prometheus or your terminal
Stars: ✭ 45 (-15.09%)
Mutual labels:  prometheus-exporter
prometheus-async
Async helpers for prometheus_client.
Stars: ✭ 136 (+156.6%)
Mutual labels:  prometheus-exporter
version exporter
Monitor the versions of the things you run and care about
Stars: ✭ 16 (-69.81%)
Mutual labels:  prometheus-exporter
dex
Prometheus Docker EXporter
Stars: ✭ 19 (-64.15%)
Mutual labels:  prometheus-exporter
gethexporter
Monitor your Geth Ethereum Server with Prometheus and Grafana
Stars: ✭ 103 (+94.34%)
Mutual labels:  prometheus-exporter

CrateDB Prometheus Adapter

Version CI status License: Apache 2.0

This is an adapter that accepts Prometheus remote read/write requests, and sends them to CrateDB. This allows using CrateDB as long term storage for Prometheus.

Along the lines, the program also exports metrics about itself, using the cratedb_prometheus_adapter_ prefix.

Setup

The CrateDB Prometheus Adapter is offered in two different distribution variants. You can choose freely which fits your needs best.

Usage

Create the following table in your CrateDB database:

CREATE TABLE "metrics" (
    "timestamp" TIMESTAMP,
    "labels_hash" STRING,
    "labels" OBJECT(DYNAMIC),
    "value" DOUBLE,
    "valueRaw" LONG,
    "day__generated" TIMESTAMP GENERATED ALWAYS AS date_trunc('day', "timestamp"),
    PRIMARY KEY ("timestamp", "labels_hash", "day__generated")
  ) PARTITIONED BY ("day__generated");

Depending on data volume and retention you might want to optimize your partitioning scheme and create hourly, weekly, ... partitions.

Then run the adapter:

# When using the single binary
./cratedb-prometheus-adapter

# When using Docker
docker run -it --rm --publish=9268:9268 ghcr.io/crate/cratedb-prometheus-adapter

By default the adapter will listen on port 9268 and will use a built-in configuration as outlined in the next section. This and more is configurable via command line flags, which you can see by passing the -h flag.

The CrateDB endpoints are provided in a configuration file, which defaults to config.yml (-config.file flag). The included example configuration file forwards samples to a CrateDB running on localhost on port 5432.

CrateDB Adapter Endpoint Configuration

The path to the YAML-based configuration file can be provided by using the -config.file command line option. The settings describe the CrateDB endpoints the adapter will write to.

If multiple endpoints are listed, the adapter will load-balance between them. The options (with one example endpoint) are as below:

cratedb_endpoints:
- host: "localhost"         # Host to connect to (default: "localhost").
  port: 5432                # Port to connect to (default: 5432).
  user: "crate"             # Username to use (default: "crate")
  password: ""              # Password to use (default: "").
  schema: ""                # Schema to use (default: "").
  connect_timeout: 10       # TCP connect timeout (seconds) (default: 10).
  max_connections: 5        # The maximum number of concurrent connections (default: 5).
  enable_tls: false         # Whether to connect using TLS (default: false).
  allow_insecure_tls: false # Whether to allow insecure / invalid TLS certificates (default: false).

Prometheus Configuration

In order to forward write and read requests to the CrateDB adapter, adjust your prometheus.yml like:

remote_write:
   - url: http://localhost:9268/write
remote_read:
   - url: http://localhost:9268/read

The adapter also exposes Prometheus metrics on /metrics, which can be scraped in the usual way.

Running as service

In order to run cratedb-prometheus-adapter as a system service on Linux, the repository provides configuration files to configure the program as a systemd service unit. This section outlines how to apply that configuration.

Copy config.yml to /etc/cratedb-prometheus-adapter/config.yml and adjust as needed.

Copy systemd/cratedb-prometheus-adapter.service to /etc/systemd/system/cratedb-prometheus-adapter.service or just link the service file by running: sudo systemctl link $(pwd)/cratedb-prometheus-adapter.service and run:

systemctl daemon-reload

Change flag-based configuration by changing the settings in /etc/default/cratedb-prometheus-adapter based on the systemd/cratedb-prometheus-adapter.default template. After that you can:

systemctl start cratedb-prometheus-adapter
systemctl enable cratedb-prometheus-adapter
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].