Macrometa Metrics API

Retrieve EDS metrics data

OpenAPI Specification

macrometa-metrics-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Macrometa API Reference Activity Metrics API
  version: 0.17.17
  description: API reference for the Macrometa Global Data Network.
  license:
    name: Macrometa License, Version 2.0
servers:
- url: https://api-play.paas.macrometa.io
  description: GDN API
host: api-play.paas.macrometa.io
security:
- ApiKeyAuth: []
- BearerAuth: []
tags:
- name: Metrics
  description: Retrieve EDS metrics data
paths:
  /api/es/v1/metrics:
    get:
      tags:
      - Metrics
      summary: Retrieve metrics data via WebSocket
      description: Understanding the performance and usage of the EDS is vital. Metrics provide insights that help identify issues, analyze trends, optimize operations, and measure effectiveness.
      operationId: get-metrics-ws
      parameters:
      - $ref: '#/components/parameters/start'
      - $ref: '#/components/parameters/end'
      - $ref: '#/components/parameters/type'
      - $ref: '#/components/parameters/name'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/order'
      - $ref: '#/components/parameters/x-customer-id'
      responses:
        '200':
          description: Successfully returned the status of the service.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MetricsResponse'
              examples:
                Event delivery service metrics:
                  value:
                    cid: cust-id
                    evntdlv: 31468092
                    evntdlvrt: 0
                    evnterrrt: 0
                    evntpub: 0
                    evntpubrt: 0
                    evntsz: 39573481965
                    evntszrt: 0
                    fb: _system
                    mxconn: 0
                    mxqry: 0
                    ssesub: 0
                    str: 3
                    strm:
                    - stream1:
                        conn: 0
                        evntdlvrt: 0
                        evnterrrt: 0
                        evntszrt: 0
                        qry: 0
                    ts: 1720569636000
                    type: day
                    wssub: 0
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetErrorResponse'
      security:
      - api_key: []
  /api/es/sse/v1/metrics:
    get:
      tags:
      - Metrics
      summary: Retrieve metrics data via SSE
      description: Understanding the performance and usage of the EDS is vital. Metrics provide insights that help identify issues, analyze trends, optimize operations, and measure effectiveness.
      operationId: get-metrics-sse
      parameters:
      - $ref: '#/components/parameters/start'
      - $ref: '#/components/parameters/end'
      - $ref: '#/components/parameters/type'
      - $ref: '#/components/parameters/name'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/order'
      - $ref: '#/components/parameters/x-customer-id'
      responses:
        '200':
          description: Successfully returned the status of the service.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MetricsResponse'
              examples:
                Event delivery service metrics:
                  value:
                    cid: cust-id
                    evntdlv: 31468092
                    evntdlvrt: 0
                    evnterrrt: 0
                    evntpub: 0
                    evntpubrt: 0
                    evntsz: 39573481965
                    evntszrt: 0
                    fb: _system
                    mxconn: 0
                    mxqry: 0
                    ssesub: 0
                    str: 3
                    strm:
                    - stream1:
                        conn: 0
                        evntdlvrt: 0
                        evnterrrt: 0
                        evntszrt: 0
                        qry: 0
                    ts: 1720569636000
                    type: day
                    wssub: 0
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetErrorResponse'
      security:
      - api_key: []
  /api/ds/v1/metrics:
    get:
      summary: Retrieve metrics data
      description: Returns metrics data for a given time period. If the data for a particular period is 'null', then metrics cannot be calculated for that time period. For example, accuracy cannot be calculated if there were no visits for that day.
      operationId: getMetricsData
      tags:
      - Metrics
      security:
      - ApiKeyAuth: []
      parameters:
      - name: start
        in: query
        description: The start date used for querying metrics data. Must be provided in RFC3339 date-time format and UTC.
        required: false
        example: YYYY-MM-DDTHH:MM:SSZ
        schema:
          type: string
          format: date-time
      - name: end
        in: query
        description: The end date used for querying metrics data. Must be provided in RFC3339 date-time format and UTC.
        required: false
        example: YYYY-MM-DDTHH:MM:SSZ
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: Successfully retrieved metrics data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsResponse_2'
        '400':
          description: Bad request
        '401':
          description: Authorization failure due to invalid authentication credentials.
  /api/ds/v1/metrics/topn/visits:
    get:
      summary: Retrieve top visits count with their visitor IDs.
      description: Returns top visits count with their visitor IDs for a given time period.
      operationId: getTopNVisitsData
      tags:
      - Metrics
      security:
      - ApiKeyAuth: []
      parameters:
      - name: n
        in: query
        description: Number of top visits data to return to.
        required: true
        example: 'true'
        schema:
          type: number
      - name: isBot
        in: query
        description: Flag to include bots in top n visits count.
        required: false
        example: 'false'
        schema:
          type: boolean
      - name: start
        in: query
        description: The start date used for querying visits data. Must be provided in RFC3339 date-time format and be in UTC. The default start time is 24 hours before the current time.
        required: false
        example: YYYY-MM-DDTHH:MM:SSZ
        schema:
          type: string
          format: date-time
      - name: end
        in: query
        description: The end date used for querying visits data. Must be provided in RFC3339 date-time format and be in UTC. The default end time is the current time.
        required: false
        example: YYYY-MM-DDTHH:MM:SSZ
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: Successfully retrieved metrics data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopNVisitsResponse'
        '400':
          description: Bad request.
        '401':
          description: Authorization failure due to invalid authentication credentials.
  /api/ds/v1/metrics/traffic:
    get:
      summary: Retrieve visitor traffic metrics
      description: "Returns the visitor traffic over a period of time.\n\nThe traffic metrics are reported in five-minute intervals:\n- Total number of human visitors\n- Total number of good bot visitors\n- Total number of bad bot visitors\n- Total number of unknown bot visitors\n\n_Human visitors_ are non-bot visitors. _Good bots_ are a list of well-known bots, including Googlebot, Bingbot, and so on).\n_Bad bots_ are a list of known bad bots, including Grinchbots, AhrefsBot, and so on. _Unknown bots_ are visitors that are likely \nbots but are not in the good or bad bot lists.\n"
      operationId: getTrafficData
      tags:
      - Metrics
      security:
      - ApiKeyAuth: []
      parameters:
      - name: start
        in: query
        description: The start date used for querying visitor traffic data. Must be provided in RFC3339 date-time format and UTC. The default start time is 24 hours before the current time.
        required: false
        example: YYYY-MM-DDTHH:MM:SSZ
        schema:
          type: string
          format: date-time
      - name: end
        in: query
        description: The end date used for querying visitor traffic data. Must be provided in RFC3339 date-time format and UTC. The default end time is the current time.
        required: false
        example: YYYY-MM-DDTHH:MM:SSZ
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: Successfully retrieved traffic metrics data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrafficResponse'
        '400':
          description: Bad request.
        '401':
          description: Authorization failure due to invalid authentication credentials.
  /api/ds/v1/metrics/device/types:
    get:
      summary: Retrieve the different device types for the visits
      description: 'Returns the device types over a period of time.

        '
      operationId: getDeviceTypeData
      tags:
      - Metrics
      security:
      - ApiKeyAuth: []
      parameters:
      - name: start
        in: query
        description: The start date used for querying the device data. Must be provided in RFC3339 date-time format and UTC. The default start time is 24 hours from current time.
        required: false
        example: YYYY-MM-DDTHH:MM:SSZ
        schema:
          type: string
          format: date-time
      - name: end
        in: query
        description: The end date used for querying the device data. Must be provided in RFC3339 date-time format and UTC. The default end time is the current time.
        required: false
        example: YYYY-MM-DDTHH:MM:SSZ
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: Successfully retrieved device metrics data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceTypeResponse'
        '400':
          description: Bad request.
        '401':
          description: Authorization failure due to invalid authentication credentials.
  /api/prerender/v1/metrics/percentiles/responsetime:
    get:
      summary: 'Get response time percentiles '
      tags:
      - Metrics
      description: Returns response time percentiles within a specific time range, optionally filtered by URL pattern and response code. Required query parameters include from and to, denoting the epoch time range in seconds. An optional urlRegex parameter allows filtering by URL patterns, while responseCode filters the metrics by HTTP response code. The endpoint returns the 90th, 95th, and 99th percentiles of response times. A customerId header is required for authentication.
      parameters:
      - schema:
          type: number
        in: query
        name: from
        required: true
        description: Timestamp (in seconds) used as the initial time for filtering.
      - schema:
          type: number
        in: query
        name: to
        required: true
        description: Timestamp (in seconds) used as the final time for filtering.
      - schema:
          type: string
        in: query
        name: urlRegex
        required: false
        description: Regex of URL path.
      - schema:
          type: number
        in: query
        name: responseCode
        required: false
        description: Response code for filtering.
      - schema:
          type: string
        in: header
        name: x-photoniq-customerid
        required: true
        description: Customer unique identifier.
      responses:
        '200':
          description: Response time percentiles fetched successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  p90:
                    type: number
                    description: The 90th percentile value. This represents the value below which 90% of the data points fall.
                  p95:
                    type: number
                    description: The 95th percentile value. This represents the value below which 95% of the data points fall.
                  p99:
                    type: number
                    description: The 99th percentile value. This represents the value below which 99% of the data points fall.
                description: Response time percentiles fetched successfully.
                example:
                  p90: 7355
                  p95: 8007
                  p99: 10517
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                description: Bad request.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Header x-photoniq-customerid is required.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                description: Internal server error.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Internal server error.
  /api/prerender/v1/metrics/percentiles/responsetime/{origin}:
    get:
      summary: Get response time percentiles  by origin
      tags:
      - Metrics
      description: Returns response time percentiles within a specific time range, optionally filtered by URL pattern and response code. Required query parameters include from and to, denoting the epoch time range in seconds. An optional urlRegex parameter allows filtering by URL patterns, while responseCode filters the metrics by HTTP response code. The endpoint returns the 90th, 95th, and 99th percentiles of response times. A customerId header is required for authentication.
      parameters:
      - schema:
          type: number
        in: query
        name: from
        required: true
        description: Timestamp (in seconds) used as the initial time for filtering.
      - schema:
          type: number
        in: query
        name: to
        required: true
        description: Timestamp (in seconds) used as the final time for filtering.
      - schema:
          type: string
        in: query
        name: urlRegex
        required: false
        description: Regex of URL path.
      - schema:
          type: number
        in: query
        name: responseCode
        required: false
        description: Response code for filtering.
      - schema:
          type: string
          minLength: 1
        example: www.origin.com
        in: path
        name: origin
        required: true
        description: Origin hostname.
      - schema:
          type: string
        in: header
        name: x-photoniq-customerid
        required: true
        description: Customer unique identifier.
      responses:
        '200':
          description: Response time percentiles fetched successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  p90:
                    type: number
                    description: The 90th percentile value. This represents the value below which 90% of the data points fall.
                  p95:
                    type: number
                    description: The 95th percentile value. This represents the value below which 95% of the data points fall.
                  p99:
                    type: number
                    description: The 99th percentile value. This represents the value below which 99% of the data points fall.
                description: Response time percentiles fetched successfully.
                example:
                  p90: 7355
                  p95: 8007
                  p99: 10517
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                description: Bad request.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Header x-photoniq-customerid is required.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                description: Internal server error.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Internal server error.
  /api/prerender/v1/metrics/stats/prefetch/{origin}:
    get:
      summary: Get prefetch statistics
      tags:
      - Metrics
      description: Returns the latest prefetch statistics associated with the origin.
      parameters:
      - schema:
          type: string
          enum:
          - queued
          - in_progress
          - completed
          - canceled
        in: query
        name: status
        required: false
        description: Prefetch status.
      - schema:
          type: integer
          minimum: 0
          default: 0
        in: query
        name: offset
        required: false
        description: Pagination offset.
      - schema:
          type: integer
          minimum: 1
          default: 1000
          maximum: 1000
        in: query
        name: limit
        required: false
        description: Pagination limit.
      - schema:
          type: string
          minLength: 1
        example: www.origin.com
        in: path
        name: origin
        required: true
        description: Origin hostname.
      - schema:
          type: string
        in: header
        name: x-photoniq-customerid
        required: true
        description: Customer unique identifier.
      responses:
        '200':
          description: Prefetch statistics fetched successfully.
          content:
            application/json:
              schema:
                type: array
                description: Prefetch statistics fetched successfully.
                items:
                  type: object
                  properties:
                    prefetchType:
                      type: string
                      enum:
                      - manual
                      - scheduled
                      description: Method of prefetching.
                    prefetchStatus:
                      type: string
                      description: Current status of prefetching.
                    totalPrefetched:
                      type: number
                      description: Count of total URLs prefetched.
                    totalCompleted:
                      type: number
                      description: Count of URLs successfully prefetched.
                    totalRetrying:
                      type: number
                      description: Count of URLs retrying prefetch.
                    totalQueued:
                      type: number
                      description: Count of URLs queued for prefetch.
                    totalFailed:
                      type: number
                      description: Count of URLs where prefetch failed.
                    createdAt:
                      type: number
                      description: Unix timestamp of prefetch trigger creation.
                  required:
                  - prefetchType
                  - prefetchStatus
                  - totalPrefetched
                  - totalCompleted
                  - totalRetrying
                  - totalQueued
                  - totalFailed
                  - createdAt
                example:
                - prefetchType: scheduled
                  prefetchStatus: in_progress
                  totalPrefetched: 500
                  totalCompleted: 400
                  totalRetrying: 3
                  totalQueued: 95
                  totalFailed: 2
                  createdAt: 1672542000
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                description: Bad request.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Header x-photoniq-customerid is required.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                description: Internal server error.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Internal server error.
  /api/prerender/v1/metrics/stats/render:
    get:
      summary: Get render-stats metrics
      tags:
      - Metrics
      description: 'Returns render stats metrics within a specified time range. This endpoint expects two required query parameters: from and to, representing the start and end of the time range in epoch seconds. The request must include a customerId header for authentication.'
      parameters:
      - schema:
          type: number
        in: query
        name: from
        required: true
        description: Timestamp (in seconds) used as the initial time for filtering.
      - schema:
          type: number
        in: query
        name: to
        required: true
        description: Timestamp (in seconds) used as the final time for filtering.
      - schema:
          type: string
        in: header
        name: x-photoniq-customerid
        required: true
        description: Customer unique identifier.
      responses:
        '200':
          description: Render statistics fetched successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalPrefetch:
                    type: number
                    description: The total number of prefetched requests.
                  totalCacheHits:
                    type: number
                    description: The total number of requests that were successfully served from the cache.
                  totalCacheMisses:
                    type: number
                    description: The total number of requests that were not served from the cache.
                  totalResponseSize:
                    type: number
                    description: The total size of all responses sent, measured in bytes.
                  totalOriginsRenderingFor:
                    type: number
                    description: The total number of unique origins for which rendering was performed.
                  totalRenders:
                    type: number
                    description: The total number of render operations performed.
                  totalFailed:
                    type: number
                    description: The total number of render operations that failed.
                description: Render statistics fetched successfully.
                example:
                  totalPrefetch: 75
                  totalCacheHits: 6
                  totalCacheMisses: 83
                  totalResponseSize: 30340237
                  totalOriginsRenderingFor: 3
                  totalRenders: 87
                  totalFailed: 2
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                description: Bad request.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Header x-photoniq-customerid is required.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                description: Internal server error.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Internal server error.
  /api/prerender/v1/metrics/stats/render/{origin}:
    get:
      summary: Get render-stats metrics by origin
      tags:
      - Metrics
      description: 'Returns render stats metrics within a specified time range. This endpoint expects two required query parameters: from and to, representing the start and end of the time range in epoch seconds. The request must include a customerId header for authentication.'
      parameters:
      - schema:
          type: number
        in: query
        name: from
        required: true
        description: Timestamp (in seconds) used as the initial time for filtering.
      - schema:
          type: number
        in: query
        name: to
        required: true
        description: Timestamp (in seconds) used as the final time for filtering.
      - schema:
          type: string
          minLength: 1
        example: www.origin.com
        in: path
        name: origin
        required: true
        description: Origin hostname.
      - schema:
          type: string
        in: header
        name: x-photoniq-customerid
        required: true
        description: Customer unique identifier.
      responses:
        '200':
          description: Render statistics fetched successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalPrefetch:
                    type: number
                    description: The total number of prefetched requests.
                  totalCacheHits:
                    type: number
                    description: The total number of requests that were successfully served from the cache.
                  totalCacheMisses:
                    type: number
                    description: The total number of requests that were not served from the cache.
                  totalResponseSize:
                    type: number
                    description: The total size of all responses sent, measured in bytes.
                  totalOriginsRenderingFor:
                    type: number
                    description: The total number of unique origins for which rendering was performed.
                  totalRenders:
                    type: number
                    description: The total number of render operations performed.
                  totalFailed:
                    type: number
                    description: The total number of render operations that failed.
                description: Render statistics fetched successfully.
                example:
                  totalPrefetch: 75
                  totalCacheHits: 6
                  totalCacheMisses: 83
                  totalResponseSize: 30340237
                  totalOriginsRenderingFor: 3
                  totalRenders: 87
                  totalFailed: 2
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                description: Bad request.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Header x-photoniq-customerid is required.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                description: Internal server error.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Internal server error.
  /api/vwr/v1/metrics/{waitingroom_key}:
    get:
      summary: Get metrics by waiting room key
      tags:
      - Metrics
      description: Allows you to retrieve waiting room telemetry per waiting room, per minute. Gets metrics for a specific waiting room. Optionally provide _start_ and _end_ filter for a specific period. Ninety days of metrics are kept.
      operationId: getMetrics
      security:
      - APIKeyAuth: []
      parameters:
      - name: waitingroom_key
        in: path
        required: true
        description: The key of the waiting room.
        schema:
          type: string
      - name: start
        in: query
        required: false
        description: The start date and time used for querying metrics data. Must be provided in RFC3339 date-time format and be in UTC.
        schema:
          type: string
          example: YYYY-MM-DDTHH:MM:SSZ
      - name: end
        in: query
        required: false
        description: The end date and time used for querying metrics data. Must be provided in RFC3339 date-time format and be in UTC.
        schema:
          type: string
          example: YYYY-MM-DDTHH:MM:SSZ
      - name: offset
        in: query
        required: false
        description: Represents the starting point from where t

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