prometheus-json-remote-write-proxy

module
v0.0.0-...-4c8ab7a Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0

README

Prometheus JSON remote write proxy

Background

Prometheus Remote Write API accepts remote-write requests encoded in Protobuf format. Some environments may have troubles encoding Protobuf requests, like IOT devices running micropython code with very little RAM available. It's sometimes just easier to build a JSON payload.

This proxy receives JSON-encoded prompb.RemoteWrite requests on the /write path and forwards them to the configured -remote-write-address address encoded as Protobufs.

Example JSON payload
{
  "timeseries": [
    {
      "labels": [
        {
          "name": "__name__",
          "value": "test_metric1"
        },
        {
          "name": "b",
          "value": "c"
        },
        {
          "name": "baz",
          "value": "qux"
        },
        {
          "name": "d",
          "value": "e"
        },
        {
          "name": "foo",
          "value": "bar"
        }
      ],
      "samples": [
        {
          "timestamp": 42,
          "value": 1
        }
      ],
      "exemplars": [
        {
          "labels": [
            {
              "name": "f",
              "value": "g"
            }
          ],
          "timestamp": 42,
          "value": 1
        }
      ]
    }
  ]
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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