Closed adam-fowler closed 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
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.
I'm happy to go with dot notation hb.uri
, job.name
.
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?
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.
The OpenTelemetry semantic conventions for HTTP metrics can found here
Plus more
It looks like UTF-8 support for label and metric names in Prometheus will not land 'till version 3.0.
Below is a list of logger metadata names, plus associated log output and where the call is made Logger metadata:
error
: "Unrecognised error" Application.swift.file
: "PUT" FileIO.swifthb_uri
,hb_method
,hb_headers
: "Request" LogRequestMiddleware.swifterror
: "Failed to get job from queue" PostgresJobsQueue.swifterror
: "WebSocket handler error" WebSocketChannel.swift/WebSocketRouter.swifthb_extensions
: "Extensions required" WebSocketChannel.swiftopcode
: "Received reserved opcode" WebSocketInboundStream.swiftJobID
,JobName
,JobTime
: JobQueue.swiftMetrics names:
hb_requests
: dimensions:hb_uri
,hb_method
hb_errors
: dimensions:hb_uri
,hb_method
hb_request_duration
: dimensions:hb_uri
,hb_method
swift_jobs
: dimensions:name
,status
swift_jobs_meter
: dimensions:name
,status