Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backport to release/3.3.x] fix(tracing): time precision, sampling rate, span hierarchy (#11484) #11650

Merged
merged 3 commits into from
Sep 27, 2023

Conversation

samugi
Copy link
Member

@samugi samugi commented Sep 25, 2023

backport of:

Checklist

  • The Pull Request has tests
  • A changelog file has been added to CHANGELOG/unreleased/kong or adding skip-changelog label on PR if unnecessary. README.md (Please ping @vm-001 if you need help)
  • (no) There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Full changelog

  • increased precision of the request (kong) span to nanoseconds

Issue reference

KAG-2336
Fix #11294 (secondary issue reported in the comments)

@samugi samugi changed the title [backport to release/3.3.x] fix(tracing): span start/end time precision (#11484) [backport to release/3.3.x] fix(tracing): time precision, sampling rate, span hierarchy (#11484) Sep 25, 2023
samugi and others added 3 commits September 26, 2023 19:04
* fix(tracing): ensure sampling rate applies to whole trace

This commit fixes a bug where the sampling rate was applied to
individual spans, so configuring values of sampling_rate < 1 would
sometimes result in split traces being reported.

The fix ensures that the sampled flag that is calculated by the sampler
for the root span is propagated to all children within the same trace.

* fix(tracing): suggestions + propagation test
* fix an issue where the parent span was set incorrectly when the
  balancer instrumentation was disabled (the parent span was set to
  a temporary balancer span that was never reported)
* fix(tracing): span start/end time precision

Ensure the span lifetime is consistent with the hierarchy
by using the same time source for the root span's end time as the
balancer span.

Before this fix, an approximation (causing a precision error) could
result in the root span to end before its children.

* docs(changelog): add issue

Co-authored-by: Xumin <100666470+StarlightIbuki@users.noreply.github.com>

---------

Co-authored-by: Xumin <100666470+StarlightIbuki@users.noreply.github.com>
@samugi samugi merged commit 1a012f3 into release/3.3.x Sep 27, 2023
23 checks passed
@samugi samugi deleted the backport/11484 branch September 27, 2023 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants