Repository navigation
Conversation
| return err | ||
| } | ||
| svcs[svc.Prefix()] = prometheus.InstrumentHandler(svc.Prefix(), svc.Handler()) | ||
| s.handlers[svc.Prefix()] = prometheus.InstrumentHandler(svc.Prefix(), svc.Handler()) |
There was a problem hiding this comment.
SA1019: prometheus.InstrumentHandler is deprecated: InstrumentHandler has several issues. Use the tooling provided in package promhttp instead. The issues are the following: (1) It uses Summaries rather than Histograms. Summaries are not useful if aggregation across multiple instances is required. (2) It uses microseconds as unit, which is deprecated and should be replaced by seconds. (3) The size of the request is calculated in a separate goroutine. Since this calculator requires access to the request header, it creates a race with any writes to the header performed during request handling. httputil.ReverseProxy is a prominent example for a handler performing such writes. (4) It has additional issues with HTTP/2, cf. prometheus/client_golang#272. (from staticcheck)
We are passing the logger on New for clear dependency injection in other modules, let's be consistent. If the dependencies start going big we may consider passing the opaque context. |
|
This is a PoC to make the local storage provider
Listening for file changes is disabled by default and can be enabled by setting
witch = true, eg:Several things I noticed:
I prefer the latter.
xattrsystemnamespace. I was wondering if we could store our own arbitrary attributes that the user cannot change himself (eg for system tags) It seems not only the namespace, but also the names you can assign a value are hardcoded. At least withsetfattrI could not set asystem.mykeyas root ... that at least will prevent us from storing system tags in the filesystem. However, anything the user can change could be stored as xattr: user tags, maybe share expiry (might require some clever naming to link it to the share).