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

Metrics and Logging name changes #541

Merged
merged 6 commits into from
Sep 9, 2024
Merged

Metrics and Logging name changes #541

merged 6 commits into from
Sep 9, 2024

Conversation

adam-fowler
Copy link
Member

These are some metrics and logging name changes based off discussions in #539
These are not set in stone, but I thought implementing the changes would trigger final decisions

@@ -102,7 +102,7 @@ extension ApplicationProtocol {
eventLoopGroup: self.eventLoopGroup,
logger: self.logger
) { (request, responseWriter: consuming ResponseWriter, channel) in
let logger = self.logger.with(metadataKey: "hb_id", value: .stringConvertible(RequestID()))
let logger = self.logger.with(metadataKey: "hb.id", value: .stringConvertible(RequestID()))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let logger = self.logger.with(metadataKey: "hb.id", value: .stringConvertible(RequestID()))
let logger = self.logger.with(metadataKey: "http.request.id", value: .stringConvertible(RequestID()))

Copy link
Member Author

Choose a reason for hiding this comment

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

Non standard and we don't own http namespace. Using hb.request.id

Sources/Hummingbird/Application.swift Outdated Show resolved Hide resolved
Sources/Hummingbird/Files/FileIO.swift Outdated Show resolved Hide resolved
Sources/Hummingbird/Files/FileIO.swift Outdated Show resolved Hide resolved
Sources/Hummingbird/Middleware/LogRequestMiddleware.swift Outdated Show resolved Hide resolved
Sources/Hummingbird/Middleware/MetricsMiddleware.swift Outdated Show resolved Hide resolved
Sources/Hummingbird/Middleware/MetricsMiddleware.swift Outdated Show resolved Hide resolved
Sources/Hummingbird/Server/RequestContext.swift Outdated Show resolved Hide resolved
Sources/HummingbirdTesting/RouterTestFramework.swift Outdated Show resolved Hide resolved
Tests/HummingbirdTests/MetricsTests.swift Show resolved Hide resolved
@Joannis
Copy link
Member

Joannis commented Sep 8, 2024

@adam-fowler
Copy link
Member Author

adam-fowler commented Sep 8, 2024

So I've followed the conventions for HTTP metrics
There is very little detail when it comes to log attributes. I've used an hb prefix everywhere to ensure we aren't adding to namespaces we don't own.
I also added the new metric http.server.active_requests

Copy link

@thoven87 thoven87 left a comment

Choose a reason for hiding this comment

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

lgtm

@adam-fowler adam-fowler merged commit b286e64 into main Sep 9, 2024
5 checks passed
@adam-fowler adam-fowler deleted the metrics-logging-tags branch September 9, 2024 07:13
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.

3 participants