Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Feature flags

FeatureDefaultProvides
logsyesThe logging layer with the JSON lines sink, and Error Reporting for every sink
logs-apinoThe Cloud Logging API sink; includes logs
logs-otlpnoThe OTLP sink; includes logs and otlp
otlpnoThe OTLP exporter for the Telemetry API, and GcpAuthInterceptor for any OTLP exporter
trace-apinoThe Cloud Trace API exporter
tls-rootsyesNative TLS root certificates, see TLS and crypto features
tls-webpki-rootsnoTLS root certificates of the webpki-roots crate
auth-default-cryptoyesThe rustls crypto provider that service account keys are signed with

The modules follow the features: logs, otlp and trace_api. ids holds LogId, which the logs-api and logs-otlp sinks take, and errors holds the error types. Nothing is re-exported at the crate root.

Choose the features by goal:

  • logs to stdout for an agent: the defaults;
  • logs through the Cloud Logging API: logs-api;
  • logs and spans through the Telemetry API: logs-otlp;
  • spans through the Telemetry API: otlp;
  • spans through the Cloud Trace API: trace-api, see Choosing an exporter.

With default-features = false, enable a TLS roots feature and, for service account keys, auth-default-crypto:

[dependencies]
gcloud-observability = { version = "0.31", default-features = false, features = ["logs", "otlp", "tls-webpki-roots", "auth-default-crypto"] }