Callback metrics collection interval
Question
According to the docs:
Callback metrics, or observable metrics, are a way to create metrics that are automatically updated based on a time interval.
However, there doesn't seem to be any mentioning in the docs on how to configure this time interval. I presume it might be the export interval which can be set with otel_interval_milliseconds ?
If you're getting otel_interval_milliseconds from https://logfire.pydantic.dev/docs/integrations/airflow/?h=otel_interval_milliseconds#airflow-configuration, yes.
More generally there's the environment variable OTEL_METRIC_EXPORT_INTERVAL.
Makes sense. I presume under the hood, logfire uses a PeriodicExportingMetricReader maybe around here:
https://github.com/pydantic/logfire/blob/main/logfire/_internal/config.py#L859
These take a export_interval_millis, so perhaps it could be interesting to be able to manually define separate readers with customized intervals.
I don't know how these interact with OTEL_METRIC_EXPORT_INTERVAL if a custom interval is set.
Example use cases for this would be: specifying lower intervals for metrics that require a higher resolution, or higher intervals for metrics that may consume resources (e.g. query a database)