Repository navigation
Add metrics parameter to logfire.configure() - #444
Merged
Merged
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 |
alexmojaki
marked this pull request as ready for review
September 25, 2024 12:15
Kludex
approved these changes
Sep 26, 2024
Kludex
left a comment
Member
There was a problem hiding this comment.
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.
Contributor
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Internal discussion: https://pydantic.slack.com/archives/C05AF4A4WRM/p1727260278734989
This allows users to pass
metrics=Falseto 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_readerswhich replaces the existing top-leveladditional_metric_readersparameter 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.