Kong / kong-plugin-zipkin

A Kong plugin for propogating zipkin spans and reporting spans to a zipkin server - this plugin has been moved into https://github.com/Kong/kong, please open issues and PRs in that repo
Apache License 2.0
60 stars 31 forks source link

fix: balancer_latency is nil upon failure #113

Closed greut closed 3 years ago

greut commented 3 years ago

It seems related to the fact that when the load-balancer fails, the latency information is missing.

https://github.com/Kong/kong/issues/6820

[error] 87#0: *5293734 failed to run log_by_lua*:
    /usr/local/share/lua/5.1/kong/plugins/zipkin/handler.lua:332:
    attempt to perform arithmetic on field 'balancer_latency' (a nil value) stack traceback:
    /usr/local/share/lua/5.1/kong/plugins/zipkin/handler.lua:332: in function </usr/local/share/lua/5.1/kong/plugins/zipkin/handler.lua:266>
    /usr/local/share/lua/5.1/kong/init.lua:265: in function 'execute_plugins_iterator'
    /usr/local/share/lua/5.1/kong/init.lua:1286: in function 'log'
    log_by_lua(nginx-kong.conf:102):2: in main chunk while logging request, client: ...
kikito commented 3 years ago

Thank you, this is merged and will be released on the next version of the plugin (Kong/kong#6820 was solved separately)

greut commented 3 years ago

thanks @kikito