Skip to content

Default to sensible time range for grafana embeds

Sarah Yasonik requested to merge sy-grafana-default-times into master

What does this MR do?

For the sake of simplicity, the ability to embed grafana charts in GitLab Flavored Markdown was implemented with the requirement of the grafana url including the time range of the chart. See more info about the feature here: https://docs.gitlab.com/ee/user/project/integrations/prometheus.html#embedding-charts-via-integration-with-grafana-http-api

This MR adds sensible defaults for the chart in case the user has forgotten to include the time range. If no range is provided, the last 8 hours will be used. If only one of the two range parameters is included (which would be an intentional choice on the user's part), the window will be 8 hours with the provided param used as one end of the range.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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
Edited by Sarah Yasonik

Merge request reports