opensearch-project / data-prepper

Data Prepper is a component of the OpenSearch project that accepts, filters, transforms, enriches, and routes data at scale.
https://opensearch.org/docs/latest/clients/data-prepper/index/
Apache License 2.0
262 stars 195 forks source link

Support Prometheus as a Sink (pull/scrape model) #1744

Open dlvenable opened 2 years ago

dlvenable commented 2 years ago

Create a Sink which provides metrics to Prometheus as an API so that Prometheus can scrape Data Prepper to get metrics.

ashoktelukuntla commented 1 year ago

Is your feature request related to a problem? Please describe.

Data Prepper can output to OpenSearch, but cannot output to arbitrary Prometheus as a Sink in OTEL format

Describe the solution you'd like

Create a new sink in Data Prepper which outputs JSON to an arbitrary Prometheus endpoint.

It can output events to an Prometheus endpoint as a JSON array of events.

Example:

[{"key1": "value1", "key2": "value2"}, {"key1": "value3", "key2": "value4"}]

It could also be configured to write each new event as a JSON string on its own line. This is similar to the OpenSearch bulk API.

Example:

{"key1": "value1", "key2": "value2"}
{"key1": "value3", "key2": "value4"}

Additional Context:

Possible user configurations:

endpoint (no default): The remote write URL to send remote write samples insecure (default = false) cert_file (no default): path to the TLS cert key_file (no default): path to the TLS key to use

The following settings can be optionally configured:

external_labels: map of labels names and values to be attached to each metric data point headers:. additional headers attached to each HTTP request.

dlvenable commented 10 months ago

There is some initial work for this in the prometheus-sink project. But, we would need somebody to pick this up to make progress on this code to make this a usable feature.