Giter VIP home page Giter VIP logo

kong-plugin-zipkin's Introduction

Build Status

Getting Started

Get a running Zipkin instance

e.g. using docker:

sudo docker run -d -p 9411:9411 openzipkin/zipkin

Enable the Plugin

curl --url http://localhost:8001/plugins/ -d name=zipkin -d config.http_endpoint=http://127.0.0.1:9411/api/v2/spans

See many more details of using this plugin at https://docs.konghq.com/plugins/zipkin/

Implementation

The Zipkin plugin is derived from an OpenTracing base.

A tracer is created with the "http_headers" formatter set to use the headers described in b3-propagation

Spans

  • Request span: 1 per request. Encompasses the whole request in kong (kind: SERVER). The proxy span and balancer spans are children of this span. Contains logs/annotations for the kong.rewrite phase start and end
  • Proxy span: 1 per request. Encompassing most of Kong's internal processing of a request (kind: CLIENT) Contains logs/annotations for the rest start/finish of the of the Kong plugin phases:
    • krs - kong.rewrite.start
    • krf - kong.rewrite.finish
    • kas - kong.access.start
    • kaf - kong.access.finish
    • kbs - kong.body_filter.start
    • kbf - kong.body_filter.finish
    • khs - kong.header_filter.start
    • khf - kong.header_filter.finish
    • kps - kong.preread.start
    • kpf - kong.preread.finish This kind of information is useful for finding performance problems in plugins.
  • Balancer span(s): 0 or more per request, each encompassing one balancer attempt (kind: CLIENT) Contains tags specific to the load balancing:
    • kong.balancer.try: a number indicating the attempt order
    • peer.ipv4/peer.ipv6 + peer.port for the balanced port
    • error: true/false depending on whether the balancing could be done or not
    • http.status_code: the http status code received, in case of error
    • kong.balancer.state: an nginx-specific description of the error: next/failed for HTTP failures, 0 for stream failures. Equivalent to state_name in OpenResty's Balancer's get_last_failure function.

Tags

Standard tags

"Standard" tags are documented here Of those, this plugin currently uses:

  • span.kind (sent to Zipkin as "kind")
  • http.method
  • http.status_code
  • http.path
  • error
  • peer.ipv4
  • peer.ipv6
  • peer.port
  • peer.hostname
  • peer.service

Non-Standard tags

In addition to the above standardised tags, this plugin also adds:

  • component (sent to Zipkin as "lc", for "local component")
  • kong.api (deprecated)
  • kong.consumer
  • kong.credential
  • kong.node.id
  • kong.route
  • kong.service
  • kong.balancer.try
  • kong.balancer.state

Logs / Annotations

Logs (annotations in Zipkin) are used to encode the begin and end of every kong phase.

  • kong.rewrite, start / finish, <timestamp>
  • kong.access, start / finish, <timestamp>
  • kong.preread, start / finish, <timestamp>
  • kong.header_filter, start / finish, <timestamp>
  • kong.body_filter, start / finish, <timestamp>

They are transmitted to Zipkin as annotations where the value is the concatenation of the log name and the value.

For example, the kong.rewrite, start log would be transmitted as:

  • { "value" = "kong.rewrite.start", timestamp = <timestamp> }

kong-plugin-zipkin's People

Contributors

bnlong-fossil avatar bungle avatar coopr avatar dndx avatar fangchd avatar gszr avatar james-callahan avatar jcchavezs avatar jeremyjpj0916 avatar kikito avatar locao avatar thibaultcha avatar tieske avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.