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

Default the log level to error if the status code is error, and vice versa #269

Merged
merged 3 commits into from
Jun 21, 2024

Conversation

alexmojaki
Copy link
Contributor

  • If otel_status_code is ERROR and the log level is unset, then the log level is set to error. This way a query for level >= level_num('error') will generally find all kinds of errors.
  • Similarly, if the log level is >= error and otel_status_code is UNSET, then otel_status_code is set to ERROR. This means that otel_status_code = 'ERROR' will find all errors in the same way. I think I've seen some users querying otel_status_code so this will make that easy and discoverable, whereas querying level is not super user-friendly.

@alexmojaki alexmojaki requested a review from dmontagu June 18, 2024 19:29
Copy link

codecov bot commented Jun 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@alexmojaki alexmojaki marked this pull request as ready for review June 18, 2024 19:31
Copy link

cloudflare-workers-and-pages bot commented Jun 21, 2024

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 09b1eae
Status: ✅  Deploy successful!
Preview URL: https://6f1dbad4.logfire-docs.pages.dev
Branch Preview URL: https://alex-level-error.logfire-docs.pages.dev

View logs

@alexmojaki alexmojaki enabled auto-merge (squash) June 21, 2024 14:44
@alexmojaki alexmojaki merged commit 28dc2f6 into main Jun 21, 2024
11 checks passed
@alexmojaki alexmojaki deleted the alex/level-error branch June 21, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant