From dcce9113d1b6a45256a79b1c2e6b47a9ebd73f39 Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Fri, 24 May 2024 23:54:11 +0200 Subject: [PATCH] Proxy: value: handle i64/f64/string Signed-off-by: Frank Villaro-Dixon --- src/main.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6be03b9..a0de213 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,11 +19,19 @@ struct QSParams { token: String, } +#[derive(Debug, Deserialize, Serialize)] +#[serde(untagged)] +enum OtsdbValue { + String(String), + Integer(i64), + Float(f64), +} + #[derive(Debug, Deserialize, Serialize)] struct OtsdbData { metric: String, - value: String, - timestamp: f64, + value: OtsdbValue, + timestamp: i64, tags: HashMap, }