Jupp Mueller
Jupp Mueller
Really good article, thanks a lot. I'm excited about the next one on the `promise` type.
Sorry for the late reply. The model is a single ownership model. Ownership means who is responsible for deleting that memory. - the registry owns the memory of the metric...
Hey, would `GetMetric()` from #418 solve your issue?
@danevandyck I can see what you want, but it would introduce some inconsistencies into the API, which makes me reluctant to make changes to better support your use case: -...
I'm assuming that by default registry you mean a static global object? We don't provide one because we think that [global variables are a bad idea](http://wiki.c2.com/?GlobalVariablesAreBad). That being said, nothing...
All excellent questions. > There MUST be a default CollectorRegistry Due to the nature of C++, it's not a good way for this library to provide a global variable for...
> For a basic use case, is there any reason it's helpful to have each subcomponent create it's own registry? You can also inject the registry. The benefit of injecting...
> It should be very very rare that two pieces of code share a metric name. Almost always that means that the metric should be moved up the call stack....
> It doesn't matter how long the subcomponent lives It does, it can live longer than the registry singleton and then crash on shutdown when accessing metrics. Static initialization/destruction order...
> I'd try to arrange things so it's never destructed That triggers tools like [LeakSanitizer](https://clang.llvm.org/docs/LeakSanitizer.html), which would make unit/integration test suites fail.