-
Notifications
You must be signed in to change notification settings - Fork 78
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 logfire.instrument_system_metrics()
#373
Conversation
Deploying logfire-docs with Cloudflare Pages
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #373 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 124 126 +2
Lines 9193 9256 +63
Branches 1198 1206 +8
=========================================
+ Hits 9193 9256 +63 ☔ View full report in Codecov by Sentry. |
docs/integrations/system_metrics.md
Outdated
|
||
## Configuration | ||
|
||
By default, `instrument_system_metrics` collects only the metrics it needs to display the 'Basic System Metrics' dashboard. You can choose exactly which metrics to collect and how much data to collect about each metric. The default is equivalent to this: |
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.
The current 'Basic System Metrics' dashboard template won't work with this new set of reduced metrics. I will create a PR with a new template. That PR will need to be ready to merge before these changes can be merged, and it should be deployed approximately when this is released.
When users upgrade the SDK, system metrics will stop being collected, if they were being collected at all. Since their collection was the implicit default, we can't warn them about this in code, and must rely on the changelog and announcements in slack. If the only thing that users do is add logfire.instrument_system_metrics()
then existing basic system metrics dashboards will still not work, so we need to make it clear that they also need to switch to the new template.
The old template is still useful though, because it works with OTEL conventions, so system metrics collected by means other than the logfire SDK can be used with the old template. So we should keep and document both. We need to figure out how to name them to clarify the difference, e.g. 'Basic System Metrics (Logfire)' and 'Basic System Metrics (OpenTelemetry)'.
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.
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.
Sorry to be so slow, otherwise looks great.
…logfire into alex/instrument-system-metrics
…nt-system-metrics
…nt-system-metrics
…nt-system-metrics
Breaking change!
With this, you must call
logfire.instrument_system_metrics()
to enable basic system metrics, previously system metrics were always sent if you had the appropriate package installed.Background:
In preparation for starting to charge we looked our usage from our larger beta users and realised a lot of companies were sending us a lot of system metrics which we are guessing they didn't care about, but would be charged a lot for.
This was because the standard
opentelemetry-instrumentation-system-metrics
logic was collecting around 400 metrics per minute per host — stuff like this:(This is from looking at a machine running on render)
Most people don't need 219 datapoints on disk usage every minute!
Solution
The solution (described in detail in the docs changes in this PR) are:
logfire
will now only send them if you calllogfire.instrument_system_metrics()
Feedback on whether we should adjust the set of metrics sent in "basic" mode very welcome.