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

feat: server times #532

Merged
merged 1 commit into from
Aug 13, 2024
Merged

feat: server times #532

merged 1 commit into from
Aug 13, 2024

Conversation

fenos
Copy link
Contributor

@fenos fenos commented Aug 13, 2024

What kind of change does this PR introduce?

feature

What is the new behavior?

This PR optionally introduces serverTimes to response logs and/or response header.
We use Otel Spans and convert them into serverTimes.

We can control the threshold where the span will only be included if the duration will be greater to this value.
This is controlled by the TRACING_SERVER_TIME_MIN_DURATION env and is helpful when you just want to log spans above a certain duration.

Additional context

  • Tracing can be controlled with TRACING_ENABLED=true/false env (default off)
  • To Enable ServerTimes header for all request you'll need to set TRACING_RETURN_SERVER_TIMINGS=true (default off)
  • Correctly implemented x-forwarded headers proxy
  • Missing returns

@fenos fenos force-pushed the feature/server-timings branch 2 times, most recently from 1273fea to f9f2d17 Compare August 13, 2024 09:53
@fenos fenos force-pushed the feature/server-timings branch from f9f2d17 to 0287107 Compare August 13, 2024 09:58
@coveralls
Copy link

coveralls commented Aug 13, 2024

Pull Request Test Coverage Report for Build 10367878030

Details

  • 109 of 280 (38.93%) changed or added relevant lines in 17 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.7%) to 78.755%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/http/routes/tus/lifecycle.ts 6 10 60.0%
src/storage/protocols/s3/signature-v4.ts 0 8 0.0%
src/internal/monitoring/otel-processor.ts 39 91 42.86%
src/http/plugins/tracing.ts 32 139 23.02%
Files with Coverage Reduction New Missed Lines %
src/storage/protocols/s3/signature-v4.ts 1 81.37%
Totals Coverage Status
Change from base Build 10330703747: -0.7%
Covered Lines: 13375
Relevant Lines: 16832

💛 - Coveralls

@fenos fenos force-pushed the feature/server-timings branch from 0287107 to 3644e66 Compare August 13, 2024 10:15
@fenos fenos merged commit a298856 into master Aug 13, 2024
1 check passed
@fenos fenos deleted the feature/server-timings branch August 13, 2024 10:29
Copy link

🎉 This PR is included in version 1.10.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants