-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add metrics
parameter to logfire.configure()
#444
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #444 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 131 131
Lines 9718 9754 +36
Branches 1275 1285 +10
=========================================
+ Hits 9718 9754 +36 ☔ View full report in Codecov by Sentry. |
Deploying logfire-docs with
|
Latest commit: |
8ebb9d5
|
Status: | ✅ Deploy successful! |
Preview URL: | https://d47f7e4a.logfire-docs.pages.dev |
Branch Preview URL: | https://alex-metrics-options.logfire-docs.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's not the point here, but do you know why did we choose dataclasses instead of TypeDicts on the parameters for configure
? It looks very weird to instantiate those dataclasses as a user.
It seems that PyCharm is handling a plain dict being passed to a TypedDict param more cleverly than I remember in terms of stuff like autocomplete. Maybe things have improved and this should be reconsidered. |
Internal discussion: https://pydantic.slack.com/archives/C05AF4A4WRM/p1727260278734989
This allows users to pass
metrics=False
to disable sending metrics entirely, since OTEL instrumentations often produce metrics where users only want/need the spans.Alternatively users can pass
logfire.MetricsOptions(...)
. For now the only option isadditional_readers
which replaces the existing top-leveladditional_metric_readers
parameter ofconfigure
. In the future I want to add other options, including a way to filter specific metrics instead of just disabling them all, and a way to create metrics from spans in the SDK.