{"record":{"id":"55159c0095b66e1c","repo":"microsoft/graphrag","slug":"metricsconfig-processor-strategy-is-not-regist","errorCode":null,"errorMessage":"MetricsConfig.processor '{strategy}' is not registered in the MetricsProcessorFactory. Registered strategies: {', '.join(metrics_processor_factory.keys())}","messagePattern":"MetricsConfig\\.processor '(.+?)' is not registered in the MetricsProcessorFactory\\. Registered strategies: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/graphrag-llm/graphrag_llm/metrics/metrics_processor_factory.py","lineNumber":71,"sourceCode":"    \"\"\"\n    strategy = metrics_config.type\n    init_args = metrics_config.model_dump()\n\n    if strategy not in metrics_processor_factory:\n        match strategy:\n            case MetricsProcessorType.Default:\n                from graphrag_llm.metrics.default_metrics_processor import (\n                    DefaultMetricsProcessor,\n                )\n\n                metrics_processor_factory.register(\n                    strategy=MetricsProcessorType.Default,\n                    initializer=DefaultMetricsProcessor,\n                    scope=\"singleton\",\n                )\n            case _:\n                msg = f\"MetricsConfig.processor '{strategy}' is not registered in the MetricsProcessorFactory. Registered strategies: {', '.join(metrics_processor_factory.keys())}\"\n                raise ValueError(msg)\n\n    return metrics_processor_factory.create(\n        strategy=strategy,\n        init_args={\n            **init_args,\n            \"metrics_config\": metrics_config,\n        },\n    )\n","sourceCodeStart":53,"sourceCodeEnd":80,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag-llm/graphrag_llm/metrics/metrics_processor_factory.py#L53-L80","documentation":"create_metrics_processor dispatches on MetricsConfig.processor against the registered processor factory; unknown values hit the catch-all case and raise with the registered strategy list. Reached indirectly via create_completion/create_embedding when a metrics config is supplied.","triggerScenarios":"Calling create_completion or create_embedding with metrics_config.processor set to an unregistered name/enum; or constructing a metrics processor directly with an unknown strategy.","commonSituations":"Typo in the processor name in settings.yaml; a custom processor not yet registered via register_metrics_processor; version change renaming MetricsProcessorType members.","solutions":["Use a registered processor value (the error lists them), typically MetricsProcessorType.Default","Register your custom processor first: register_metrics_processor(strategy=..., initializer=YourProcessor)","Fix typos / re-check enum names after upgrading graphrag-llm"],"exampleFix":"# before\ncreate_completion(model_config=cfg, metrics_config=MetricsConfig(processor=\"defualt\"))\n# after\ncreate_completion(model_config=cfg, metrics_config=MetricsConfig(processor=MetricsProcessorType.Default))","handlingStrategy":"validation","validationCode":"from graphrag_llm.metrics import MetricsProcessorType\nif not isinstance(mc := (metrics_config.processor if metrics_config else None), (MetricsProcessorType,)) and str(mc) not in {e.value for e in MetricsProcessorType}:\n    metrics_config = None  # or set processor=MetricsProcessorType.Default","typeGuard":"def is_registered_processor(p) -> bool:\n    return p in {e.value for e in MetricsProcessorType} or p in list(MetricsProcessorType)","tryCatchPattern":"try:\n    proc = create_metrics_processor(metrics_config=mc)\nexcept ValueError as e:\n    if \"is not registered in the MetricsProcessorFactory\" in str(e):\n        mc.processor = MetricsProcessorType.Default\n        proc = create_metrics_processor(metrics_config=mc)\n    else:\n        raise","preventionTips":["Use MetricsProcessorType enum members, not free strings, in configs","Register custom processors in a bootstrap module before any factory call","Re-check enum names after upgrading graphrag-llm"],"tags":["factory","metrics","unknown-provider","config-validation"],"backgroundTag":"unknown-strategy-key","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}