fix(otel): annotate SigNoz mutable collections for the type-discipline gate

The dict and list constructions and the header builder's return annotation each
tripped LIT001/LIT002. Each is required by the surrounding contract, so they
carry a `mutable-ok` reason rather than being restructured.
This commit is contained in:
Nagesh Bansal 2026-08-25 19:46:27 +05:30
parent c3b80de7f8
commit 0e811770d6
No known key found for this signature in database
GPG key ID: 87AE46945352DBF2

View file

@ -33,8 +33,8 @@ def signoz_preset(
base: Final = config_overrides or OpenTelemetryV2Config()
key: Final = settings.ingestion_key
return base.model_copy(
update={
"exporters": [
update={ # mutable-ok: model_copy takes a dict of field updates
"exporters": [ # mutable-ok: matches the config's exporters list
*base.exporters,
ExporterSpec(
kind="otlp_http",
@ -51,7 +51,7 @@ def signoz_preset(
)
def signoz_dynamic_headers(params: StandardCallbackDynamicParams) -> dict[str, str]:
def signoz_dynamic_headers(params: StandardCallbackDynamicParams) -> dict[str, str]: # mutable-ok: registry type
"""Per-request SigNoz OTLP headers from team/key dynamic params."""
ingestion_key: Final = params.get("signoz_ingestion_key")
return {header: value for header, value in (("signoz-ingestion-key", ingestion_key),) if value}
key: Final = params.get("signoz_ingestion_key")
return {header: value for header, value in (("signoz-ingestion-key", key),) if value} # mutable-ok: registry type