Merged
Conversation
v0.1.1 stops writing non-JSON log messages to stderr
Consume logs only if the last update timestamp is new.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR overhauls the ZCS realtime data unmarshaler and receiver to support multi-device processing with deduplication while optimizing state management through an LRU cache and refined metric construction.
- Enhanced data processing for multiple devices with timestamp-based deduplication
- Refactored metric unmarshaling by introducing helper functions and updating API conventions
- Upgraded dependencies and simplified the state management mechanism
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| receiver/zcsazzurroreceiver/testdata/response.json | Added sample JSON response reflecting multi-device support |
| receiver/zcsazzurroreceiver/receiver.go | Introduced LRU cache and multi-device processing with deduplication logic |
| receiver/zcsazzurroreceiver/marshaler.go | Refactored metric creation using helper functions and corrected scopeVersion |
| receiver/zcsazzurroreceiver/marshaler_test.go | Extended tests for comprehensive verification of metric unmarshaling |
| receiver/zcsazzurroreceiver/factory.go | Updated initialization to use the new marshaler constructor and LRU cache |
| Various go.mod and generated package test files | Updated dependency versions and adjusted import order |
Comments suppressed due to low confidence (2)
receiver/zcsazzurroreceiver/factory.go:29
- [nitpick] Consider adding a brief comment explaining the choice of maphash as the hash function, outlining its performance benefits and suitability for the LRU cache.
func hashString(s string) uint32 {
receiver/zcsazzurroreceiver/marshaler.go:108
- Ensure that truncating LastUpdate to derive the start of the day aligns with the intended timezone; consider converting metrics.LastUpdate to UTC if needed to avoid subtle discrepancies.
startOfTodayTimestamp := pcommon.Timestamp(metrics.LastUpdate.Truncate(24 * time.Hour).UnixNano())
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete overhaul of the ZCS Azzurro receiver with enhanced data processing,
improved marshaling logic, and optimized state management using LRU cache.
Key Changes
🔄 Enhanced Data Processing Pipeline:
identical data
recovery
processing
⚡ State Management Optimization:
capacity
🛠️ Technical Improvements:
Before vs After
Previous Implementation:
New Implementation:
Benefits