0

I'm new to Clickhouse. I'm trying to read Jaeger logs from Kafka into Clickhouse db. I have following Kafka messages format:

{
  "traceId": "omFv9AGFHOAfWQ+tJcxDZQ==",
  "spanId": "Lai3jc8v6Pg=",
  "operationName": "GET",
  "startTime": "2021-02-24T09:26:12.771Z",
  "duration": "0.006s",
  "tags": [
    {
      "key": "component",
      "vStr": "kong"
    },
    {
      "key": "http.method",
      "vStr": "GET"
    },
    {
      "key": "http.path",
      "vStr": "/static/bootstrap/js/bootstrap.min.js"
    },
    {
      "key": "http.status_code",
      "vStr": "304"
    },
    {
      "key": "kong.node.id",
      "vStr": "0b2d3a89-67c8-43b2-a56f-450c45689b7d"
    },
    {
      "key": "peer.service"
    },
    {
      "key": "peer.ipv4",
      "vType": "INT64",
      "vInt64": "2130706433"
    },
    {
      "key": "peer.port",
      "vType": "INT64",
      "vInt64": "44076"
    },
    {
      "key": "span.kind",
      "vStr": "server"
    },
    {
      "key": "internal.span.format",
      "vStr": "zipkin"
    }
  ],
  "logs": [
    {
      "timestamp": "2021-02-24T09:26:12.771Z",
      "fields": [
        {
          "key": "event",
          "vStr": "krf"
        }
      ]
    }
  ],
  "process": {
    "serviceName": "kong"
  }
}

I was able to input traceID, spanID and Operation into Clickhouse using the following table:

CREATE TABLE IF NOT EXISTS db1.jaeger
(
  traceId String,
  spanId  String,
  operationName String
) ENGINE = Kafka()
SETTINGS
    kafka_broker_list = 'broker.net:9092',
    kafka_topic_list = 'jaeger',
    kafka_group_name = 'sample_group',
    kafka_format = 'JSONEachRow';

But I failed to input tags. Any idea which Clickhouse data type I should use for it?

vladimir
  • 13,428
  • 2
  • 44
  • 70
Timur
  • 31
  • 1
  • 6

0 Answers0