def __init__(self, environment: Environment):
        """
        Computes environment-level metrics for an Environment instance.

        This service computes metrics such as:
        - Total and enabled features
        - Segment and identity overrides
        - Open change requests and scheduled changes (if workflows enabled)

        It relies on:
        - Static metric definitions from DEFAULT_METRIC_DEFINITIONS and WORKFLOW_METRIC_DEFINITIONS
        - Predefined queryset methods on the Environment model to fetch metric sources

        Usage:
            service = EnvironmentMetricsService(environment)
            payload = service.get_metrics_payload()

        Notes:
        - Metric order is determined by the "rank" field so the Frontend can consume them without context
        - Uses environment.project.enable_dynamo_db to determine identity override backend
        """
        self.environment = environment
        self.uses_dynamo = environment.project.enable_dynamo_db

        Computes environment-level metrics for an Environment instance.

        This service computes metrics such as:
        - Total and enabled features
        - Segment and identity overrides
        - Open change requests and scheduled changes (if workflows enabled)

        It relies on:
        - Static metric definitions from DEFAULT_METRIC_DEFINITIONS and WORKFLOW_METRIC_DEFINITIONS
        - Predefined queryset methods on the Environment model to fetch metric sources

        Usage:
            service = EnvironmentMetricsService(environment)
            payload = service.get_metrics_payload()

        Notes:
        - Metric order is determined by the "rank" field so the Frontend can consume them without context
        - Uses environment.project.enable_dynamo_db to determine identity override backend
        
api/metrics/metrics_service.py