[package]
name = "nightlight-server"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "Nightlight metrics storage server"

[lib]
name = "nightlight_server"
path = "src/lib.rs"

[[bin]]
name = "nightlight-server"
path = "src/main.rs"

[dependencies]
# Internal crates
nightlight-api = { workspace = true }
nightlight-types = { workspace = true }

# Async runtime
tokio = { workspace = true }
tokio-stream = { workspace = true }
futures = { workspace = true }
async-trait = { workspace = true }

# gRPC
tonic = { workspace = true }
tonic-health = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }

# HTTP server (for Prometheus remote_write endpoint)
axum = { workspace = true }
hyper = { workspace = true }
tower = { workspace = true }
tower-http = { workspace = true }

# Serialization
serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
bincode = { workspace = true }

# Compression (Prometheus remote_write uses Snappy)
snap = { workspace = true }

# Error handling
thiserror = { workspace = true }
anyhow = { workspace = true }

# Logging & Tracing
tracing = { workspace = true }
tracing-subscriber = { workspace = true }

# Metrics export (self-monitoring)
prometheus = { workspace = true }

# Utilities
bytes = { workspace = true }
parking_lot = { workspace = true }

# PromQL parsing
promql-parser = "0.4"
regex = "1.10"
chrono = "0.4"

# CLI and Configuration
clap = { workspace = true }

[dev-dependencies]
tempfile = { workspace = true }
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "json"] }
