ff-observability 0.11.0

FlowFabric observability — OTEL metrics registry + typed handles + no-op shim
Documentation
[package]
name = "ff-observability"
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true
description = "FlowFabric observability — OTEL metrics registry + typed handles + no-op shim"

[features]
# OFF by default. When OFF, the crate compiles down to zero-cost
# no-op shims — none of the OTEL / Prometheus deps are pulled in.
# Enabled transitively through `ff-server/observability`,
# `ff-engine/observability`, `ff-scheduler/observability`.
default = []
enabled = [
    "dep:opentelemetry",
    "dep:opentelemetry_sdk",
    "dep:opentelemetry-prometheus",
    "dep:prometheus",
]
# OFF by default. When ON, exposes `init_sentry()` which installs a
# Sentry client + `sentry-tracing` layer when `FF_SENTRY_DSN` is set.
# When OFF, neither sentry nor sentry-tracing appears in the dep tree.
# Enabled transitively through `ff-server/sentry`. Orthogonal to
# `enabled` (OTEL metrics) — the two features do not depend on each
# other.
sentry = ["dep:sentry", "dep:sentry-tracing", "dep:tracing", "dep:tracing-subscriber"]

[dependencies]
# Exact-patch pins. Plan §3 locked OTEL 0.27.x, but `opentelemetry-
# prometheus 0.27.0` depends on `prometheus 0.13.4` which in turn
# pulls `protobuf 2.28.x` (RUSTSEC-2024-0437 uncontrolled-recursion,
# cargo-audit hard fail). The 0.27-line does NOT have a mitigation —
# neither opting out of prometheus's default features nor a patch
# release drops the protobuf 2.x pull. Moving to 0.31.x (current
# stable) is the minimum viable fix: OTEL 0.31 + opentelemetry-
# prometheus 0.31 + prometheus 0.14 + protobuf 3.7.2 is clean.
#
# The 0.27 plan lock's rationale ("pre-0.27 minors were breaking")
# still argues for an exact-patch pin; bumping to 0.31 is more
# conservative than caret-ranging 0.27. Re-pin deliberately when
# upgrading.
opentelemetry = { version = "=0.31.0", default-features = false, features = ["metrics"], optional = true }
opentelemetry_sdk = { version = "=0.31.0", default-features = false, features = ["metrics"], optional = true }
opentelemetry-prometheus = { version = "=0.31.0", optional = true }
prometheus = { version = "=0.14.0", default-features = false, optional = true }

# Sentry error reporting. Gated behind the `sentry` feature (orthogonal
# to `enabled`). Caret-ranged on the current stable minor — the sentry
# Rust SDK follows semver on the 0.x line and we want security patches
# without a manual bump. Re-pin deliberately if a breaking minor lands.
sentry = { version = "0.47", default-features = false, features = ["backtrace", "contexts", "panic", "reqwest", "rustls"], optional = true }
sentry-tracing = { version = "0.47", optional = true }
# Only pulled when `sentry` is on — the layer returned from
# `sentry_tracing_layer()` is generic over a `tracing::Subscriber`
# registry, so the trait bounds need both crates in scope.
tracing = { workspace = true, optional = true }
tracing-subscriber = { version = "0.3", default-features = false, features = ["registry"], optional = true }