Skip to content

Add the support for the PersesDashboard CRD #85

@mmanciop

Description

@mmanciop

Summary

Add support for the PersesDashboard CRD (perses.dev/v1alpha1) as an input format for the apply command and dashboards create.
This mirrors how PrometheusRule CRD files are already accepted and converted into check rules.

With this feature, users can manage Perses dashboard definitions via the CLI:

dash0 apply -f persesdashboard.yaml
dash0 dashboards create -f persesdashboard.yaml

Background

The Perses project defines a Kubernetes CRD called PersesDashboard (perses.dev/v1alpha1), used by the Perses Operator.
The Dash0 Operator already watches PersesDashboard resources and synchronizes them to Dash0 as dashboards (see dash0-operator).
Adding CLI support would give users a non-Kubernetes path to import the same format.

PersesDashboard CRD structure

apiVersion: perses.dev/v1alpha1
kind: PersesDashboard
metadata:
  name: my-dashboard
  annotations:
    dash0.com/folder-path: "/my/folder"
spec:
  display:
    name: My Dashboard
    description: Optional description
  duration: 5m
  refreshInterval: 30s
  datasources:
    PrometheusLocal:
      default: true
      plugin:
        kind: PrometheusDatasource
        spec:
          proxy:
            kind: HTTPProxy
            spec:
              url: http://localhost:9090
  variables:
    - kind: ListVariable
      spec:
        name: job
        plugin:
          kind: PrometheusLabelValuesVariable
          spec:
            labelName: job
  panels:
    myPanel:
      kind: Panel
      spec:
        display:
          name: Request Rate
        plugin:
          kind: TimeSeriesChart
          spec: {}
        queries:
          - kind: TimeSeriesQuery
            spec:
              plugin:
                kind: PrometheusTimeSeriesQuery
                spec:
                  query: rate(http_requests_total[5m])
  layouts:
    - kind: Grid
      spec:
        display:
          title: Overview
        items:
          - x: 0
            y: 0
            width: 12
            height: 6
            content:
              $ref: "#/spec/panels/myPanel"

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions