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

Remove Application Context #308

Merged
merged 3 commits into from
Dec 16, 2023
Merged

Remove Application Context #308

merged 3 commits into from
Dec 16, 2023

Conversation

adam-fowler
Copy link
Member

@adam-fowler adam-fowler commented Dec 13, 2023

Remove application context from request context

  • maxUploadSize is now a requirement for the HBBaseRequestContext with a default of 2MB. If someone want to override this value they have to provide their own context type
  • Added a method for adding static span attributes to tracing middleware so users can add the missing host name and port if they require

Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0e4fe0c) 84.78% compared to head (2d9f89a) 84.55%.

Additional details and impacted files
@@            Coverage Diff             @@
##            2.x.x     #308      +/-   ##
==========================================
- Coverage   84.78%   84.55%   -0.24%     
==========================================
  Files          79       79              
  Lines        4543     4525      -18     
==========================================
- Hits         3852     3826      -26     
- Misses        691      699       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adam-fowler adam-fowler requested a review from Joannis December 13, 2023 09:33
/// are being recorded.
public init(recordingHeaders headerNamesToRecord: some Collection<HTTPField.Name>) {
public init(recordingHeaders headerNamesToRecord: some Collection<HTTPField.Name> = [], attributes: SpanAttributes? = nil) {
Copy link
Member

Choose a reason for hiding this comment

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

I assume this is not related to the application context change

Copy link
Member Author

Choose a reason for hiding this comment

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

This is related, in that when we remove the application context we don't have access to some of the application configuration, so cannot update some attributes eg "net.host.name" and "net.host.port". My solution was to allow the user to add some static attributes to the middleware itself.

Sources/Hummingbird/Middleware/TracingMiddleware.swift Outdated Show resolved Hide resolved
@adam-fowler adam-fowler force-pushed the remove-application-context branch from 6968f7e to 2d9f89a Compare December 15, 2023 08:47
Copy link

@adam-fowler adam-fowler merged commit 949b84c into 2.x.x Dec 16, 2023
3 of 5 checks passed
@adam-fowler adam-fowler deleted the remove-application-context branch December 16, 2023 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants