Skip to content

Commit 88bc510

Browse files
committed
Add counter telemetry
Signed-off-by: Rohit Dandamudi <[email protected]>
1 parent 9c3c5e0 commit 88bc510

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

Cargo.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/factor-llm/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ spin-llm-local = { path = "../llm-local", optional = true }
2222
spin-llm-remote-http = { path = "../llm-remote-http" }
2323
spin-locked-app = { path = "../locked-app" }
2424
spin-world = { path = "../world" }
25+
tracing = { workspace = true }
26+
spin-telemetry = { path = "../telemetry" }
2527
tokio = { version = "1", features = ["sync"] }
2628
toml = { workspace = true }
2729
tracing = { workspace = true }

crates/factor-llm/src/spin.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ impl LlmEngine for RemoteHttpLlmEngine {
7171
prompt: String,
7272
params: v2::InferencingParams,
7373
) -> Result<v2::InferencingResult, v2::Error> {
74+
spin_telemetry::monotonic_counter!(spin.llm_infer = 1, model_name = model);
7475
self.infer(model, prompt, params).await
7576
}
7677

examples/spin-timer/Cargo.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)