hummingbird-project / hummingbird

Lightweight, flexible HTTP server framework written in Swift
https://hummingbird.codes/
Apache License 2.0
1.2k stars 53 forks source link

Review of all the metrics names and logger metadata names #539

Closed adam-fowler closed 2 months ago

adam-fowler commented 2 months ago

Below is a list of logger metadata names, plus associated log output and where the call is made Logger metadata:

Metrics names:

adam-fowler commented 2 months ago

Initial thoughts: logger metadata: should we prefix all the HB metadata with hb_ and change the jobs metadata back to snake case. metrics: do we need the swift_ prefix? I'm not sure if dimensions need a prefix at all

thoven87 commented 2 months ago

Since we're trying to future proof the metric tags and so forth. Should we convert to the Open Telemetry convention?

In Open Telemetry, the dot notion is used instead of the underscore. Both Prometheus and Loki will have both options available.

adam-fowler commented 2 months ago

I'm happy to go with dot notation hb.uri, job.name.

thoven87 commented 2 months ago

I'm happy to go with dot notation hb.uri, job.name.

Probably not job.name I think this one would conflict with OpenTelemetry collectors. @Joannis Do you have any preferences?

adam-fowler commented 2 months ago

Probably not job.name I think this one would conflict with OpenTelemetry collectors.

I don't see anything in the OTel spec which uses job but we could use jobs or hb.job instead I guess.

thoven87 commented 2 months ago

The OpenTelemetry semantic conventions for HTTP metrics can found here

Plus more

HTTP spans

Exceptions for Logs

Exception for spans

Prometheus Compatibility

It looks like UTF-8 support for label and metric names in Prometheus will not land 'till version 3.0.