expression

Database observability: use bounded operation labels

Use a fixed operation summary to group database telemetry. Do not record user input, credentials, bind values or entire connection strings as metric labels. This example models labels rather than exporting telemetry or claiming a specific instrumentation library. Offline example; no server is contacted. Expected stdout (not executed): find_item insert_item other Common mistake: Using a user identifier or raw query text as a metric label.

Formal Syntax & Structure

rust syntaxrust
match operation { ... }

Working Example

Example Snippetrust
fn main() -> Result<(), Box<dyn std::error::Error>> {    let operations = ["find_item", "insert_item", "unknown-request-42"];    for op in operations {        let label = match op { "find_item" => "find_item", "insert_item" => "insert_item", _ => "other" };        println!("{label}");    }    Ok(())}
Rust Reference