Schema and reference for Metric Bindings

Overview

This page describes the schemas for a MetricBinding, along with detailed explanations of constructs, expression syntax and semantics.

Schema for Metric Binding

Each metric binding:

  • Selects components where it can be applied

  • Defines PromQL query templates for retrieving data

  • Specifies how the resulting data must be rendered

  • Includes layout hints for selecting an appropriate place in the UI to show the chart

_type: "MetricBinding"
name: string
chartType: "line"                     # "line" is the only type for now
unit?: string
scope: string                         # Topology scope - components to bind to
enabled: boolean                      # default: true
description?: string
valuation?: "higher-is-better" | "lower-is-better"
priority?: "HIGH" | "MEDIUM" | "LOW" | "NONE"    # deprecated
queries:
  - _type: "MetricBindingQuery"
    expression: string                # promql query
    alias: string                     # name in legend
    componentIdentifierTemplate?: string    # URN template for linking
    primary?: boolean                 # is this query the primary one
tags:
  <key>: <value>
layout?:                              # where should chart be shown
  metricPerspective?:                 # the metrics perspective for a component
    tab: string
    section: string
    weight?: integer
  componentHighlight?:                # highlight perspective of a component
    section: string
    weight?: integer
  componentSummary?:                  # summary - supporting panel on the right
    weight?: integer
identifier?: string
  • _type: SUSE® Observability needs to know this is a metric binding so, value always needs to be MetricBinding

  • name: The name for the metric binding

  • chartType: SUSE® Observability will support different chart types (line, bar, etc.), currently only line is supported

  • unit: The unit of the values in the time series returned by the query or queries, used to render the Y-axis of the chart. See the supported units reference for all units

  • scope: The topology scope of the metric binding, a topology query that selects the components on which this metric binding will be shown

  • enabled: Set to false to keep the metric binding but not show it to users

  • description: Optional description, displayed on-hover of the name

  • valuation: Whether higher or lower values are "better"

  • priority: [Deprecated] One of HIGH, MEDIUM, or LOW. Main sort order for metrics on a component (in the order they’re mentioned here), secondary sort order is the name.

  • queries: A list of queries to show in the chart for the metric binding (see Writing PromQL queries)

    • expression: The (templated) promql query

    • alias: Name for the query in the legend

    • componentIdentifierTemplate: Template for identifier of related component, populated with labels of timeseries resulting from the query

    • primary: Is this query the primary one

  • tags: Will be used to organize metrics in the user interface, can be left empty using {}

  • layout: How to groups charts on different perspective views, e.g. on Metrics perspective

    • metricPerspective - Defines metrics to display on Metrics Perspective. Metrics are grouped into tabs and then sections.

      • tab - Tab name. Tabs are sorted alphabetically

      • section - Section name. Sections are sorted alphabetically

      • weight - Metrics within a section are sorted primarily by weight (ascending) and secondarily by name (alphabetical)

    • componentHighlight - Defines metrics to display on Component Highlight. Metrics are grouped in sections.

      • section - Section name. Sections are sorted alphabetically

      • weight - Metrics within a section are sorted primarily by weight (ascending) and secondarily by name (alphabetical)

    • componentSummary - Specifies metrics to display in the Components details sidebar upon component selection. Charts appear only when this property is defined.

      • weight - This represents the weight of the chart. Charts are sorted in ascending order by weight and then displays first three charts.

  • identifier: A URN (universal resource identifier), used as the unique identifier of the metric binding. It must start with urn:stackpack:<stackpack-name>:metric-binding:, the remainder is free-format as long as it’s unique amongst all metric bindings.