DisabledMetricsConfiguration#
- pydantic settings safir.metrics.DisabledMetricsConfiguration#
Metrics configuration when metrics reporting is disabled.
- Parameters:
_nested_model_default_partial_update (
Optional[bool], default:None)_env_prefix_target (
Optional[Literal['variable','alias','all']], default:None)_env_file (
Union[Path,str,Sequence[Union[Path,str]],None], default:PosixPath('.'))_cli_parse_args (
Union[bool,list[str],tuple[str,...],None], default:None)_cli_settings_source (
Optional[CliSettingsSource[Any]], default:None)_cli_use_class_docs_for_groups (
Optional[bool], default:None)_cli_implicit_flags (
Union[bool,Literal['dual','toggle'],None], default:None)_cli_kebab_case (
Union[bool,Literal['all','no_enums'],None], default:None)_cli_shortcuts (
Optional[Mapping[str,Union[str,list[str]]]], default:None)_secrets_dir (
Union[Path,str,Sequence[Union[Path,str]],None], default:None)_build_sources (
Optional[tuple[tuple[PydanticBaseSettingsSource,...],dict[str,Any]]], default:None)values (
Any)
Show JSON schema
{ "title": "DisabledMetricsConfiguration", "description": "Metrics configuration when metrics reporting is disabled.", "type": "object", "properties": { "appName": { "description": "The name of the application that is emitting these metrics", "title": "Application name", "type": "string" }, "events": { "$ref": "#/$defs/EventsConfiguration", "title": "Events configuration" }, "enabled": { "description": "If set to false, no events will be sent and all calls to publish events will be no-ops.", "title": "Whether to send events", "type": "boolean" } }, "$defs": { "EventsConfiguration": { "additionalProperties": false, "description": "Configuration for emitting events.", "properties": { "topicPrefix": { "default": "lsst.square.metrics.events", "description": "You probably should use the default here. It could be useful in development scenarios to change this.", "title": "Metrics topic prefix", "type": "string" } }, "title": "EventsConfiguration", "type": "object" } }, "required": [ "appName", "enabled" ] }
- Config:
extra: str = ignore
populate_by_name: bool = True
validate_by_alias: bool = True
validate_by_name: bool = True
- Fields:
enabled (Annotated[bool, pydantic.functional_validators.AfterValidator(func=safir.metrics._config.DisabledMetricsConfiguration.
-
field enabled:
Annotated[bool] [Required]# If set to false, no events will be sent and all calls to publish events will be no-ops.
- Constraints:
func = <function DisabledMetricsConfiguration.<lambda> at 0x7f4a79b9ceb0>
- make_manager(logger=None, *, kafka_broker=None)#
Construct an
EventManager.- Parameters:
logger (
Optional[BoundLogger], default:None) – Logger to use for internal logging. If not given, thesafir.metricslogger will be used.kafka_broker (
Optional[KafkaBroker], default:None) – Kafka broker to use. If not given, a new Kafka broker will be created and automatically closed when the event manager is closed. If a broker is provided, closing the event manager will have no effect on it and the caller is responsible for starting and closing it.
- Returns:
An event manager appropriate to the configuration.
- Return type: