Show sample metrics for an environment without prometheus
What does this MR do?
This continues work started in previous MRs: !19987 (merged) and !22066 (merged). We would like the ability to display sample metrics in the monitoring dashboard without requiring a live Prometheus integration. This will be useful for demos, testing, and speeding up development when not directly working on the Prometheus integration. This MR provides the ability to view the sample metrics that have been previously generated, by allowing environment.has_metrics?
to be true
when the USE_SAMPLE_METRICS
env var is set. This allows the sample metrics to show up, even without any configuration to Prometheus, as that env var redirects the live Prometheus metrics endpoint to the sample metrics endpoint (see !19987 (merged) for more on how this works). Now all that we will need to show sample metrics for a project is to have an environment created and available
, it does not need to be pointed to a live Prometheus installation.
This closes #36255 (closed)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team