def _get_identity_metrics(self) -> dict[EnvMetricsName, Callable[[], int]]:
        """
        Returns a callable that counts the number of identity overrides for the environment.
        """
        return {
            EnvMetricsName.IDENTITY_OVERRIDES: (
                lambda: EdgeIdentity.dynamo_wrapper.get_identity_overrides_count(
                    self.environment.api_key
                )
            )
            if self.uses_dynamo
            else (lambda: self.environment.get_identity_overrides_queryset().count()),
        }

        Returns a callable that counts the number of identity overrides for the environment.
        
api/metrics/metrics_service.py