Skip to content

Prometheus Write Input

Lorenzo Mangani edited this page Mar 10, 2023 · 13 revisions

Prometheus Remote Write

qryn implements experimental support for the Prometheus Remote Write API (Protobuf WriteRequest format)

API Endpoints

  • api/v1/prom/remote/write
  • api/prom/remote/write (alias)

Testing

Use the promremote client to test the input.

promremote -t=__name__:foo_bar -t=biz:baz -d=now,1415.92

Usage

Write

Store data from Prometheus instances using the remote_write API

# Remote write configuration
remote_write:
  - url: "http://qryn:3100/api/v1/write"

Read

Stored Metrics can be accessed using the qryn (unwrap_value) function. (PromQL support is in our roadmap)

Unwrap Expressions
rate({label1="val1"}| unwrap int_valued_label [1s]) by (another_label)
  1. {label1="val1"} Fetch all log lines matching label filters.
  2. <expr> | unwrap int_valued_label Use the extracted label int_valued_label as sample values instead of log lines for the subsequent range aggregation.
  3. rate(<expr> [1s]) Calculates the number of entries per second.
  4. by (another_label) Groups the resulting series by the selected label(s).
Supported Unwrap functions
  • rate(unwrapped-range): calculates per second rate of all values in the specified interval.
  • sum_over_time(unwrapped-range): the sum of all values in the specified interval.
  • avg_over_time(unwrapped-range): the average value of all points in the specified interval.
  • max_over_time(unwrapped-range): the maximum value of all points in the specified interval.
  • min_over_time(unwrapped-range): the minimum value of all points in the specified interval
  • first_over_time(unwrapped-range): the first value of all points in the specified interval
  • last_over_time(unwrapped-range): the last value of all points in the specified interval
  • Aggregation operators over unwrapped expressions are supported.
NOTES:

In Grafana queries, use $__interval for unwrap, ie: unwrap data [$__interval]

image

Examples: LogQL Range Aggregations