Skip to content
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

Investigate reason for zero values in SPM metrics #5853

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion docker-compose/monitor/docker-compose-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ services:
- GF_AUTH_DISABLE_LOGIN_FORM=true
ports:
- 3000:3000

networks:
backend:
8 changes: 7 additions & 1 deletion scripts/spm-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,19 @@ validate_service_metrics() {
echo "Metric datapoints found for service '$service': " "${metric_points[@]}"
# Check that atleast some values are non-zero after the threshold
local non_zero_count=0
local expected_non_zero_count=4
local expected_non_zero_count=5
local zero_count=0
local expected_max_zero_count=4
local flag=false # Becomes true after first non-zero value
Copy link
Member

@yurishkuro yurishkuro Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
local flag=false # Becomes true after first non-zero value
local non_zero_found=false

for value in "${metric_points[@]}"; do
if [[ $(echo "$value > 0.0" | bc) == "1" ]]; then
flag=true
non_zero_count=$((non_zero_count + 1))
else
if [ $flag == true ]; then
echo "❌ ERROR: Zero values appearing after a non-zero value not expected"
return 1
fi
zero_count=$((zero_count + 1))
fi

Expand Down
Loading