-
Notifications
You must be signed in to change notification settings - Fork 62
azure monitor exporter gzip batcher and performance improvements. #1490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
azure monitor exporter gzip batcher and performance improvements. #1490
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #1490 +/- ##
===========================================
- Coverage 83.47% 62.47% -21.00%
===========================================
Files 420 277 -143
Lines 116344 71790 -44554
===========================================
- Hits 97117 44854 -52263
- Misses 18693 26402 +7709
Partials 534 534
🚀 New features to boost your workflow:
|
| #[allow(clippy::print_stdout)] | ||
| fn create_credential(auth_config: &AuthConfig) -> Result<Arc<dyn TokenCredential>, String> { | ||
| match auth_config.method { | ||
| AuthMethod::ManagedIdentity => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auth now supports managed identity and dev creds but not Azure Arc MSI; I understand this would be add later, but please add a TODO (and also create issue) tracking Azure Arc MSI support so the exporter can run on edge/Arc devices.
| if self.total_uncompressed_size == 0 { | ||
| self.buf | ||
| .write_all(b"[") | ||
| .expect("write to memory buffer failed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With `expect, any unexpected gzip/memory error crashes the exporter instead of surfacing an error.
| let json_bytes = | ||
| serde_json::to_vec(&body).map_err(|e| format!("Failed to serialize to JSON: {e}"))?; | ||
| // Clone static headers and add the auth header | ||
| let mut headers = self.static_headers.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are static headers - I believe we should be able to avoid cloning in hot path.
| self.current_uncompressed_size += 1; | ||
| } else { | ||
| self.buf | ||
| .write_all(b",") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we append , here, but later when the size check triggers a flush, the batch is emitted as [... ,] without the attempted element. Trailing comma will make the JSON invalid, and most probably fail at ingestion.
d0d5368 to
413048d
Compare
No description provided.