-
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
Separate sending to logfire from using standard OTEL env vars #351
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 #351 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 123 123
Lines 9085 9177 +92
Branches 1185 1195 +10
=========================================
+ Hits 9085 9177 +92 ☔ View full report in Codecov by Sentry. |
Ensure that `preferred_temporality=logfire.METRICS_PREFERRED_TEMPORALITY` | ||
is passed to the constructor of metric readers/exporters that accept the `preferred_temporality` argument. |
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.
Thinking about exporting to other backends, I realize that this is somewhat opinionated, and we shouldn't recommend it for all alternative metric readers.
|
||
Alternatively, you can use the `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` and `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` environment variables to specify the URLs for traces and metrics separately. These URLs should include the full path, including `/v1/traces` and `/v1/metrics`. | ||
|
||
The data will be encoded using Protobuf (not JSON) and sent over HTTP (not gRPC), so make sure that your backend supports 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.
I would add an info
admonition or something to catch attention here.
Closes #298, based on #350 (comment)
Notable changes:
OTEL_EXPORTER_OTLP_ENDPOINT
is no longer just an alternative toLOGFIRE_BASE_URL
. SettingOTEL_EXPORTER_OTLP_ENDPOINT
,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
, and/orOTEL_EXPORTER_OTLP_METRICS_ENDPOINT
will set up appropriate exporters in addition to sending to logfire, which must be turned off separately if desired. These are basic exporters relying on OTEL defaults. In particular they don't use our custom retrying logic.OTEL_TRACES_EXPORTER
to an unsupported value will silently disable the extra OTEL exporter rather than raising an error. The idea is that it's a standard variable which (1) may be set by something other than the user without them knowing, and (2) may be consumed by something other than logfire.OTEL_METRICS_EXPORTER
is similarly checked, it wasn't used at all before.