Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out Namespacing Support for Metrics #17

Closed
felixnext opened this issue Jan 25, 2023 · 1 comment · Fixed by #10
Closed

Figure out Namespacing Support for Metrics #17

felixnext opened this issue Jan 25, 2023 · 1 comment · Fixed by #10
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

Comments

@felixnext
Copy link
Owner

felixnext commented Jan 25, 2023

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 MeasurementMaps? (Confirm that). If that is the case it would make sense to change the self._map module from a direct instance to a Dict[str, MeasurementMap] and create a default namespace.

If create_metrics is called with no namespace parameter this will use the default namespace, otherwise check if the namespace exists and if not create a new MeasurementMap.

This namespace parameter would then also need to be exposed to the Decorator. It might also require to create a thin wrapper object around MetricHandler (e.g. MetricNamespaceHandler or MetricNSHandler) 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 the TagMap.

Help Wanted

Please specify if this is a functionality that is really required!

@felixnext felixnext added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers Stage-Design This issue is still in design stage and might require additional discussions labels Jan 25, 2023
@felixnext
Copy link
Owner Author

Closing this with #10 - After consideration how the MeasurementMap works namespaces are integrated into the MetricSpec

@felixnext felixnext linked a pull request Jan 25, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant