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

# Sync Config

> Edge agents poll this endpoint to get their metric extraction config.
Returns empty response if agent is up to date.


Fetches the latest metric extraction configuration for this agent. Called periodically (every 60 seconds) to pick up configuration changes.

The response includes all active metric configurations that should be applied by the agent.


## OpenAPI

````yaml GET /api/v1/edge/agents/{agentId}/metric-config
openapi: 3.0.3
info:
  title: LogFleet API
  description: >
    LogFleet is a distributed edge observability platform for fleet management.


    ## Overview

    LogFleet collects logs from distributed edge devices, stores them locally
    with

    configurable retention, extracts metrics for cloud observability platforms,

    and provides on-demand log streaming and remote access.


    ## Authentication

    LogFleet uses two authentication methods:


    - **JWT Bearer Token**: For dashboard and user operations. Obtain via
    `/auth/login`

    - **API Key**: For edge agents. Create via `/api-keys` endpoint


    ## Rate Limits

    - General endpoints: 100 requests/minute

    - Streaming endpoints: 20 requests/minute

    - Edge/metrics endpoints: 1000 requests/minute


    ## Multi-Tenancy

    All resources are scoped to organizations. Users can only access resources

    belonging to their organization.
  version: 1.0.0
  contact:
    name: LogFleet Support
    email: support@logfleet.io
    url: https://logfleet.io
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
servers:
  - url: https://api.logfleet.io
    description: Production
  - url: http://localhost:8080
    description: Local development
security: []
tags:
  - name: Authentication
    description: User registration and authentication
  - name: Organization
    description: Organization management
  - name: Agents
    description: Edge agent management
  - name: API Keys
    description: API key management for edge agents
  - name: Dashboard
    description: Dashboard metrics and summaries
  - name: Streaming
    description: Real-time log streaming
  - name: Billing
    description: Plans, quotas, and invoices
  - name: Metric Configs
    description: Custom metric extraction configuration
  - name: Edge API
    description: Edge agent communication endpoints
paths:
  /api/v1/edge/agents/{agentId}/metric-config:
    get:
      tags:
        - Edge API
      summary: Sync metric config
      description: |
        Edge agents poll this endpoint to get their metric extraction config.
        Returns empty response if agent is up to date.
      operationId: syncAgentConfig
      parameters:
        - $ref: '#/components/parameters/AgentIdPath'
        - name: version
          in: query
          schema:
            type: integer
            minimum: 0
          description: Current config version on agent
      responses:
        '200':
          description: Config sync response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentConfigSyncResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    AgentIdPath:
      name: agentId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Agent ID (for edge API)
  schemas:
    AgentConfigSyncResponse:
      type: object
      properties:
        version:
          type: integer
        vector_config:
          type: string
          description: Generated Vector config snippet
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/MetricDefinitionResponse'
        has_update:
          type: boolean
          description: True if agent needs to update config
    MetricDefinitionResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        config_id:
          type: string
          format: uuid
        name:
          type: string
        namespace:
          type: string
        description:
          type: string
        enabled:
          type: boolean
        type:
          type: string
          enum:
            - counter
            - gauge
            - histogram
        source_field:
          type: string
        filter:
          $ref: '#/components/schemas/FilterCondition'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagDefinition'
        counter_opts:
          $ref: '#/components/schemas/CounterOptions'
        gauge_opts:
          $ref: '#/components/schemas/GaugeOptions'
        histogram_opts:
          $ref: '#/components/schemas/HistogramOptions'
        cardinality:
          $ref: '#/components/schemas/CardinalityLimits'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
        message:
          type: string
          description: Additional details
    FilterCondition:
      type: object
      properties:
        field:
          type: string
        operator:
          type: string
          enum:
            - eq
            - neq
            - contains
            - regex
            - gt
            - lt
            - gte
            - lte
        value:
          type: string
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/FilterCondition'
        logic:
          type: string
          enum:
            - and
            - or
    TagDefinition:
      type: object
      properties:
        name:
          type: string
        source:
          type: string
          enum:
            - field
            - static
            - template
        value:
          type: string
    CounterOptions:
      type: object
      properties:
        increment_by:
          type: string
          description: Field name or static value
    GaugeOptions:
      type: object
      properties:
        value_field:
          type: string
    HistogramOptions:
      type: object
      properties:
        value_field:
          type: string
        buckets:
          type: array
          items:
            type: number
    CardinalityLimits:
      type: object
      properties:
        max_tag_cardinality:
          type: integer
          default: 1000
        on_limit_exceeded:
          type: string
          enum:
            - drop
            - sample
            - aggregate
          default: drop
  responses:
    Unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for edge agents

````