Uptrace · Capability

Uptrace API — Metrics

Uptrace API — Metrics. 2 operations. Lead operation: Prometheus Query Range. Self-contained Naftiko capability covering one Uptrace business surface.

Run with Naftiko UptraceMetrics

What You Can Do

GET
Prometheusqueryrange — Prometheus Query Range
/v1/api/prometheus/{projectid}
POST
Prometheusremotewrite — Prometheus Remote Write
/v1/api/v1/prometheus/write

MCP Tools

prometheus-query-range

Prometheus Query Range

read-only idempotent
prometheus-remote-write

Prometheus Remote Write

Capability Spec

uptrace-metrics.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Uptrace API — Metrics
  description: 'Uptrace API — Metrics. 2 operations. Lead operation: Prometheus Query Range. Self-contained Naftiko capability
    covering one Uptrace business surface.'
  tags:
  - Uptrace
  - Metrics
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    UPTRACE_API_KEY: UPTRACE_API_KEY
capability:
  consumes:
  - type: http
    namespace: uptrace-metrics
    baseUri: https://api.uptrace.dev
    description: Uptrace API — Metrics business capability. Self-contained, no shared references.
    resources:
    - name: api-prometheus-projectId
      path: /api/prometheus/{projectId}
      operations:
      - name: prometheusqueryrange
        method: GET
        description: Prometheus Query Range
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: projectId
          in: path
          type: string
          description: Uptrace project ID or 'default'
          required: true
        - name: query
          in: query
          type: string
          description: PromQL query expression
        - name: start
          in: query
          type: string
          description: Start timestamp (Unix or RFC3339)
        - name: end
          in: query
          type: string
          description: End timestamp (Unix or RFC3339)
        - name: step
          in: query
          type: string
          description: Query resolution step (e.g., 15s, 1m)
    - name: api-v1-prometheus-write
      path: /api/v1/prometheus/write
      operations:
      - name: prometheusremotewrite
        method: POST
        description: Prometheus Remote Write
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: bearer
      token: '{{env.UPTRACE_API_KEY}}'
  exposes:
  - type: rest
    namespace: uptrace-metrics-rest
    port: 8080
    description: REST adapter for Uptrace API — Metrics. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/api/prometheus/{projectid}
      name: api-prometheus-projectid
      description: REST surface for api-prometheus-projectId.
      operations:
      - method: GET
        name: prometheusqueryrange
        description: Prometheus Query Range
        call: uptrace-metrics.prometheusqueryrange
        with:
          projectId: rest.projectId
          query: rest.query
          start: rest.start
          end: rest.end
          step: rest.step
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v1/prometheus/write
      name: api-v1-prometheus-write
      description: REST surface for api-v1-prometheus-write.
      operations:
      - method: POST
        name: prometheusremotewrite
        description: Prometheus Remote Write
        call: uptrace-metrics.prometheusremotewrite
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: uptrace-metrics-mcp
    port: 9090
    transport: http
    description: MCP adapter for Uptrace API — Metrics. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: prometheus-query-range
      description: Prometheus Query Range
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: uptrace-metrics.prometheusqueryrange
      with:
        projectId: tools.projectId
        query: tools.query
        start: tools.start
        end: tools.end
        step: tools.step
      outputParameters:
      - type: object
        mapping: $.
    - name: prometheus-remote-write
      description: Prometheus Remote Write
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: uptrace-metrics.prometheusremotewrite
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.