tracing-gcp

Crates.iotracing-gcp
lib.rstracing-gcp
version0.1.0
sourcesrc
created_at2024-12-09 01:30:34.721123
updated_at2024-12-09 01:30:34.721123
descriptiontracing subscriber for structured logging in gcp
homepage
repository
max_upload_size
id1476879
size14,216
Parth (Parth)

documentation

README

tracing-gcp

If you're writing a webserver in rust and running it on GCP you'll likely want to use this crate.

At lockbook our production server runs in GCP and we want to fully utilize cloud monitoring's structured logging fields.

Tracing gives us the ability to attach context to each log line using Spans. Gcp's ops-agent supports a JSON formatted log lines which allow us to engage with cloud logging in a more sophisticated manner.

This crate provides an opinionated subscriber which extracts metadata from fields in spans or events in the following manner:

  • log entries are written, in json, to the specified file.
  • only events emit log entries
  • the following special fields are extracted from any parent spans or events

In the future we may provide a way to send data directly to cloud logging using a client API (reducing the need for the ops agent).

Commit count: 0

cargo fmt