Skip to content

Add context menu links to metrics dashboard panel

Miguel Rincon requested to merge 215497-add-custom-links-to-panel into master

What does this MR do?

Implements: #215497 (closed)

Renders links in the panel context menu when links are defined in the dashboard with the format:

links:
  - title: GitLab ### Optional, we show the url if no title is provided.
    url: https://gitlab.com/

Screenshots

Panel Example
See the full yml for this panel
---
dashboard: Links
panel_groups:
- group: Group Name
  panels:
  - title: Memory Usage (Total)
    type: area-chart
    y_label: Total Memory Used (GB)
    links:
    - url: https://gitlab.com/
      title: GitLab
    - url: /root/autodevops-deploy/-/environments/29/metrics?dashboard=.gitlab%2Fdashboards%2Fanomaly_subqueries.yml
      title: Anomalies Dashboard
    metrics:
    - id: system_metrics_kubernetes_container_memory_total
      query_range: avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"})
        by (job)) without (job)  /1024/1024/1024
      label: Total (GB)
      unit: GB
      metric_id: 15

Variants

What if there are more or fewer items?

few items more items system dashboard cannot be edited
2020-05-21_13.58.22 2020-05-21_13.55.45

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 🤖 GitLab Bot 🤖

Merge request reports

Loading