> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-55d9d317.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# الاستعلام عن بيانات سلاسل المخطط

> يجلب بيانات السلاسل الزمنية استنادًا إلى معلمات السلسلة المُعدّة



## OpenAPI

````yaml /ar/_specs/hyperdx-openapi.json post /api/v2/charts/series
openapi: 3.0.0
info:
  description: واجهة API لإدارة تنبيهات HyperDX ولوحات المعلومات
  title: HyperDX External API
  version: 2.0.0
servers:
  - description: خادم API لبيئة production
    url: https://api.hyperdx.io
  - description: الخادم الحالي
    url: /
security:
  - BearerAuth: []
tags:
  - description: Endpoints لإدارة لوحات المعلومات وvisualizations الخاصة بها
    name: Dashboards
  - description: Endpoints لإدارة تنبيهات المراقبة
    name: Alerts
paths:
  /api/v2/charts/series:
    post:
      tags:
        - Charts
      summary: الاستعلام عن بيانات سلاسل المخطط
      description: يجلب بيانات السلاسل الزمنية استنادًا إلى معلمات السلسلة المُعدّة
      operationId: queryChartSeries
      requestBody:
        content:
          application/json:
            examples:
              basicTimeSeries:
                summary: استعلام أساسي عن السلاسل الزمنية
                value:
                  endTime: 1647100800000
                  granularity: 1h
                  series:
                    - aggFn: count
                      groupBy: []
                      sourceId: 65f5e4a3b9e77c001a123456
                      where: SeverityText:error
                  startTime: 1647014400000
              metricSeries:
                summary: سلسلة بيانات المقياس
                value:
                  endTime: 1647100800000
                  granularity: 5m
                  series:
                    - aggFn: avg
                      groupBy: []
                      metricDataType: gauge
                      metricName: http_requests_total
                      sourceId: 65f5e4a3b9e77c001a789012
                      where: service:api
                  startTime: 1647014400000
              multiSeriesWithGroupBy:
                summary: سلاسل متعددة مع Group By
                value:
                  endTime: 1647100800000
                  granularity: 15m
                  series:
                    - aggFn: count
                      groupBy:
                        - service
                      sourceId: 65f5e4a3b9e77c001a123456
                      where: SeverityText:error
                    - aggFn: avg
                      field: duration
                      groupBy:
                        - service
                      sourceId: 65f5e4a3b9e77c001a123456
                      where: SeverityText:error
                  startTime: 1647014400000
              multiSourceSeries:
                summary: سلاسل من مصادر متعددة
                value:
                  endTime: 1647100800000
                  granularity: 5m
                  series:
                    - aggFn: count
                      groupBy: []
                      sourceId: 65f5e4a3b9e77c001a123456
                      where: SeverityText:error
                    - aggFn: avg
                      groupBy: []
                      metricDataType: gauge
                      metricName: http_requests_total
                      sourceId: 65f5e4a3b9e77c001a789012
                      where: service:api
                  startTime: 1647014400000
            schema:
              $ref: '#/components/schemas/SeriesQueryRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                groupedTimeSeriesData:
                  summary: بيانات سلاسل زمنية مُجمَّعة
                  value:
                    data:
                      - group:
                          - api
                        series_0.data: 15
                        ts_bucket: 1647014400000
                      - group:
                          - frontend
                        series_0.data: 8
                        ts_bucket: 1647014400000
                      - group:
                          - api
                        series_0.data: 22
                        ts_bucket: 1647018000000
                timeSeriesData:
                  summary: نقاط بيانات السلاسل الزمنية
                  value:
                    data:
                      - series_0.data: 42
                        ts_bucket: 1647014400000
                      - series_0.data: 37
                        ts_bucket: 1647018000000
                      - series_0.data: 53
                        ts_bucket: 1647021600000
              schema:
                $ref: '#/components/schemas/SeriesResponse'
          description: تم جلب بيانات السلاسل الزمنية بنجاح
        '400':
          content:
            application/json:
              examples:
                invalidParams:
                  value:
                    error: All series must have the same groupBy fields
                invalidTimestamp:
                  value:
                    error: Timestamp must be in milliseconds
              schema:
                properties:
                  error:
                    type: string
                type: object
          description: معلمات الطلب غير صالحة
        '403':
          content:
            application/json:
              example:
                error: Team context missing
              schema:
                properties:
                  error:
                    type: string
                type: object
          description: غير مصرح به
        '404':
          content:
            application/json:
              example:
                error: Source not found
              schema:
                properties:
                  error:
                    type: string
                type: object
          description: لم يتم العثور على المصدر
        '500':
          content:
            application/json:
              example:
                error: Internal server error
              schema:
                properties:
                  error:
                    type: string
                type: object
          description: خطأ في الخادم
components:
  schemas:
    SeriesQueryRequest:
      properties:
        endTime:
          description: الطابع الزمني للنهاية بالمللي ثانية
          example: 1647100800000
          type: number
        granularity:
          description: حجم الفاصل الزمني لعمليات التجميع
          enum:
            - 30s
            - 1m
            - 5m
            - 10m
            - 15m
            - 30m
            - 1h
            - 2h
            - 6h
            - 12h
            - 1d
            - 2d
            - 7d
            - 30d
            - auto
          example: 1h
          type: string
        series:
          description: مصفوفة لإعدادات السلاسل
          items:
            $ref: '#/components/schemas/ChartSeries'
          maxItems: 5
          minItems: 1
          type: array
        seriesReturnType:
          description: تنسيق البيانات المُعادة
          enum:
            - ratio
            - column
          example: column
          type: string
        startTime:
          description: الطابع الزمني للبداية بالمللي ثانية
          example: 1647014400000
          type: number
      required:
        - series
        - startTime
        - endTime
      type: object
    SeriesResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/SeriesDataPoint'
          type: array
      type: object
    ChartSeries:
      properties:
        aggFn:
          description: دالة التجميع المطلوب استخدامها على البيانات
          enum:
            - avg
            - count
            - count_distinct
            - last_value
            - max
            - min
            - quantile
            - sum
          example: count
          type: string
        dataSource:
          enum:
            - events
            - metrics
          example: events
          type: string
        field:
          description: الحقل المطلوب تجميعه
          example: duration
          type: string
        groupBy:
          description: الحقول المطلوب تجميع النتائج بحسبها
          example:
            - service
            - host
          items:
            type: string
          type: array
        metricDataType:
          description: نوع بيانات المقياس
          enum:
            - sum
            - gauge
            - histogram
          example: gauge
          type: string
        metricName:
          description: اسم المقياس (لمصادر بيانات المقاييس)
          example: http_requests_total
          type: string
        sourceId:
          description: معرّف مصدر البيانات لهذه السلسلة
          example: 65f5e4a3b9e77c001a123456
          type: string
        type:
          enum:
            - time
            - table
            - number
            - histogram
            - search
            - markdown
          example: time
          type: string
        where:
          description: شرط التصفية بصياغة استعلام Lucene
          example: level:error
          type: string
        whereLanguage:
          description: لغة الاستعلام المستخدمة في عبارة WHERE
          enum:
            - lucene
            - sql
          example: lucene
          type: string
      required:
        - sourceId
        - aggFn
        - where
        - groupBy
      type: object
    SeriesDataPoint:
      properties:
        group:
          description: قيم Group By إذا تم تحديد groupBy
          example:
            - api
            - prod-host-1
          items:
            type: string
          type: array
        series_0.data:
          description: القيمة الخاصة بالسلسلة الأولى
          example: 42
          type: number
        series_1.data:
          description: القيمة الخاصة بالسلسلة الثانية
          example: 18
          type: number
        ts_bucket:
          description: الطابع الزمني لنقطة البيانات (وقت بداية الفاصل)
          example: 1647014400000
          type: number
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: API Key
      scheme: bearer
      type: http

````