Kong/kong-plugin-zipkin

Kong doesn't sends traces to zipkin

ichasco opened this issue · 1 comments

Hi, I can't make work Kong to sends traces to zipkin.

Kong version: 2.0.4
Zipkin version: 2.21

Enabled plugins:

{
  "enabled_plugins": [
    "correlation-id",
    "pre-function",
    "cors",
    "ldap-auth",
    "loggly",
    "hmac-auth",
    "zipkin",
    "request-size-limiting",
    "azure-functions",
    "request-transformer",
    "oauth2",
    "response-transformer",
    "ip-restriction",
    "statsd",
    "jwt",
    "proxy-cache",
    "basic-auth",
    "key-auth",
    "http-log",
    "datadog",
    "tcp-log",
    "rate-limiting",
    "post-function",
    "prometheus",
    "acl",
    "syslog",
    "file-log",
    "acme",
    "udp-log",
    "response-ratelimiting",
    "aws-lambda",
    "session",
    "bot-detection",
    "request-termination"
  ]
}

Configure plugin:

curl --url http://kong:8001/plugins/ -d name=zipkin -d config.http_endpoint=http://zipkin:9411/api/v2/spans
{"created_at":1589105820,"config":{"sample_ratio":0.001,"http_endpoint":"http:\/\/zipkin:9411\/api\/v2\/spans","include_credential":true,"default_service_name":null},"id":"0641365b-4d1f-411c-a0b4-9df6be845a96","service":null,"enabled":true,"protocols":["grpc","grpcs","http","https"],"name":"zipkin","consumer":null,"route":null,"tags":null}

Plugin conf:

{
  "next": null,
  "data": [
    {
      "created_at": 1589105820,
      "config": {
        "sample_ratio": 0.001,
        "http_endpoint": "http://zipkin:9411/api/v2/spans",
        "include_credential": true,
        "default_service_name": null
      },
      "id": "0641365b-4d1f-411c-a0b4-9df6be845a96",
      "service": null,
      "enabled": true,
      "protocols": [
        "grpc",
        "grpcs",
        "http",
        "https"
      ],
      "name": "zipkin",
      "consumer": null,
      "route": null,
      "tags": null
    },

Kong Logs:

2020/05/10 10:17:01 [debug] 23#0: *3917125 [lua] cache.lua:295: invalidate_local(): [DB cache] invalidating (local): 'plugins:zipkin::::'
2020/05/10 10:17:01 [debug] 23#0: *3917125 [lua] events.lua:211: do_event_json(): worker-events: handling event; source=mlcache, event=mlcache:invalidations:kong_core_db_cache, pid=23, data=plugins:zipkin::::
2020/05/10 10:17:01 [debug] 23#0: *3917125 [lua] cache.lua:311: invalidate(): [DB cache] broadcasting (cluster) invalidation for key: 'plugins:zipkin::::'
2020/05/10 10:17:01 [debug] 23#0: *3917125 [lua] events.lua:211: do_event(): worker-events: handling event; source=crud, event=plugins, pid=nil, data=table: 0x7ff200039c18
2020/05/10 10:17:01 [debug] 23#0: *3917125 [lua] handler.lua:254: [events] Plugin updated, invalidating plugins iterator
2020/05/10 10:17:01 [debug] 23#0: *3917125 [lua] cache.lua:295: invalidate_local(): [DB cache] invalidating (local): 'plugins_iterator:version'
2020/05/10 10:17:01 [debug] 23#0: *3917125 [lua] events.lua:211: do_event_json(): worker-events: handling event; source=mlcache, event=mlcache:invalidations:kong_core_db_cache, pid=23, data=plugins_iterator:version
2020/05/10 10:17:01 [debug] 23#0: *3917125 [lua] cache.lua:311: invalidate(): [DB cache] broadcasting (cluster) invalidation for key: 'plugins_iterator:version'
2020/05/10 10:17:01 [debug] 23#0: *3917125 [lua] events.lua:211: do_event(): worker-events: handling event; source=crud, event=plugins:create, pid=nil, data=table: 0x7ff200039c18
192.168.64.6 - - [10/May/2020:10:17:01 +0000] "POST /plugins/ HTTP/1.1" 201 353 "-" "curl/7.67.0"
2020/05/10 10:17:01 [info] 23#0: *3917125 client 192.168.64.6 closed keepalive connection
2020/05/10 10:17:01 [debug] 26#0: *3917134 [lua] events.lua:211: do_event_json(): worker-events: handling event; source=mlcache, event=mlcache:invalidations:kong_core_db_cache, pid=23, data=plugins:zipkin::::
2020/05/10 10:17:01 [debug] 26#0: *3917134 [lua] events.lua:211: do_event_json(): worker-events: handling event; source=mlcache, event=mlcache:invalidations:kong_core_db_cache, pid=23, data=plugins_iterator:version
2020/05/10 10:17:01 [debug] 24#0: *3917138 [lua] events.lua:211: do_event_json(): worker-events: handling event; source=mlcache, event=mlcache:invalidations:kong_core_db_cache, pid=23, data=plugins:zipkin::::
2020/05/10 10:17:01 [debug] 24#0: *3917138 [lua] events.lua:211: do_event_json(): worker-events: handling event; source=mlcache, event=mlcache:invalidations:kong_core_db_cache, pid=23, data=plugins_iterator:version
2020/05/10 10:17:01 [debug] 25#0: *3917146 [lua] events.lua:211: do_event_json(): worker-events: handling event; source=mlcache, event=mlcache:invalidations:kong_core_db_cache, pid=23, data=plugins:zipkin::::
2020/05/10 10:17:01 [debug] 25#0: *3917146 [lua] events.lua:211: do_event_json(): worker-events: handling event; source=mlcache, event=mlcache:invalidations:kong_core_db_cache, pid=23, data=plugins_iterator:version

zipkin configuration:

zipkin:
    image: openzipkin/zipkin
    container_name: zipkin
    environment:
      - STORAGE_TYPE=elasticsearch
      - ES_HOSTS=http://elasticsearch:9200
      - ES_USERNAME=elastic
      - ES_PASSWORD=${ELASTIC_PASSWORD:-elastic}
      - SELF_TRACING_ENABLED=true
      - TZ=${TZ:-Europe/Madrid}
    networks:
      - net
    ports:
      - 9411:9411
    depends_on:
      - elasticsearch

Thanks!

Fixed!

The solution for me was increased the default value: sample ratio to 1