Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback metrics collection interval #646

Open
gpkc opened this issue Dec 5, 2024 · 3 comments
Open

Callback metrics collection interval #646

gpkc opened this issue Dec 5, 2024 · 3 comments
Assignees
Labels
Question Further information is requested

Comments

@gpkc
Copy link

gpkc commented Dec 5, 2024

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 ?

@gpkc gpkc added the Question Further information is requested label Dec 5, 2024
@alexmojaki
Copy link
Contributor

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.

@gpkc
Copy link
Author

gpkc commented Dec 5, 2024

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.

@gpkc
Copy link
Author

gpkc commented Dec 5, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants