Metric reports do not support tags
Update
@rpereira2 wrote
The API returns 204 no_content when the metrics report is not yet ready: https://gitlab.com/gitlab-org/gitlab/blob/1e7f1a0a539d1c14de3021d49f9a4e3b95af0b7f/app/controllers/projects/merge_requests_controller.rb#L349.
I don't think the browser caches the 204 response since the response contains a
Cache-Control: max-age=0, private, must-revalidate
header, which should prevent the browser from caching it.
So, I think if we retry the request (with a backoff) when a 204 response is received, this should be solved.
Summary
Creating a metric report (using the OpenMetrics format) in a CI job seems to ignore metrics with tags.
Steps to reproduce
Create a CI stage like so:
My Stage:
image: alpine
script:
- echo 'my_metric{tag="1"} 10' > metrics.txt
artifacts:
reports:
metrics: metrics.txt
Open a MR with this. Then, commit a change to the script section:
- echo 'my_metric{tag="1"} 20' > metrics.txt
Example Project
See this merge request: tom6/metrics-bug!1 (diffs)
What is the current bug behavior?
It says "Metric reports did not change", but that's not correct.
What is the expected correct behavior?
It should notice that the metric my_metric{tag="1"}
has changed from 10 to 20.