fix: add missing compression config for VictoriaMetrics to resolve NPE#22
Open
yulongz wants to merge 1 commit into
Open
fix: add missing compression config for VictoriaMetrics to resolve NPE#22yulongz wants to merge 1 commit into
yulongz wants to merge 1 commit into
Conversation
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.
Problem Description
When deploying HertzBeat using the Helm Chart with VictoriaMetrics enabled as the default time-series data store, the Manager component continuously throws NullPointerException in logs, causing metric data to fail to write to VictoriaMetrics. Queries for historical monitoring data return empty values.
Reproduction Steps
java.lang.NullPointerException: Cannot invoke "org.apache.hertzbeat.warehouse.store.history.tsdb.vm.VictoriaMetricsProperties$Compression.enabled()"
because the return value of "org.apache.hertzbeat.warehouse.store.history.tsdb.vm.VictoriaMetricsProperties$InsertConfig.compression()" is null
Root Cause Analysis
The warehouse.store.victoria-metrics.insert configuration node in the Manager ConfigMap template of the Helm Chart lacks the compression sub-configuration item. This causes the HertzBeat code to return null when calling insertConfig.getCompression().enabled(), which triggers the null pointer exception.
Fix Solution
Modify charts/hertzbeat/templates/manager/configmap.yaml to add the missing compression configuration under the victoria-metrics.insert node:
Verification Results
After redeploying the Helm Chart, the NPE error no longer appears in Manager logs
Metric data is written to VictoriaMetrics normally
Historical metric data queries via API return valid values correctly