OpenTelemetry
Non-sampled logs (e.g., access logs) are excellent sources of usage information. Combined with OpenTelemetry open standard for log forwarding, you can easily extract usage information from your logs and forward them to OpenMeter.
The OpenMeter Collector is powered by Redpanda Connect.
Prerequisites
You will need an OpenTelemetry-compatible log-forwarding solution. The easiest way to get started is to use the OpenTelemetry Collector.
Configuration
First, create a new YAML file for the collector configuration. You will have to
use the otel_log
Redpanda Connect input:
This is a custom input plugin that is not part of the official Redpanda Connect distribution. You can find the source code of the plugin here.
Next, you need to configure the mapping from your log schema to CloudEvents using bloblang:
this.record.attributes
contains the log attributes extracted by the
otel_log
input plugin.
Finally, you need to configure the OpenMeter output:
Read more about configuring Redpanda Connect in the OpenMeter Collector guide.
Check out a fully working example here.
Installation
Check out the OpenMeter Collector guide for installation instructions.