> ## Documentation Index
> Fetch the complete documentation index at: https://metoro.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create/Update Dashboard

> Create a new dashboard based on the provided configuration or update an existing one if the dashboard.metadata.id matches an existing dashboard.



## OpenAPI

````yaml /api-reference/openapi.yaml post /dashboards/update
openapi: 3.0.0
info:
  description: API for managing Metoro environments, alerts, and dashboards.
  license:
    name: Proprietary
    url: https://metoro.io/terms
  title: Metoro API
  version: 1.0.0
servers:
  - description: Production API server
    url: https://us-east.metoro.io/api/v1
  - description: Demo API server
    url: https://demo.us-east.metoro.io/api/v1
security: []
paths:
  /dashboards/update:
    post:
      tags:
        - Dashboards
      summary: Create/Update Dashboard
      description: >-
        Create a new dashboard based on the provided configuration or update an
        existing one if the dashboard.metadata.id matches an existing dashboard.
      operationId: createUpdateDashboard
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUpdateDashboardRequest'
        description: Dashboard to create or update
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateUpdateDashboardResponse'
          description: Dashboard created or updated successfully
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Forbidden
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal server error
      security:
        - bearerAuth: []
components:
  schemas:
    CreateUpdateDashboardRequest:
      description: Request to create or update a dashboard
      example:
        dashboard:
          settings:
            hideGlobalEnvironmentSelector: false
            defaultTimeRange: defaultTimeRange
            layoutVersion: 0
          metadata:
            id: id
            title: title
            folderPath: /dashboards/default/
          content:
            variables:
              - defaultValue: defaultValue
                overridable: true
                name: name
                selectorSettings:
                  metricName: metricName
                  attribute: attribute
              - defaultValue: defaultValue
                overridable: true
                name: name
                selectorSettings:
                  metricName: metricName
                  attribute: attribute
            title: title
            description: Related widgets for this section
            widgets: []
      properties:
        dashboard:
          $ref: '#/components/schemas/Dashboard'
      required:
        - dashboard
      type: object
    CreateUpdateDashboardResponse:
      description: Response from creating or updating a dashboard
      example:
        id: id
      properties:
        id:
          description: Unique identifier of the created/updated dashboard
          type: string
      required:
        - id
      type: object
    Error:
      example:
        error: 'Invalid alert configuration: missing required field'
      properties:
        error:
          description: Error message describing what went wrong
          type: string
      required:
        - error
      type: object
    Dashboard:
      description: Dashboard object
      example:
        settings:
          hideGlobalEnvironmentSelector: false
          defaultTimeRange: defaultTimeRange
          layoutVersion: 0
        metadata:
          id: id
          title: title
          folderPath: /dashboards/default/
        content:
          variables:
            - defaultValue: defaultValue
              overridable: true
              name: name
              selectorSettings:
                metricName: metricName
                attribute: attribute
            - defaultValue: defaultValue
              overridable: true
              name: name
              selectorSettings:
                metricName: metricName
                attribute: attribute
          title: title
          description: Related widgets for this section
          widgets: []
      properties:
        metadata:
          $ref: '#/components/schemas/DashboardMetadata'
        content:
          $ref: '#/components/schemas/GroupWidget'
        settings:
          $ref: '#/components/schemas/DashboardSettings'
      required:
        - content
        - metadata
      type: object
    DashboardMetadata:
      description: Metadata for dashboard
      example:
        id: id
        title: title
        folderPath: /dashboards/default/
      properties:
        title:
          description: Dashboard title
          type: string
        id:
          description: Unique identifier for the dashboard
          type: string
        folderPath:
          default: /dashboards/default/
          description: >-
            Path to the folder where the dashboard is stored. Must start with
            `/dashboards/`. Must end with `/`. The generated filesystem path
            will be `{folderPath}{id}`.
          pattern: \/dashboards\/.*
          type: string
      required:
        - id
      type: object
    GroupWidget:
      description: Widget for grouping other widgets
      example:
        variables:
          - defaultValue: defaultValue
            overridable: true
            name: name
            selectorSettings:
              metricName: metricName
              attribute: attribute
          - defaultValue: defaultValue
            overridable: true
            name: name
            selectorSettings:
              metricName: metricName
              attribute: attribute
        title: title
        description: Related widgets for this section
        widgets: []
      properties:
        title:
          description: Group title
          type: string
        description:
          description: >-
            Optional group description. When present, Metoro displays it as an
            info tooltip next to the group title.
          type: string
        widgets:
          description: Array of widgets in the group
          items:
            $ref: '#/components/schemas/Widget'
          type: array
        variables:
          description: Variables available in this group
          items:
            $ref: '#/components/schemas/Variable'
          type: array
      type: object
    DashboardSettings:
      description: Dashboard-wide settings
      example:
        hideGlobalEnvironmentSelector: false
        defaultTimeRange: defaultTimeRange
        layoutVersion: 0
      properties:
        defaultTimeRange:
          description: Default time range for the dashboard
          type: string
        hideGlobalEnvironmentSelector:
          default: false
          description: Whether to hide the global environment selector
          type: boolean
        layoutVersion:
          description: >-
            Dashboard layout version. Missing means legacy v1 grid; 2 means
            24-column dense manual grid.
          enum:
            - 2
          type: integer
      type: object
    Widget:
      description: Dashboard widget
      properties:
        type:
          description: Type of widget
          enum:
            - group
            - markdown
            - chart
            - stat
            - table
            - gauge
            - barGauge
            - pie
            - trace
            - log
          type: string
        position:
          $ref: '#/components/schemas/Position'
        group:
          $ref: '#/components/schemas/GroupWidget'
        markdown:
          $ref: '#/components/schemas/MarkdownWidget'
        chart:
          $ref: '#/components/schemas/ChartWidget'
        stat:
          $ref: '#/components/schemas/StatWidget'
        table:
          $ref: '#/components/schemas/TableWidget'
        gauge:
          $ref: '#/components/schemas/GaugeWidget'
        barGauge:
          $ref: '#/components/schemas/BarGaugeWidget'
        pie:
          $ref: '#/components/schemas/PieChartWidget'
        trace:
          $ref: '#/components/schemas/TraceWidget'
        log:
          $ref: '#/components/schemas/LogWidget'
      required:
        - type
      type: object
    Variable:
      description: Dashboard variable for dynamic content
      example:
        defaultValue: container5
        overridable: true
        name: name
        selector:
          dynamic:
            selectorQueries:
              - avg(container_info)
            attributeKey: container.id
          static:
            options:
              - label: 1 minute
                value: 1m
      properties:
        overridable:
          default: true
          description: Whether this variable can be overridden
          type: boolean
        defaultValue:
          description: Default value for this variable
          type: string
        name:
          description: Name of the variable
          type: string
        selector:
          $ref: '#/components/schemas/Variable_selector'
      required:
        - name
      type: object
    Position:
      description: Position configuration for widget placement
      properties:
        type:
          description: Type of positioning
          enum:
            - absolute
          type: string
        absolute:
          $ref: '#/components/schemas/Position_absolute'
      required:
        - type
      type: object
    MarkdownWidget:
      description: >-
        Widget for displaying markdown content. Supports any markdown that is
        compatible with the CommonMark (https://commonmark.org/) format.
      example:
        content: content
        description: Explains the markdown note.
      properties:
        description:
          description: >-
            Optional widget description. When present, Metoro displays it as an
            info tooltip in the widget header.
          type: string
        content:
          description: Markdown content
          type: string
      required:
        - content
      type: object
    ChartWidget:
      description: Widget for displaying charts
      example:
        expression:
          metoroQLQueries:
            - displaySettings:
                label: label
                lineSettings:
                  lineDotSize: 2
                  lineType: solid
                  lineColour: lineColour
                  lineDotColor: lineDotColor
              query: query
              bucketSize: 5
            - displaySettings:
                label: label
                lineSettings:
                  lineDotSize: 2
                  lineType: solid
                  lineColour: lineColour
                  lineDotColor: lineDotColor
              query: query
              bucketSize: 5
        chartType: line
        title: title
        description: CPU time spent busy vs idle, split by activity type
        displaySettings:
          thresholds:
            steps:
              - value: 50
                color: '#2DD881'
                name: Low
              - value: 80
                color: '#FFFF00'
                name: Medium
              - value: 90
                color: '#FF0000'
                name: High
      properties:
        title:
          description: Chart title
          type: string
        description:
          description: >-
            Optional widget description. When present, Metoro displays it as an
            info tooltip next to the widget title.
          type: string
        chartType:
          default: line
          description: Type of chart
          enum:
            - line
            - area
            - bar
          type: string
        expression:
          $ref: '#/components/schemas/ChartWidget_expression'
        displaySettings:
          $ref: '#/components/schemas/ChartWidgetDisplaySettings'
      type: object
    StatWidget:
      description: Widget for displaying statistics
      example:
        expression:
          reduceAggregation: max
          metoroQLQuery:
            query: query
            bucketSize: 5
        displaySettings:
          globalSettings:
            valuePrecision: 9
            filterableColumn: filterableColumn
            fontSize: text-xs
          valueSettings:
            - formatSpecifier: $value cores used
              colorSettings:
                color: color
                type: text
              matchingOperators:
                - threshold: 7
                  operator: greaterThan
                - threshold: 7
                  operator: greaterThan
            - formatSpecifier: $value cores used
              colorSettings:
                color: color
                type: text
              matchingOperators:
                - threshold: 7
                  operator: greaterThan
                - threshold: 7
                  operator: greaterThan
          columnSettings:
            - hiddenByDefault: true
              column: column
              regexExtractor: regexExtractor
              title: title
            - hiddenByDefault: true
              column: column
              regexExtractor: regexExtractor
              title: title
        title: title
        description: Current CPU usage reduced over the selected time range
      properties:
        title:
          description: Stat title
          type: string
        description:
          description: >-
            Optional widget description. When present, Metoro displays it as an
            info tooltip next to the widget title.
          type: string
        expression:
          $ref: '#/components/schemas/StatWidget_expression'
        displaySettings:
          $ref: '#/components/schemas/StatDisplaySettings'
      type: object
    TableWidget:
      description: Widget for displaying metric query results in a table
      example:
        title: CPU by service
        description: CPU usage by service, reduced over the selected time range
        expression:
          reduceAggregation: lastNotNull
          metoroQLQueries:
            - query: >-
                sum(container_resources_cpu_usage_seconds_total) by
                (service.name)
              bucketSize: 60
        displaySettings:
          showHeader: true
          enablePagination: true
          minColumnWidth: 120
          cellHeight: medium
          frozenColumns: 1
          columnSettings:
            - column: attributes.service.name
              title: Service
              isFilterable: true
            - column: value
              title: CPU
              alignment: right
        valuePrecision: 2
      properties:
        title:
          description: Table title
          type: string
        description:
          description: >-
            Optional widget description. When present, Metoro displays it as an
            info tooltip next to the widget title.
          type: string
        expression:
          $ref: '#/components/schemas/TableWidget_expression'
        displaySettings:
          $ref: '#/components/schemas/TableDisplaySettings'
        valuePrecision:
          description: Number of decimal places for numeric values
          format: int64
          type: integer
        unitOverride:
          description: Unit to use when formatting numeric values
          type: string
        showRawValues:
          description: >-
            When true, display full unabbreviated values with thousands
            separators instead of compact abbreviations
          type: boolean
      type: object
    GaugeWidget:
      description: Widget for displaying gauge metrics
      example:
        expression:
          reduceAggregation: max
          metoroQLQuery:
            query: query
            bucketSize: 5
        displaySettings:
          globalSettings:
            valuePrecision: 9
            min: 0
            max: 100
            label: Gauge Label
        title: title
        description: Percentage of the gauge range used by the current value
      properties:
        title:
          description: Gauge title
          type: string
        description:
          description: >-
            Optional widget description. When present, Metoro displays it as an
            info tooltip next to the widget title.
          type: string
        expression:
          $ref: '#/components/schemas/GaugeWidget_expression'
        displaySettings:
          $ref: '#/components/schemas/GaugeDisplaySettings'
      type: object
    BarGaugeWidget:
      description: Widget for displaying aggregate metrics as proportional bars
      example:
        title: CPU by service
        description: CPU usage grouped by service and reduced to the latest value
        expression:
          reduceAggregation: lastNotNull
          metoroQLQueries:
            - query: >-
                sum(container_resources_cpu_usage_seconds_total) by
                (service.name)
              bucketSize: 60
        displaySettings:
          globalSettings:
            valuePrecision: 2
            min: 0
            max: 100
            unitOverride: '%'
            orientation: horizontal
            displayMode: gradient
            valueDisplay: valueColor
            namePlacement: auto
            showUnfilled: true
      properties:
        title:
          description: Bar gauge title
          type: string
        description:
          description: >-
            Optional widget description. When present, Metoro displays it as an
            info tooltip next to the widget title.
          type: string
        expression:
          $ref: '#/components/schemas/BarGaugeWidget_expression'
        displaySettings:
          $ref: '#/components/schemas/BarGaugeDisplaySettings'
      type: object
    PieChartWidget:
      description: Widget for displaying aggregate values as pie or donut slices
      example:
        title: Request share
        description: Share of requests by service over the selected time range
        expression:
          reduceAggregation: sum
          metoroQLQueries:
            - query: sum(http_requests_total) by (service.name)
              bucketSize: 60
        displaySettings:
          pieType: donut
          radiusPercent: 80
          sort: desc
          labels:
            - name
            - percent
          legend:
            showLegend: true
            mode: table
            placement: right
            values:
              - value
              - percent
          tooltip:
            mode: all
            sort: desc
            hideZeros: true
          valuePrecision: 2
      properties:
        title:
          description: Pie chart title
          type: string
        description:
          description: >-
            Optional widget description. When present, Metoro displays it as an
            info tooltip next to the widget title.
          type: string
        expression:
          $ref: '#/components/schemas/PieChartWidget_expression'
        displaySettings:
          $ref: '#/components/schemas/PieChartDisplaySettings'
      type: object
    TraceWidget:
      description: Widget for displaying trace data
      example:
        expression:
          metoroQLQuery:
            query: traces{service.name="api"}
            bucketSize: 5
        displaySettings:
          hideSearchBar: false
          columns:
            - time
            - traceId
            - service.name
            - status
        title: API Traces
        description: Recent traces matching the API service filter
      properties:
        title:
          description: Trace widget title
          type: string
        description:
          description: >-
            Optional widget description. When present, Metoro displays it as an
            info tooltip next to the widget title.
          type: string
        expression:
          $ref: '#/components/schemas/TraceWidget_expression'
        displaySettings:
          $ref: '#/components/schemas/TraceWidgetDisplaySettings'
      type: object
    LogWidget:
      description: Widget for displaying log data
      example:
        expression:
          metoroQLQuery:
            query: logs{level="error"}
            bucketSize: 5
        displaySettings:
          hideSearchBar: false
          columns:
            - level
            - message
            - timestamp
        title: Error Logs
        description: Error logs matching the configured query
      properties:
        title:
          description: Log widget title
          type: string
        description:
          description: >-
            Optional widget description. When present, Metoro displays it as an
            info tooltip next to the widget title.
          type: string
        expression:
          $ref: '#/components/schemas/LogWidget_expression'
        displaySettings:
          $ref: '#/components/schemas/LogWidgetDisplaySettings'
      type: object
    Variable_selector:
      properties:
        dynamic:
          $ref: '#/components/schemas/DynamicVariableSelectorSettings'
        static:
          $ref: '#/components/schemas/StaticVariableSelectorSettings'
      type: object
    Position_absolute:
      description: >-
        Absolute positioning coordinates. Version 2 dashboards use 24 columns
        and an unbounded row grid. Dashboards without a layoutVersion are legacy
        12-column dashboards and are scaled when opened in the UI.
      example:
        w: 1
        x: 0
        h: 7
        'y': 7
      properties:
        x:
          description: X coordinate (0-24)
          maximum: 24
          minimum: 0
          type: integer
        'y':
          description: Y coordinate
          minimum: 0
          type: integer
        w:
          description: Width (0-24)
          maximum: 24
          minimum: 0
          type: integer
        h:
          description: Height
          minimum: 0
          type: integer
      required:
        - h
        - w
        - x
        - 'y'
      type: object
    ChartWidget_expression:
      description: Expression timeseries data to be shown on the chart
      example:
        queryMode: metoroql
        metoroQLQueries:
          - displaySettings:
              label: label
              lineSettings:
                lineDotSize: 2
                lineType: solid
                lineColour: lineColour
                lineDotColor: lineDotColor
            query: query
            bucketSize: 5
          - displaySettings:
              label: label
              lineSettings:
                lineDotSize: 2
                lineType: solid
                lineColour: lineColour
                lineDotColor: lineDotColor
            query: query
            bucketSize: 5
      properties:
        queryMode:
          description: >-
            Query mode used by the chart expression. When omitted, Metoro infers
            the mode from the populated query arrays.
          enum:
            - standard
            - metoroql
            - promql
          type: string
        metoroQLQueries:
          description: Array of MetoroQL queries
          items:
            $ref: '#/components/schemas/MetoroQLQuery'
          type: array
        promQLQueries:
          description: Array of PromQL queries
          items:
            $ref: '#/components/schemas/PromQLQuery'
          type: array
      type: object
    ChartWidgetDisplaySettings:
      description: Display settings for chart widget visualization
      example:
        thresholds:
          steps:
            - value: 50
              color: '#2DD881'
              name: Low
            - value: 80
              color: '#FFFF00'
              name: Medium
            - value: 90
              color: '#FF0000'
              name: High
      properties:
        thresholds:
          $ref: '#/components/schemas/ChartWidgetDisplaySettings_thresholds'
      type: object
    StatWidget_expression:
      description: Query expression for stat data
      example:
        reduceAggregation: max
        metoroQLQuery:
          displaySettings:
            label: label
            lineSettings:
              lineDotSize: 2
              lineType: solid
              lineColour: lineColour
              lineDotColor: lineDotColor
          query: query
          bucketSize: 5
      properties:
        metoroQLQuery:
          $ref: '#/components/schemas/MetoroQLQuery'
        promQLQuery:
          $ref: '#/components/schemas/PromQLQuery'
        queryMode:
          description: >-
            Query mode used by the stat expression. When omitted, Metoro infers
            the mode from the populated query field.
          enum:
            - standard
            - metoroql
            - promql
          type: string
        reduceAggregation:
          description: Aggregation method
          enum:
            - max
            - min
            - avg
            - sum
            - count
          type: string
      required:
        - reduceAggregation
      type: object
    StatDisplaySettings:
      description: Display settings for stat widget
      example:
        globalSettings:
          valuePrecision: 9
          filterableColumn: filterableColumn
          fontSize: text-xs
        valueSettings:
          - formatSpecifier: $value cores used
            colorSettings:
              color: color
              type: text
            matchingOperators:
              - threshold: 7
                operator: greaterThan
              - threshold: 7
                operator: greaterThan
          - formatSpecifier: $value cores used
            colorSettings:
              color: color
              type: text
            matchingOperators:
              - threshold: 7
                operator: greaterThan
              - threshold: 7
                operator: greaterThan
        columnSettings:
          - hiddenByDefault: true
            column: column
            regexExtractor: regexExtractor
            title: title
          - hiddenByDefault: true
            column: column
            regexExtractor: regexExtractor
            title: title
      properties:
        valueSettings:
          description: Settings for value display
          items:
            $ref: '#/components/schemas/ValueSettings'
          type: array
        columnSettings:
          description: Settings for columns
          items:
            $ref: '#/components/schemas/ColumnVisualSetting'
          type: array
        globalSettings:
          $ref: '#/components/schemas/GlobalSettings'
      type: object
    TableWidget_expression:
      description: Query expression for table data
      example:
        queryMode: promql
        reduceAggregation: lastNotNull
        promQLQueries:
          - query: sum(container_cpu_usage_seconds_total) by (pod)
            bucketSize: 60
      properties:
        queryMode:
          description: >-
            Query mode used by the table expression. When omitted, Metoro infers
            the mode from the populated query arrays.
          enum:
            - standard
            - metoroql
            - promql
          type: string
        metoroQLQueries:
          description: >-
            Array of MetoroQL queries. Each returned series becomes one table
            row after reduction.
          items:
            $ref: '#/components/schemas/MetoroQLQuery'
          type: array
        promQLQueries:
          description: >-
            Array of PromQL queries. Each returned instant vector sample becomes
            one table row.
          items:
            $ref: '#/components/schemas/PromQLQuery'
          type: array
        reduceAggregation:
          description: Aggregation method used to reduce each series into one table value
          enum:
            - max
            - min
            - avg
            - sum
            - count
            - last
            - lastNotNull
          type: string
      required:
        - reduceAggregation
      type: object
    TableDisplaySettings:
      description: Display settings for table widget
      example:
        showHeader: true
        enablePagination: true
        minColumnWidth: 120
        defaultColumnWidth: 180
        cellHeight: medium
        wrapText: false
        wrapHeaderText: false
        frozenColumns: 1
        columnSettings:
          - column: attributes.service.name
            title: Service
            width: 220
            alignment: left
            isFilterable: true
          - column: value
            title: Requests
            alignment: right
      properties:
        showHeader:
          default: true
          description: Whether to show table column headers
          type: boolean
        enablePagination:
          default: true
          description: Whether to paginate table rows
          type: boolean
        minColumnWidth:
          description: Minimum column width in pixels
          format: int64
          type: integer
        defaultColumnWidth:
          description: Default column width in pixels
          format: int64
          type: integer
        cellHeight:
          description: Cell height preset
          enum:
            - small
            - medium
            - large
          type: string
        wrapText:
          description: Whether to wrap table cell text
          type: boolean
        wrapHeaderText:
          description: Whether to wrap table header text
          type: boolean
        frozenColumns:
          description: Number of columns to freeze from the left
          format: int64
          type: integer
        columnSettings:
          description: Settings for individual columns
          items:
            $ref: '#/components/schemas/ColumnVisualSetting'
          type: array
      type: object
    GaugeWidget_expression:
      description: Query expression for gauge data
      example:
        reduceAggregation: max
        metoroQLQuery:
          query: query
          bucketSize: 5
      properties:
        metoroQLQuery:
          $ref: '#/components/schemas/MetoroQLQuery'
        promQLQuery:
          $ref: '#/components/schemas/PromQLQuery'
        queryMode:
          description: >-
            Query mode used by the gauge expression. When omitted, Metoro infers
            the mode from the populated query field.
          enum:
            - standard
            - metoroql
            - promql
          type: string
        reduceAggregation:
          description: Aggregation method
          enum:
            - max
            - min
            - avg
            - sum
            - count
          type: string
      required:
        - reduceAggregation
      type: object
    GaugeDisplaySettings:
      description: Display settings for gauge widget
      example:
        globalSettings:
          valuePrecision: 9
          min: 0
          max: 100
          label: Gauge Label
      properties:
        globalSettings:
          $ref: '#/components/schemas/GaugeGlobalSettings'
      type: object
    BarGaugeWidget_expression:
      description: Query expression for bar gauge data
      example:
        reduceAggregation: lastNotNull
        metoroQLQueries:
          - query: sum(container_resources_cpu_usage_seconds_total) by (service.name)
            bucketSize: 60
      properties:
        metoroQLQueries:
          description: >-
            Array of MetoroQL queries. Each returned series becomes one bar
            after reduction.
          items:
            $ref: '#/components/schemas/MetoroQLQuery'
          type: array
        promQLQueries:
          description: >-
            Array of PromQL queries. Each returned series becomes one bar after
            reduction.
          items:
            $ref: '#/components/schemas/PromQLQuery'
          type: array
        queryMode:
          description: >-
            Query mode used by the bar gauge expression. When omitted, Metoro
            infers the mode from the populated query arrays.
          enum:
            - standard
            - metoroql
            - promql
          type: string
        reduceAggregation:
          description: Aggregation method used to reduce each series into one bar value
          enum:
            - max
            - min
            - avg
            - sum
            - count
            - last
            - lastNotNull
          type: string
      required:
        - reduceAggregation
      type: object
    BarGaugeDisplaySettings:
      description: Display settings for bar gauge widget
      example:
        globalSettings:
          valuePrecision: 2
          min: 0
          max: 100
          unitOverride: '%'
          orientation: horizontal
          displayMode: gradient
          valueDisplay: valueColor
          namePlacement: auto
          showUnfilled: true
      properties:
        globalSettings:
          $ref: '#/components/schemas/BarGaugeGlobalSettings'
      type: object
    PieChartWidget_expression:
      description: Query expression for pie chart data
      example:
        reduceAggregation: sum
        metoroQLQueries:
          - query: sum(http_requests_total) by (service.name)
            bucketSize: 60
      properties:
        metoroQLQueries:
          description: >-
            Array of MetoroQL queries. Each returned series becomes one pie
            slice after reduction.
          items:
            $ref: '#/components/schemas/MetoroQLQuery'
          type: array
        promQLQueries:
          description: >-
            Array of PromQL queries. Each returned series becomes one pie slice
            after reduction.
          items:
            $ref: '#/components/schemas/PromQLQuery'
          type: array
        queryMode:
          description: >-
            Query mode used by the pie chart expression. When omitted, Metoro
            infers the mode from the populated query arrays.
          enum:
            - standard
            - metoroql
            - promql
          type: string
        reduceAggregation:
          description: Aggregation method used to reduce each series into one slice value
          enum:
            - max
            - min
            - avg
            - sum
            - count
            - last
            - lastNotNull
          type: string
      required:
        - reduceAggregation
      type: object
    PieChartDisplaySettings:
      description: Display settings for pie chart widget
      example:
        pieType: donut
        radiusPercent: 80
        sort: desc
        labels:
          - name
          - percent
        legend:
          showLegend: true
          mode: table
          placement: right
          values:
            - value
            - percent
        tooltip:
          mode: all
          sort: desc
          hideZeros: true
        valuePrecision: 2
        unitOverride: '%'
      properties:
        pieType:
          default: pie
          description: Pie visualization type
          enum:
            - pie
            - donut
          type: string
        radiusPercent:
          default: 80
          description: Outer radius as a percentage of the available chart area
          format: int64
          maximum: 100
          minimum: 1
          type: integer
        sort:
          default: desc
          description: Slice sort order
          enum:
            - none
            - asc
            - desc
          type: string
        labels:
          description: Label components to show on slices
          items:
            enum:
              - name
              - value
              - percent
            type: string
          type: array
        legend:
          $ref: '#/components/schemas/PieChartLegendSettings'
        tooltip:
          $ref: '#/components/schemas/PieChartTooltipSettings'
        valuePrecision:
          default: 2
          description: Precision for numeric values
          format: int64
          type: integer
        unitOverride:
          description: Optional unit override for displayed values
          type: string
        showRawValues:
          description: >-
            When true, display full unabbreviated values with thousands
            separators instead of compact abbreviations
          type: boolean
      type: object
    TraceWidget_expression:
      description: Query expression for trace data
      example:
        metoroQLQuery:
          query: traces{service.name="api"}
          bucketSize: 5
      properties:
        metoroQLQuery:
          $ref: '#/components/schemas/MetoroQLQuery'
      type: object
    TraceWidgetDisplaySettings:
      description: Display settings for trace widget
      example:
        hideSearchBar: false
        columns:
          - time
          - traceId
          - service.name
      properties:
        hideSearchBar:
          description: Whether to hide the search bar
          type: boolean
        columns:
          description: Array of column names to display
          items:
            type: string
          type: array
      type: object
    LogWidget_expression:
      description: Query expression for log data
      example:
        metoroQLQuery:
          query: logs{level="error"}
          bucketSize: 5
      properties:
        metoroQLQuery:
          $ref: '#/components/schemas/MetoroQLQuery'
      type: object
    LogWidgetDisplaySettings:
      description: Display settings for log widget
      example:
        hideSearchBar: false
        columns:
          - level
          - message
          - timestamp
      properties:
        hideSearchBar:
          description: Whether to hide the search bar
          type: boolean
        columns:
          description: Array of column names to display
          items:
            type: string
          type: array
      type: object
    DynamicVariableSelectorSettings:
      description: Settings for dynamic variable value selection
      example:
        selectorQueries:
          - avg(container_info)
        attributeKey: attribute
      properties:
        selectorQueries:
          description: Array of MetoroQL query strings (should have exactly 1 element)
          items:
            type: string
          maxItems: 1
          minItems: 1
          type: array
        attributeKey:
          description: Key of the attribute to use for value selection
          type: string
      required:
        - attributeKey
        - selectorQueries
      type: object
    StaticVariableSelectorSettings:
      description: Settings for static variable value selection
      example:
        options:
          - label: 1 minute
            value: 1m
      properties:
        options:
          description: Static options available for this variable
          items:
            $ref: '#/components/schemas/StaticVariableOption'
          minItems: 1
          type: array
      required:
        - options
      type: object
    MetoroQLQuery:
      description: Query configuration for MetoroQL
      example:
        displaySettings:
          label: label
          lineSettings:
            lineDotSize: 2
            lineType: solid
            lineColour: lineColour
            lineDotColor: lineDotColor
        query: query
        bucketSize: 5
      properties:
        query:
          description: MetoroQL query string
          type: string
        bucketSize:
          default: 0
          description: Size of the time buckets in seconds (0 for auto)
          format: int64
          type: integer
        displaySettings:
          $ref: '#/components/schemas/ChartDisplaySettings'
      required:
        - query
      type: object
    PromQLQuery:
      description: Query configuration for PromQL
      example:
        displaySettings:
          label: label
          lineSettings:
            lineDotSize: 2
            lineType: solid
            lineColour: lineColour
            lineDotColor: lineDotColor
        query: avg(container_net_tcp_active_connections)
        bucketSize: 60
      properties:
        query:
          description: PromQL query string
          type: string
        bucketSize:
          default: 60
          description: Size of the time buckets in seconds
          format: int64
          type: integer
        bucketMode:
          description: Whether bucketSize is fixed or resolved automatically
          enum:
            - fixed
            - auto
          type: string
        autoBucketStrategy:
          description: Automatic bucket calculation strategy
          enum:
            - metoro
            - grafana
          type: string
        grafanaIntervalFactor:
          description: >-
            Grafana target intervalFactor used when autoBucketStrategy is
            grafana
          format: double
          type: number
        grafanaMinIntervalSeconds:
          description: >-
            Grafana minimum interval in seconds used when autoBucketStrategy is
            grafana
          format: int64
          type: integer
        displaySettings:
          $ref: '#/components/schemas/ChartDisplaySettings'
      required:
        - query
      type: object
    ChartWidgetDisplaySettings_thresholds:
      description: Threshold settings for chart visualization
      properties:
        steps:
          description: Array of threshold steps
          items:
            $ref: >-
              #/components/schemas/ChartWidgetDisplaySettings_thresholds_steps_inner
          type: array
      type: object
    ValueSettings:
      description: Settings for conditional value formatting
      example:
        formatSpecifier: $value cores used
        colorSettings:
          color: color
          type: text
        matchingOperators:
          - threshold: 7
            operator: greaterThan
          - operator: range
            range:
              from: 5
              to: 10
      properties:
        matchingOperators:
          description: Operators for matching conditions
          items:
            $ref: '#/components/schemas/ValueSettings_matchingOperators_inner'
          type: array
        colorSettings:
          $ref: '#/components/schemas/ValueSettings_colorSettings'
        formatSpecifier:
          description: Format string for value display
          example: $value cores used
          type: string
      type: object
    ColumnVisualSetting:
      description: Visual settings for a column
      example:
        alignment: left
        width: 180
        isFilterable: true
        hiddenByDefault: true
        column: column
        regexExtractor: regexExtractor
        unitOverride: By
        title: title
      properties:
        column:
          description: Column identifier
          type: string
        title:
          description: Display title for column
          type: string
        hiddenByDefault:
          description: Whether column is hidden by default
          type: boolean
        regexExtractor:
          description: Regex pattern for extracting values
          type: string
        unitOverride:
          description: Unit to use when formatting numeric values in this column
          type: string
        width:
          description: Column width in pixels
          format: int64
          type: integer
        alignment:
          description: Column content alignment
          enum:
            - auto
            - left
            - center
            - right
          type: string
        isFilterable:
          description: Whether this column should be used for text filtering
          type: boolean
        hideGeneratedAttributeColumns:
          description: >-
            Whether generated stat attribute columns should be hidden when this
            column is visible
          type: boolean
      required:
        - column
      type: object
    GlobalSettings:
      description: Global display settings
      example:
        unitOverride: ms
        valuePrecision: 9
        filterableColumn: filterableColumn
        fontSize: text-xs
      properties:
        valuePrecision:
          default: 0
          description: Precision for numeric values
          format: int64
          type: integer
        fontSize:
          description: Font size for display
          enum:
            - text-xs
            - text-sm
            - text-base
            - text-lg
            - text-xl
            - text-2xl
          type: string
        filterableColumn:
          description: Column that can be filtered
          type: string
        unitOverride:
          description: Optional unit override for the displayed value.
          type: string
        showRawValues:
          description: >-
            When true, display full unabbreviated values with thousands
            separators instead of compact abbreviations
          type: boolean
      type: object
    GaugeGlobalSettings:
      description: Global display settings for gauge widget
      example:
        valuePrecision: 9
        min: 0
        max: 100
        label: Gauge Label
        showAbsoluteValue: false
        unitOverride: ms
      properties:
        valuePrecision:
          default: 0
          description: Precision for numeric values
          format: int64
          type: integer
        min:
          description: Minimum value for gauge
          format: double
          type: number
        max:
          description: Maximum value for gauge
          format: double
          type: number
        label:
          description: Label for the gauge
          type: string
        showAbsoluteValue:
          description: When true, display raw value instead of percentage
          type: boolean
        unitOverride:
          description: Optional unit override for the displayed value
          type: string
        showRawValues:
          description: >-
            When true, display full unabbreviated values with thousands
            separators instead of compact abbreviations
          type: boolean
      type: object
    BarGaugeGlobalSettings:
      description: Global display settings for bar gauge widget
      example:
        valuePrecision: 2
        min: 0
        max: 100
        unitOverride: '%'
        orientation: horizontal
        displayMode: gradient
        valueDisplay: valueColor
        namePlacement: auto
        showUnfilled: true
        sizing: auto
        minVizWidth: 0
        minVizHeight: 10
        maxVizHeight: 300
      properties:
        valuePrecision:
          default: 2
          description: Precision for numeric values
          format: int64
          type: integer
        min:
          description: Minimum value for the bar scale
          format: double
          type: number
        max:
          description: Maximum value for the bar scale
          format: double
          type: number
        unitOverride:
          description: Optional unit override for displayed values
          type: string
        orientation:
          default: auto
          description: Bar orientation
          enum:
            - auto
            - horizontal
            - vertical
          type: string
        displayMode:
          default: gradient
          description: Bar fill rendering mode
          enum:
            - gradient
            - basic
            - lcd
          type: string
        valueDisplay:
          default: valueColor
          description: How values are shown beside bars
          enum:
            - valueColor
            - textColor
            - hidden
          type: string
        namePlacement:
          default: auto
          description: Where series names are rendered
          enum:
            - auto
            - top
            - left
            - hidden
          type: string
        showUnfilled:
          default: true
          description: Whether to show the unfilled portion of each bar
          type: boolean
        sizing:
          default: auto
          description: Whether the renderer chooses bar sizes automatically
          enum:
            - auto
            - manual
          type: string
        minVizWidth:
          description: Minimum bar width in pixels when sizing is manual
          format: int64
          type: integer
        minVizHeight:
          description: Minimum bar height in pixels when sizing is manual
          format: int64
          type: integer
        maxVizHeight:
          description: Maximum bar height in pixels when sizing is manual
          format: int64
          type: integer
        showRawValues:
          description: >-
            When true, display full unabbreviated values with thousands
            separators instead of compact abbreviations
          type: boolean
      type: object
    PieChartLegendSettings:
      description: Legend settings for pie chart widget
      example:
        showLegend: true
        mode: list
        placement: bottom
        values:
          - value
          - percent
      properties:
        showLegend:
          default: true
          description: Whether to show the legend
          type: boolean
        mode:
          default: list
          description: Legend rendering mode
          enum:
            - list
            - table
          type: string
        placement:
          default: bottom
          description: Legend placement
          enum:
            - bottom
            - right
          type: string
        values:
          description: Values to include in the legend
          items:
            enum:
              - value
              - percent
            type: string
          type: array
        width:
          description: Width in pixels when the legend is placed on the right
          format: int64
          type: integer
      type: object
    PieChartTooltipSettings:
      description: Tooltip settings for pie chart widget
      example:
        mode: single
        sort: desc
        hideZeros: true
      properties:
        mode:
          default: single
          description: Tooltip mode
          enum:
            - single
            - all
            - hidden
          type: string
        sort:
          default: desc
          description: Tooltip sort order
          enum:
            - none
            - asc
            - desc
          type: string
        hideZeros:
          default: true
          description: Whether zero-value slices should be omitted from tooltips
          type: boolean
      type: object
    StaticVariableOption:
      description: A static variable option
      example:
        label: 1 minute
        value: 1m
      properties:
        label:
          description: Optional display label for the option
          type: string
        value:
          description: Value used when substituting the variable
          type: string
      required:
        - value
      type: object
    ChartDisplaySettings:
      description: Display settings for chart visualization
      example:
        label: label
        lineSettings:
          lineDotSize: 2
          lineType: solid
          lineColour: lineColour
          lineDotColor: lineDotColor
      properties:
        label:
          description: Label for the metric on the legend
          type: string
        lineSettings:
          $ref: '#/components/schemas/ChartDisplaySettings_lineSettings'
        unitOverride:
          description: >-
            if specified, this unit will be used instead of the backend-provided
            unit
          type: string
      type: object
    ChartWidgetDisplaySettings_thresholds_steps_inner:
      properties:
        value:
          description: Threshold value
          format: double
          type: number
        color:
          description: Color in hex format for this threshold level
          type: string
        name:
          description: Name for this threshold level
          type: string
      required:
        - value
      type: object
    ValueSettings_matchingOperators_inner:
      example:
        operator: greaterThan
        threshold: 7
      properties:
        operator:
          description: Comparison operator
          enum:
            - greaterThan
            - lessThan
            - greaterThanOrEqual
            - lessThanOrEqual
            - equals
            - notEquals
            - range
          type: string
        threshold:
          description: >-
            Threshold value for comparison (used with operators other than
            'range')
          format: double
          type: number
        range:
          $ref: '#/components/schemas/ValueSettings_matchingOperators_inner_range'
      required:
        - operator
      type: object
      x-examples:
        threshold-operator:
          value:
            operator: greaterThan
            threshold: 7
          summary: Example with threshold-based operator
        range-operator:
          value:
            operator: range
            range:
              from: 5
              to: 10
          summary: Example with range-based operator
    ValueSettings_colorSettings:
      description: Color settings for matches
      example:
        color: color
        type: text
      properties:
        type:
          description: Type of coloring
          enum:
            - text
            - background
          type: string
        color:
          description: Color value
          type: string
      type: object
    ChartDisplaySettings_lineSettings:
      description: Settings for line display
      example:
        lineDotSize: 2
        lineType: solid
        lineColour: lineColour
        lineDotColor: lineDotColor
      properties:
        lineType:
          default: solid
          description: Type of line
          enum:
            - solid
            - dash
          type: string
        lineColour:
          description: Color of the line
          type: string
        lineDotColor:
          description: Color of dots on the line
          type: string
        lineDotSize:
          default: 0
          description: Size of dots on the line (0 for no dots)
          format: int64
          type: integer
        areaOpacity:
          description: Opacity of the area fill under the line, from 0 to 1
          format: double
          maximum: 1
          minimum: 0
          type: number
        areaGradientMode:
          description: Gradient mode for the area fill
          enum:
            - none
            - opacity
          type: string
      type: object
    ValueSettings_matchingOperators_inner_range:
      description: Range values for comparison when operator is 'range'
      properties:
        from:
          description: Start value of the range
          format: double
          type: number
        to:
          description: End value of the range
          format: double
          type: number
      required:
        - from
        - to
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````