Figure out Namespacing Support for Metrics #17
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Stage-Design
This issue is still in design stage and might require additional discussions
The MetricHandler in current state is a Singleton object. Meaning it will use one
MeasurementMap
for all metrics.In most cases (esp in Azure Functions) this should not be a problem, since we only operate with one set of metrics at a time.
There might be edge cases though, where we want to have support for multiple
MeasurementMap
s? (Confirm that). If that is the case it would make sense to change theself._map
module from a direct instance to aDict[str, MeasurementMap]
and create a default namespace.If
create_metrics
is called with nonamespace
parameter this will use the default namespace, otherwise check if the namespace exists and if not create a newMeasurementMap
.This
namespace
parameter would then also need to be exposed to the Decorator. It might also require to create a thin wrapper object aroundMetricHandler
(e.g.MetricNamespaceHandler
orMetricNSHandler
) to auto-pass the namespace for interactions with metrics inside the annotated function.Bonus: We might also want to add a
__namespace
column automatically to all metrics and pass this information along in theTagMap
.Help Wanted
Please specify if this is a functionality that is really required!
The text was updated successfully, but these errors were encountered: