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

# 流式监控代理日志

> 跟踪监控代理的 CloudWatch 日志，过滤到此 monitor_id。需要 ?stream=1 或 Accept: text/event-stream。



## OpenAPI

````yaml zh/openapi/monitors.json GET /v1/monitors/{monitor_id}/agent-logs
openapi: 3.0.3
info:
  title: Monitors API
  version: 1.0.0
servers:
  - url: https://api.olostep.com
security: []
paths:
  /v1/monitors/{monitor_id}/agent-logs:
    get:
      summary: 流式监控代理日志
      description: >-
        跟踪监控影子代理的 CloudWatch 日志，过滤出提到此 `monitor_id` 的行。需要 `?stream=1` 或 `Accept:
        text/event-stream`。
      parameters:
        - name: monitor_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^monitor_
        - name: stream
          in: query
          required: true
          schema:
            type: string
            enum:
              - '1'
              - 'true'
        - name: since
          in: query
          schema:
            type: integer
          description: 以毫秒为单位的开始时间戳（默认：30 分钟前）。
      responses:
        '200':
          description: SSE 流包含 `ready`、`log`、`heartbeat` 和 `error` 事件。
          content:
            text/event-stream:
              schema:
                type: string
        '400':
          description: 无效的 monitor_id 或缺少 stream 参数。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 无效的 API 密钥。
        '404':
          description: 未找到监控。
        '500':
          description: 内部服务器错误。
      security:
        - Authorization: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        monitor_id:
          type: string
          description: 在某些创建/更新错误响应中出现。
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: Bearer身份验证头的格式为Bearer <token>，其中<token>是你的认证令牌。

````