BaseMetricsConfiguration¶
- pydantic settings safir.metrics.BaseMetricsConfiguration¶
Metrics configuration, including the required Kafka configuration.
Currently, this only configures events, but if additional types of metrics are added in the future, that configuration will be added here.
This is the recommended configuration approach if you don’t need to use Kafka, the schema manager, or the schema registry in any other parts of your application. Applications that also use Kafka directly should instead create a
EventManager
with externally-managed Kafka clients.- Parameters:
_nested_model_default_partial_update (
bool
|None
, default:None
)_env_file (
Union
[Path
,str
,Sequence
[Union
[Path
,str
]],None
], default:PosixPath('.')
)_cli_parse_args (
bool
|list
[str
] |tuple
[str
,...
] |None
, default:None
)_cli_settings_source (
Optional
[CliSettingsSource
[Any
]], default:None
)_secrets_dir (
Union
[Path
,str
,Sequence
[Union
[Path
,str
]],None
], default:None
)values (
Any
)
Show JSON schema
{ "title": "BaseMetricsConfiguration", "description": "Metrics configuration, including the required Kafka configuration.\n\nCurrently, this only configures events, but if additional types of metrics\nare added in the future, that configuration will be added here.\n\nThis is the recommended configuration approach if you don't need to use\nKafka, the schema manager, or the schema registry in any other parts of\nyour application. Applications that also use Kafka directly should instead\ncreate a `~safir.metrics.EventManager` with externally-managed Kafka\nclients.", "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" } }, "$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" } }, "additionalProperties": false, "required": [ "appName" ] }
- field application: str [Required]¶
The name of the application that is emitting these metrics
- field events: EventsConfiguration [Optional]¶
- abstract make_manager(logger=None)¶
Construct an EventManager.
- Parameters:
logger (
BoundLogger
|None
, default:None
) – Logger to use for internal logging. If not given, thesafir.metrics
logger will be used.- Returns:
An event manager appropriate to the configuration.
- Return type: