Lightup Metrics API

The Metrics API from Lightup — 2 operation(s) for metrics.

OpenAPI Specification

lightup-metrics-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  description: Lightup Metrics API provides CRUD interface to Dashboard objects.
  title: Lightup Dashboard API Credentials Metrics API
  version: 1.0.0
servers:
- description: Enter your Lightup subdomain
  url: https://app.{clusterId}.lightup.ai
  variables:
    clusterId:
      default: demo
tags:
- name: Metrics
paths:
  /api/{api_version}/ws/{workspace_id}/metrics/:
    get:
      description: List all metrics based on query parameters
      parameters:
      - description: ''
        explode: true
        in: path
        name: api_version
        required: true
        schema:
          allOf:
          - description: An enumeration.
            enum:
            - v1
            title: ApiVersion
            type: string
          default: v1
          title: api_version
      - description: UUID of the workspace; visible in the workspace URL.
        explode: true
        in: path
        name: workspace_id
        required: true
        schema:
          description: UUID of the workspace; visible in the workspace URL.
          title: workspace_id
          type: string
      - description: Filter by type of metric
        explode: true
        in: query
        name: type
        required: false
        schema:
          allOf:
          - description: An enumeration.
            enum:
            - auto
            - custom
            title: MetricCreationType
            type: string
          description: Filter by type of metric
          title: type
      - description: Filter by name of the metric
        explode: true
        in: query
        name: name
        required: false
        schema:
          description: Filter by name of the metric
          title: name
          type: string
      - description: Filter by whether metric is live or not
        explode: true
        in: query
        name: is_live
        required: false
        schema:
          description: Filter by whether metric is live or not
          title: is_live
          type: boolean
      - description: Filter by list of source uuids
        explode: true
        in: query
        name: source_uuids
        required: false
        schema:
          description: Filter by list of source uuids
          items:
            type: string
          title: source_uuids
          type: array
      - description: Filter by schema_uuid
        explode: true
        in: query
        name: schema_uuid
        required: false
        schema:
          description: Filter by schema_uuid
          title: schema_uuid
          type: string
      - description: Filter by list of table uuids
        explode: true
        in: query
        name: table_uuids
        required: false
        schema:
          description: Filter by list of table uuids
          items:
            type: string
          title: table_uuids
          type: array
      - description: Filter by list of column uuids
        explode: true
        in: query
        name: column_uuids
        required: false
        schema:
          description: Filter by list of column uuids
          items:
            type: string
          title: column_uuids
          type: array
      - description: Filter by list of monitor uuids
        explode: true
        in: query
        name: monitor_uuids
        required: false
        schema:
          description: Filter by list of monitor uuids
          items:
            type: string
          title: monitor_uuids
          type: array
      - description: Filter by list of metric uuids
        explode: true
        in: query
        name: metric_uuids
        required: false
        schema:
          description: Filter by list of metric uuids
          items:
            type: string
          title: metric_uuids
          type: array
      - description: Return metrics from offset
        explode: true
        in: query
        name: offset
        required: false
        schema:
          description: Return metrics from offset
          title: offset
          type: integer
      - description: Return only limit number of metrics
        explode: true
        in: query
        name: limit
        required: false
        schema:
          description: Return only limit number of metrics
          title: limit
          type: integer
      - description: 'Input ''Bearer _access-token_''. To obtain access token, see API, API Credentials: Get access token.'
        explode: true
        in: header
        name: authorization
        required: true
        schema:
          description: 'Input ''Bearer _access-token_''. To obtain access token, see API, API Credentials: Get access token.'
          title: authorization
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema'
                type: array
          description: ''
      summary: Get metrics list
      tags:
      - Metrics
    post:
      description: Create a new metric
      parameters:
      - description: ''
        explode: true
        in: path
        name: api_version
        required: true
        schema:
          allOf:
          - description: An enumeration.
            enum:
            - v1
            title: ApiVersion
            type: string
          default: v1
          title: api_version
      - description: UUID of the workspace; visible in the workspace URL.
        explode: true
        in: path
        name: workspace_id
        required: true
        schema:
          description: UUID of the workspace; visible in the workspace URL.
          title: workspace_id
          type: string
      - description: 'Input ''Bearer _access-token_''. To obtain access token, see API, API Credentials: Get access token.'
        explode: true
        in: header
        name: authorization
        required: true
        schema:
          description: 'Input ''Bearer _access-token_''. To obtain access token, see API, API Credentials: Get access token.'
          title: authorization
          type: string
      requestBody:
        content:
          application/json:
            schema:
              definitions:
                AggregateCompareTable:
                  properties:
                    sourceUuid:
                      description: UUID of the datasource
                      title: Sourceuuid
                      type: string
                    table:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/Table'
                      description: Table associated with the metrics to compare
                      title: Table
                  required:
                  - sourceUuid
                  - table
                  title: AggregateCompareTable
                  type: object
                AggregationCompareMetricConfig:
                  description: 'Aggregate metric comparison

                    This object is used to configure metrics that compare other metrics. This allows

                    the user to be able to validate that metrics across 2 tables or datasources haven''t

                    deviated.'
                  properties:
                    aggregationWindow:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregationWindow'
                      description: This field is set by the system based on the metrics configured. All metrics should have the same aggregation window
                      readOnly: true
                    backfillDuration:
                      description: Backfill duration in seconds
                      minimum: 0
                      title: Backfillduration
                      type: integer
                    collectionMode:
                      anyOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/CollectionScheduled'
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/CollectionCustomScheduled'
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/CollectionTriggered'
                      default:
                        type: scheduled
                      title: Collectionmode
                    compares:
                      description: Map of metrics to compare
                      items:
                        $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/MetricMapping'
                      minItems: 1
                      title: Compares
                      type: array
                    configType:
                      default: aggregationCompareMetricConfig
                      enum:
                      - aggregationCompareMetricConfig
                      title: Configtype
                      type: string
                    dimension:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/DimensionType'
                      description: User classification of metric dimension. System has defaults based on type of metric
                    failingRecordsSql:
                      description: sql for retrieving failing records associated with an incident on this metric
                      title: Failingrecordssql
                      type: string
                    isLive:
                      default: true
                      description: start or resume collecting metric if isLive
                      title: Islive
                      type: boolean
                    missingValueFilling:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/MissingValueFilling'
                      description: 'missing value filling on this metric '
                    queryTimezone:
                      default: UTC
                      description: This field is set by the system
                      readOnly: true
                      title: Querytimezone
                      type: string
                    relatedMetrics:
                      default: []
                      examples:
                      - - 2cc34698-5a25-4e4e-bd01-5664660f22b7
                      items:
                        type: string
                      maxItems: 10
                      minItems: 0
                      title: Relatedmetrics
                      type: array
                    seasonality:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/Seasonality'
                      default:
                        customSchedules: null
                        periodInSeconds: 0
                        seasonInSeconds: 0
                      description: Seasonality defaults to no seasonality for this metric type. It cannot be overridden
                      readOnly: true
                      title: Seasonality
                    sourceTable:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregateCompareTable'
                      description: Source table for metrics to compare
                      title: Sourcetable
                    sources:
                      examples:
                      - - 2cc34698-5a25-4e4e-bd01-5664660f22b7
                      items:
                        type: string
                      maxItems: 1
                      minItems: 1
                      title: Sources
                      type: array
                    synchronizationDelay:
                      default: 3600
                      description: The evaluation delay when the table is considered materialized and ready for evaluation
                      maximum: 63244800
                      minimum: 0
                      title: Synchronizationdelay
                      type: integer
                    targetTable:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregateCompareTable'
                      description: Target table for metrics to compare
                      title: Targettable
                  required:
                  - sources
                  - sourceTable
                  - targetTable
                  - compares
                  title: AggregationCompareMetricConfig
                  type: object
                AggregationWindow:
                  description: An enumeration.
                  enum:
                  - 'null'
                  - second
                  - minute
                  - hour
                  - day
                  - week
                  - month
                  - quarter
                  - year
                  - 5min
                  - 10min
                  - 15min
                  title: AggregationWindow
                  type: string
                ApiVersion:
                  description: An enumeration.
                  enum:
                  - v1
                  title: ApiVersion
                  type: string
                ApproverNote:
                  properties:
                    note:
                      description: Note from approver
                      title: Note
                      type: string
                    noteAt:
                      description: Timestamp of note
                      title: Noteat
                      type: number
                  required:
                  - note
                  - noteAt
                  title: ApproverNote
                  type: object
                ApproverNotes:
                  properties:
                    notes:
                      description: Notes from approver
                      items:
                        $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/ApproverNote'
                      title: Notes
                      type: array
                  required:
                  - notes
                  title: ApproverNotes
                  type: object
                AverageAggregation:
                  properties:
                    aggregationWindow:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregationWindow'
                      description: Aggregation window for the metric
                    type:
                      default: avg
                      enum:
                      - avg
                      title: Type
                      type: string
                  title: AverageAggregation
                  type: object
                ByteCountAggregation:
                  properties:
                    aggregationWindow:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregationWindow'
                      description: Aggregation window for the metric
                    type:
                      default: byteCount
                      enum:
                      - byteCount
                      title: Type
                      type: string
                  title: ByteCountAggregation
                  type: object
                CategoricalDistributionAggregation:
                  properties:
                    aggregationWindow:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregationWindow'
                      description: Aggregation window for the metric
                    type:
                      default: categoricalDistribution
                      enum:
                      - categoricalDistribution
                      title: Type
                      type: string
                  title: CategoricalDistributionAggregation
                  type: object
                CategoryActivityAggregation:
                  properties:
                    aggregationWindow:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregationWindow'
                      description: Aggregation window for the metric
                    type:
                      default: categoryActivity
                      enum:
                      - categoryActivity
                      title: Type
                      type: string
                  title: CategoryActivityAggregation
                  type: object
                CollectionCustomScheduled:
                  properties:
                    crontabExpression:
                      description: Crontab expression to define the collection schedule of the metrics
                      title: Crontabexpression
                      type: string
                    timezone:
                      default: UTC
                      description: Timezone of the custom schedule
                      title: Timezone
                      type: string
                    type:
                      default: customScheduled
                      enum:
                      - customScheduled
                      title: Type
                      type: string
                  required:
                  - crontabExpression
                  title: CollectionCustomScheduled
                  type: object
                CollectionScheduled:
                  properties:
                    type:
                      default: scheduled
                      enum:
                      - scheduled
                      title: Type
                      type: string
                  title: CollectionScheduled
                  type: object
                CollectionTriggered:
                  properties:
                    type:
                      default: triggered
                      enum:
                      - triggered
                      title: Type
                      type: string
                  title: CollectionTriggered
                  type: object
                CollectionWindow:
                  description: An enumeration.
                  enum:
                  - partial
                  - complete
                  title: CollectionWindow
                  type: string
                Column:
                  properties:
                    columnName:
                      description: Name of the column
                      title: Columnname
                      type: string
                    columnUuid:
                      description: UUID for the column. Will be filled out by the system if not filled or filled incorrectly
                      readOnly: true
                      title: Columnuuid
                      type: string
                    type:
                      default: column
                      enum:
                      - column
                      title: Type
                      type: string
                  required:
                  - columnName
                  title: Column
                  type: object
                ColumnActivityAggregation:
                  properties:
                    aggregationWindow:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregationWindow'
                      description: Aggregation window for the metric
                    type:
                      default: columnActivity
                      enum:
                      - columnActivity
                      title: Type
                      type: string
                  title: ColumnActivityAggregation
                  type: object
                ColumnMissingValueType:
                  description: An enumeration.
                  enum:
                  - 'null'
                  - zero
                  - nan
                  title: ColumnMissingValueType
                  type: string
                ConditionType:
                  description: An enumeration.
                  enum:
                  - equal
                  - notEqual
                  - 'null'
                  - notNull
                  - isUnique
                  - in
                  - notIn
                  - inColumn
                  - notInColumn
                  - isIncreasing
                  - isDecreasing
                  - lessThan
                  - lessEqualThan
                  - greaterThan
                  - greaterEqualThan
                  - lengthEqual
                  - lengthGreaterThan
                  - lengthLessThan
                  - lengthGreaterEqualThan
                  - lengthLessEqualThan
                  - containString
                  - notContainString
                  - matchPattern
                  - notMatchPattern
                  - matchPatternCaseInsensitive
                  - notMatchPatternCaseInsensitive
                  - matchRegex
                  - notMatchRegex
                  title: ConditionType
                  type: string
                ConformityCountAggregation:
                  properties:
                    aggregationWindow:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregationWindow'
                      description: Aggregation window for the metric
                    conditions:
                      description: List of conditions to check
                      items:
                        $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/CountCondition'
                      minItems: 1
                      title: Conditions
                      type: array
                    type:
                      default: conformityCount
                      enum:
                      - conformityCount
                      title: Type
                      type: string
                  required:
                  - conditions
                  title: ConformityCountAggregation
                  type: object
                CountAggregation:
                  properties:
                    aggregationWindow:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregationWindow'
                      description: Aggregation window for the metric
                    type:
                      default: count
                      enum:
                      - count
                      title: Type
                      type: string
                  title: CountAggregation
                  type: object
                CountCondition:
                  properties:
                    type:
                      $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/ConditionType'
                    values:
                      default: []
                      items:
                        anyOf:
                        - type: integer
                        - type: number
                        - type: string
                        - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/TargetColumn'
                      title: Values
                      type: array
                  required:
                  - type
                  title: CountCondition
                  type: object
                CountUniqueAggregation:
                  properties:
                    aggregationWindow:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregationWindow'
                      description: Aggregation window for the metric
                    type:
                      default: countUnique
                      enum:
                      - countUnique
                      title: Type
                      type: string
                  title: CountUniqueAggregation
                  type: object
                CustomSql:
                  examples:
                  - aggregationWindow: day
                    sql: select date_trunc('second', timestamp) as ts, value as value from lightup_test_all_filters.robustrollingstones_v1 where timestamp > {start_ts} and timestamp <= {end_ts}
                    type: customSql
                  properties:
                    aggregationWindow:
                      $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregationWindow'
                    columnName:
                      title: Columnname
                      type: string
                    columnUuid:
                      title: Columnuuid
                      type: string
                    schemaName:
                      title: Schemaname
                      type: string
                    schemaUuid:
                      title: Schemauuid
                      type: string
                    sql:
                      title: Sql
                      type: string
                    tableName:
                      title: Tablename
                      type: string
                    tableUuid:
                      title: Tableuuid
                      type: string
                    type:
                      default: customSql
                      enum:
                      - customSql
                      title: Type
                      type: string
                  required:
                  - sql
                  title: CustomSql
                  type: object
                DataAsset:
                  properties:
                    schemaName:
                      description: Schema name associated with the table
                      title: Schemaname
                      type: string
                    schemaUuid:
                      description: Schema UUID associated with the schema. Will be filled out by the system if not filled or filled incorrectly
                      readOnly: true
                      title: Schemauuid
                      type: string
                    tableName:
                      description: Name of the table
                      title: Tablename
                      type: string
                    tableUuid:
                      description: Table UUID associated with the table. Will be filled out by the system if not filled or filled incorrectly
                      readOnly: true
                      title: Tableuuid
                      type: string
                    type:
                      default: dataAsset
                      enum:
                      - dataAsset
                      title: Type
                      type: string
                  title: DataAsset
                  type: object
                DataDelayAggregation:
                  properties:
                    aggregationWindow:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/AggregationWindow'
                      description: Aggregation window for the metric
                    type:
                      default: dataDelay
                      enum:
                      - dataDelay
                      title: Type
                      type: string
                  title: DataDelayAggregation
                  type: object
                DimensionType:
                  description: An enumeration.
                  enum:
                  - timeliness
                  - completeness
                  - accuracy
                  - custom
                  title: DimensionType
                  type: string
                DraftMetadata:
                  properties:
                    approvedAt:
                      description: Timestamp of approval
                      title: Approvedat
                      type: number
                    approvedBy:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/User'
                      description: User who approved the draft, id and username
                      title: Approvedby
                    approverNotes:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/ApproverNotes'
                      description: Notes from approver
                      title: Approvernotes
                    description:
                      description: Description of the draft
                      maxLength: 2000
                      title: Description
                      type: string
                    name:
                      description: Draft name
                      maxLength: 400
                      minLength: 1
                      title: Name
                      type: string
                    notificationChannelUuids:
                      description: Notification channel uuids
                      items:
                        type: string
                      title: Notificationchanneluuids
                      type: array
                    parentMetricUuid:
                      description: Draft's parent metric uuid
                      title: Parentmetricuuid
                      type: string
                    parentStreamIdSerial:
                      description: Draft's parent metric idSerial
                      title: Parentstreamidserial
                      type: integer
                    state:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/DraftState'
                      description: The state of the draft
                    type:
                      allOf:
                      - $ref: '#/paths/~1api~1%7Bapi_version%7D~1ws~1%7Bworkspace_id%7D~1metrics~1/post/requestBody/content/application~1json/schema/definitions/DraftType'
                      description: Type of draft
                  title: DraftMetadata
                  type: object
                DraftState:
                  description: An enumeration.
                  enum:
                  - draft
                  - approvalPending
                  - approved
                  - rejected
                  title: DraftState
                  type: string
                DraftType:
                  description: An enumeration.
                  enum:
                  - new
                  - update
                  - 

# --- truncated at 32 KB (116 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lightup/refs/heads/main/openapi/lightup-metrics-api-openapi.yml