fix(otel): use monotonic_counter prefix and support temporality env var (#7234)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -61,7 +61,7 @@ impl SecurityManager {
|
||||
) -> Result<Vec<SecurityResult>> {
|
||||
if !self.is_prompt_injection_detection_enabled() {
|
||||
tracing::debug!(
|
||||
counter.goose.prompt_injection_scanner_disabled = 1,
|
||||
monotonic_counter.goose.prompt_injection_scanner_disabled = 1,
|
||||
"Security scanning disabled"
|
||||
);
|
||||
return Ok(vec![]);
|
||||
@@ -74,7 +74,7 @@ impl SecurityManager {
|
||||
match PromptInjectionScanner::with_ml_detection() {
|
||||
Ok(s) => {
|
||||
tracing::info!(
|
||||
counter.goose.prompt_injection_scanner_enabled = 1,
|
||||
monotonic_counter.goose.prompt_injection_scanner_enabled = 1,
|
||||
"Security scanner initialized with ML-based detection"
|
||||
);
|
||||
s
|
||||
@@ -90,7 +90,7 @@ impl SecurityManager {
|
||||
}
|
||||
} else {
|
||||
tracing::info!(
|
||||
counter.goose.prompt_injection_scanner_enabled = 1,
|
||||
monotonic_counter.goose.prompt_injection_scanner_enabled = 1,
|
||||
"Security scanner initialized with pattern-based detection only"
|
||||
);
|
||||
PromptInjectionScanner::new()
|
||||
@@ -124,7 +124,7 @@ impl SecurityManager {
|
||||
serde_json::to_string(&tool_call).unwrap_or_else(|_| "{}".to_string());
|
||||
|
||||
tracing::warn!(
|
||||
counter.goose.prompt_injection_finding = 1,
|
||||
monotonic_counter.goose.prompt_injection_finding = 1,
|
||||
threat_type = "command_injection",
|
||||
above_threshold = above_threshold,
|
||||
tool_name = %tool_call.name,
|
||||
@@ -164,7 +164,7 @@ impl SecurityManager {
|
||||
}
|
||||
|
||||
tracing::info!(
|
||||
counter.goose.prompt_injection_analysis_performed = 1,
|
||||
monotonic_counter.goose.prompt_injection_analysis_performed = 1,
|
||||
security_issues_found = results.len(),
|
||||
"Prompt injection detection: Security analysis complete"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user