Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

fix(*) timestamps and annotations #60

Merged
merged 4 commits into from
Dec 20, 2019
Merged

Conversation

kikito
Copy link
Member

@kikito kikito commented Dec 19, 2019

This PR includes several changes:

  • It makes the timestamps integers instead of floats, in order to satisfy Zipkin's requirements on timestamps.
  • It changes the annotations format (event key was renamed to value)
  • The annotation values were shortened (we use kas instead of kong.access.start, for example).

This PR also includes changes in the test suite which run a proper Zipkin server instead of a mocked one.

Zipkin expects timestamps to be integers. We were sending floats instead. This commit changes them to integers using math.floor.
Zipkin expects the `value` field of an annotation to be mandatory. We
were using `event` instead. This changes `event` to `value`.
According to https://zipkin.io/zipkin-api:

> Usually a short tag indicating an event, like “error”
>
> While possible to add larger data, such as garbage collection details, low cardinality event names both keep the size of spans down and also are easy to search against.

Given that the previous versions of annotations didn't work with zipkin anyway (because they had no value field) these new anotations will also follow this directive.

Instead of "kong.access.start" the annotation value will be "kas". "kong.header_filter.finish" becomes "khf". And so on.
@gszr gszr marked this pull request as ready for review December 19, 2019 22:32
@gszr gszr changed the title Fix/timestamps and annotations fix(*) timestamps and annotations Dec 19, 2019
- Use an actual Zipkin server in tests
- Remove dependency on lua-http and cqueues, by using Kong's existing
helper HTTP client and Zipkin server
@gszr gszr force-pushed the fix/timestamps-and-annotations branch 3 times, most recently from e0c7108 to b0442c2 Compare December 19, 2019 22:46
end)

it("propagates b3 headers on routed request", function()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case was removed as the tests now leverage the b3 headers by default.

@kikito kikito merged commit 4787024 into master Dec 20, 2019
@kikito kikito deleted the fix/timestamps-and-annotations branch December 20, 2019 15:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants