Skip to content

Feature request: Allow the default Service dimension to be removed from the Dimensions dictionary #292

@glynn1211

Description

@glynn1211

Use case

I'm implementing this into my code for metrics as a clean and more efficent way of creating metrics, however I have hit a snag where I can't remove the Service Default Dimension even when using the Set Deafult Dimensions method. And would like to be able to use the existing metrics linked to alarms, without having to update them all to now be in the Service Dimension.

This would allow a user to have only the Dimensions they provide used by the metrics.

Solution/User Experience

I have Identified that when calling the SetDefaultDimensions it has a check for !DeafultDimensions.Any() to see if it should just replace the existing DefaultDimensions otherwise just add the new set being passed in. You however on initialisation create the MetricContext with the DefaultDimensions already set thus stopping it from ever using just a custom set of dimensions.

Can be solved by either not initialising on context creation or by changing the Any check in SetDefaultDimensions. Another possible solution would be to be able to clear the existing DefaultDimensions so that when Set or Add is called they can populate with just the chosen Dimensions

Alternative solutions

No response

Acknowledgment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/metricsCore metrics utilityfeature-requestNew or enhancements to existing featurestriagePending triage from maintainers

    Type

    No type

    Projects

    Status

    🏗 In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions