Skip to content

Commit

Permalink
Add counter telemetry
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Dandamudi <rohitdandamudi.1100@gmail.com>
  • Loading branch information
me-diru committed Sep 24, 2024
1 parent 9c3c5e0 commit 88bc510
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/factor-llm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ spin-llm-local = { path = "../llm-local", optional = true }
spin-llm-remote-http = { path = "../llm-remote-http" }
spin-locked-app = { path = "../locked-app" }
spin-world = { path = "../world" }
tracing = { workspace = true }
spin-telemetry = { path = "../telemetry" }
tokio = { version = "1", features = ["sync"] }
toml = { workspace = true }
tracing = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions crates/factor-llm/src/spin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ impl LlmEngine for RemoteHttpLlmEngine {
prompt: String,
params: v2::InferencingParams,
) -> Result<v2::InferencingResult, v2::Error> {
spin_telemetry::monotonic_counter!(spin.llm_infer = 1, model_name = model);
self.infer(model, prompt, params).await
}

Expand Down
15 changes: 15 additions & 0 deletions examples/spin-timer/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 88bc510

Please sign in to comment.