Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: patch
type: add
---

When a request to AppSignal returns a `401 Unauthorized` error status code, display a log message asking the customer to ensure they're using an app-level push API key.
26 changes: 21 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,11 +754,27 @@ async fn send_batch(

let response = client.post(url.clone()).body(batch_bytes).send().await?;

info!(
"Batch of {} metrics sent: {:?}",
batch.get_metrics().len(),
response.status()
);
let status = response.status();

if status.is_success() {
info!(
"Batch of {} metrics sent successfully (HTTP response status: {})",
batch.get_metrics().len(),
status
);
} else if status == 401 {
warn!(
"Batch of {} metrics failed to send (HTTP response status: {}) - make sure you're using an *app-level* push API key",
batch.get_metrics().len(),
status
);
} else {
warn!(
"Batch of {} metrics failed to send (HTTP response status: {})",
batch.get_metrics().len(),
status
);
}

Ok(response)
}
Expand Down