Skip to content
Discussion options

You must be logged in to vote

Yes. The Kafka source defaults to decoding records as logs, which causes that type mismatch. Use matching native_json encoding and decoding to preserve Vector's metric event type.

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_json

Consumer 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: pr…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pront
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
sink:kafka Anything `kafka` sink related source:kafka Anything `kafka` source related domain:codecs Anything related to Vector's codecs (encoding/decoding) domain:metrics Anything related to Vector's metrics events sink:prometheus_remote_write Anything `prometheus_remote_write` sink related
2 participants