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

Initial structured logging support #564

Merged
merged 7 commits into from
Jan 22, 2024

Conversation

paulgb
Copy link
Member

@paulgb paulgb commented Jan 20, 2024

This adds support for structured logging to Plane.

  • In init_tracing, we check if PLANE_LOG_JSON is set to a value other than false (or empty). If so, we output logs in JSON instead of colored log lines.
  • Adds a dependency on valuable, which allows us to define types that serialize into JSON when JSON output is used.
  • Switches times to use chrono for better formatting in logs and more configurable serialization.
  • Introduces a few wrapper types that are used to implement valuable::Valuable on existing types (LoggableTime for DateTime<Utc>; BackendAddr for SocketAddr)

As a follow-up, we should add some spans to capture contextual data, and tweak log levels for dependencies, but this is a big improvement on what we have now.

Copy link

vercel bot commented Jan 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plane ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2024 5:54pm

@paulgb paulgb marked this pull request as ready for review January 20, 2024 18:38
@paulgb paulgb requested a review from rolyatmax January 20, 2024 18:38
pub struct TerminationCandidate {
pub backend_id: BackendName,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: is this newline intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@paulgb paulgb merged commit 4fa114c into main Jan 22, 2024
6 checks passed
@paulgb paulgb deleted the paul/dis-1572-structured-logging-support-in-plane branch January 22, 2024 22:26
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.

2 participants