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

chore(tracing): log instead of throwing error #14294

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

samugi
Copy link
Member

@samugi samugi commented Feb 19, 2025

Summary

This module could throw errors if certain validations fail. While this is useful for type validation, it can be risky when the error logic depends on more complex conditions.

This commit removes the error thrown when a span's end time is earlier than its start time. Although this shouldn't happen under normal circumstances, the end time calculation depends on multiple factors, including values from Nginx, making it not trivial to ensure it is always valid. In such cases, logging an error is more appropriate than failing the request.

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • (no) There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

KAG-6424

This module could throw errors if certain validations fail.
While this is useful for type validation, it can be risky when the error logic
depends on more complex conditions.

This commit removes the error thrown when a span's end time is earlier than its
start time. Although this shouldn't happen under normal circumstances, the end
time calculation depends on multiple factors, including values from Nginx,
making it not trivial to ensure it is always valid.
In such cases, logging an error is more appropriate than failing the request.
@github-actions github-actions bot added core/pdk core/tracing cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels Feb 19, 2025
@samugi samugi requested review from brentos and gruceo February 19, 2025 09:28
@samugi samugi merged commit 7fcde18 into master Feb 20, 2025
34 of 36 checks passed
@samugi samugi deleted the chore/tracing-dont-throw-errors branch February 20, 2025 07:19
@samugi samugi added cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee and removed cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee core/pdk core/tracing size/S skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants