Repository navigation
QuestionHello, I'm trying to use kafka as a transport for metrics. Schema is as follows: But I'm getting Configuration error for last element in chain, where vector is consumer for kafka and should push metrics via Prometheus Remote Write. Is it even possible to achieve? Thank you in advance. Vector Configsources:
kafka:
type: "kafka"
bootstrap_servers: "kafka:9092"
group_id: "vector-aggregator-group"
topics: ["vector-metrics"]
sinks:
prw:
type: prometheus_remote_write
inputs: ["kafka"]
endpoint: http://vm:8428/api/v1/writeVector Logs |
Replies: 1 comment
|
Yes. The Kafka source defaults to decoding records as logs, which causes that type mismatch. Use matching Producer Vector: sources:
prw:
type: prometheus_remote_write
address: 0.0.0.0:9090
path: /api/v1/write
sinks:
kafka:
type: kafka
inputs: [prw]
bootstrap_servers: kafka:9092
topic: vector-metrics
encoding:
codec: native_jsonConsumer Vector: sources:
kafka:
type: kafka
bootstrap_servers: kafka:9092
group_id: vector-aggregator-group
topics: [vector-metrics]
auto_offset_reset: earliest
decoding:
codec: native_json
sinks:
prw:
type: prometheus_remote_write
inputs: [kafka]
endpoint: http://vm:8428/api/v1/writeBoth sides must use Validated on Vector 0.60.0 through Remote Write → Vector → a librdkafka mock broker → Vector → a Vector Remote Write receiver. Two gauge samples retained their names, labels, timestamps, and values. This did not use a production Kafka cluster or VictoriaMetrics. Please don't hesitate to followup in this thread if you have further questions. |
Yes. The Kafka source defaults to decoding records as logs, which causes that type mismatch. Use matching
native_jsonencoding and decoding to preserve Vector's metric event type.Producer Vector:
Consumer Vector: