Skip to content

Commit

Permalink
Added Label Validation in SPM Integration Test (#6142)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Part of #5608 

## Description of the changes
- The changes include requesting metric with `groupByOperation` to get
labels along with `operation`. This is then compared with the expected
label set = `"operation service_name"`

## How was this change tested?
- jaeger/scripts/spm-integration-test.sh

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Alok Kumar Singh <dev.alok.singh123@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
  • Loading branch information
akstron and yurishkuro authored Nov 2, 2024
1 parent b644701 commit 390d728
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/spm-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ validate_service_metrics() {
echo "⏳ Expecting at least 4 non-zero data points"
return 1
fi

# Validate if labels are correct
local url="http://localhost:16686/api/metrics/calls?service=${service}&groupByOperation=true&endTs=&lookback=${fiveMinutes}&step=${fifteenSec}&ratePer=${oneMinute}"

local labels
labels=$(curl -s "$url" | jq -r '.metrics[0].labels[].name' | sort | tr '\n' ' ')
local exp_labels="operation service_name "

if [[ "$labels" != "$exp_labels" ]]; then
echo "❌ ERROR: Obtained labels: '$labels' are not same as expected labels: '$exp_labels'"
return 1
fi
return 0
}

Expand Down

0 comments on commit 390d728

Please sign in to comment.