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 Oct 3, 2024
1 parent 967fdf3 commit c2a4a27
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion crates/factor-llm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ 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 = { workspace = true, features = ["sync"] }
toml = { workspace = true }
tracing = { workspace = true }
url = { version = "2", features = ["serde"] }

[dev-dependencies]
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
39 changes: 36 additions & 3 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 c2a4a27

Please sign in to comment.