Thanos · Capability

Thanos Metrics and Observability

Unified metrics and observability capability for SRE, platform engineers, and monitoring teams. Composes Thanos Query API to provide PromQL-based metric queries, long-term trend analysis, alert monitoring, and store health inspection across distributed Prometheus deployments.

Run with Naftiko ThanosObservabilityMetricsPrometheusSREMonitoringPromQL

What You Can Do

GET
Instant query — Execute an instant PromQL query for current metric values
/v1/query
GET
Range query — Execute a PromQL range query for historical metric data
/v1/query-range
GET
Get series — Find time series matching label selectors
/v1/series
GET
Get labels — Get all available metric label names
/v1/labels
GET
Get alerts — Get all currently active alerts
/v1/alerts
GET
Get rules — Get alerting and recording rules
/v1/rules
GET
Get stores — Get connected Thanos store information and health
/v1/stores

MCP Tools

instant-query

Execute an instant PromQL query to get current metric values from Thanos

read-only idempotent
range-query

Execute a PromQL range query to analyze metric trends over time in Thanos

read-only idempotent
find-series

Find time series in Thanos matching label selectors for service discovery

read-only idempotent
list-labels

List all available metric label names across Thanos stores

read-only idempotent
get-active-alerts

Get all currently firing and pending alerts from Thanos

read-only idempotent
get-rules

Get alerting and recording rules configured in Thanos Ruler

read-only idempotent
inspect-stores

Inspect connected Thanos store endpoints, health status, and data time ranges

read-only idempotent

APIs Used

thanos-query

Capability Spec

metrics-observability.yaml Raw ↑
naftiko: "1.0.0-alpha1"

info:
  label: "Thanos Metrics and Observability"
  description: >-
    Unified metrics and observability capability for SRE, platform engineers,
    and monitoring teams. Composes Thanos Query API to provide PromQL-based
    metric queries, long-term trend analysis, alert monitoring, and store
    health inspection across distributed Prometheus deployments.
  tags:
    - Thanos
    - Observability
    - Metrics
    - Prometheus
    - SRE
    - Monitoring
    - PromQL
  created: "2026-05-03"
  modified: "2026-05-03"

capability:
  consumes:
    - import: thanos-query
      location: ./shared/thanos-query.yaml

  exposes:
    - type: rest
      port: 8080
      namespace: thanos-observability-api
      description: "Unified REST API for Thanos metrics and observability."
      resources:
        - path: /v1/query
          name: instant-query
          description: "Instant PromQL metric queries"
          operations:
            - method: GET
              name: instant-query
              description: "Execute an instant PromQL query for current metric values"
              call: "thanos-query.instant-query"
              with:
                query: "rest.query"
                time: "rest.time"
                dedup: "rest.dedup"
                partial_response: "rest.partial_response"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/query-range
          name: range-query
          description: "Range PromQL metric queries over time"
          operations:
            - method: GET
              name: range-query
              description: "Execute a PromQL range query for historical metric data"
              call: "thanos-query.range-query"
              with:
                query: "rest.query"
                start: "rest.start"
                end: "rest.end"
                step: "rest.step"
                dedup: "rest.dedup"
                max_source_resolution: "rest.max_source_resolution"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/series
          name: series
          description: "Time series discovery"
          operations:
            - method: GET
              name: get-series
              description: "Find time series matching label selectors"
              call: "thanos-query.get-series"
              with:
                "match[]": "rest.matchers"
                start: "rest.start"
                end: "rest.end"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/labels
          name: labels
          description: "Label name discovery"
          operations:
            - method: GET
              name: get-labels
              description: "Get all available metric label names"
              call: "thanos-query.get-labels"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/alerts
          name: alerts
          description: "Active alert monitoring"
          operations:
            - method: GET
              name: get-alerts
              description: "Get all currently active alerts"
              call: "thanos-query.get-alerts"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/rules
          name: rules
          description: "Alerting and recording rules"
          operations:
            - method: GET
              name: get-rules
              description: "Get alerting and recording rules"
              call: "thanos-query.get-rules"
              with:
                type: "rest.type"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/stores
          name: stores
          description: "Store endpoint health"
          operations:
            - method: GET
              name: get-stores
              description: "Get connected Thanos store information and health"
              call: "thanos-query.get-stores"
              outputParameters:
                - type: object
                  mapping: "$."

    - type: mcp
      port: 9090
      namespace: thanos-observability-mcp
      transport: http
      description: "MCP server for AI-assisted Thanos metrics analysis and observability."
      tools:
        - name: instant-query
          description: "Execute an instant PromQL query to get current metric values from Thanos"
          hints:
            readOnly: true
            openWorld: false
            idempotent: true
          call: "thanos-query.instant-query"
          with:
            query: "tools.query"
            time: "tools.time"
            dedup: "tools.dedup"
          outputParameters:
            - type: object
              mapping: "$."

        - name: range-query
          description: "Execute a PromQL range query to analyze metric trends over time in Thanos"
          hints:
            readOnly: true
            openWorld: false
            idempotent: true
          call: "thanos-query.range-query"
          with:
            query: "tools.query"
            start: "tools.start"
            end: "tools.end"
            step: "tools.step"
            dedup: "tools.dedup"
            max_source_resolution: "tools.max_source_resolution"
          outputParameters:
            - type: object
              mapping: "$."

        - name: find-series
          description: "Find time series in Thanos matching label selectors for service discovery"
          hints:
            readOnly: true
            openWorld: false
            idempotent: true
          call: "thanos-query.get-series"
          with:
            "match[]": "tools.matchers"
            start: "tools.start"
            end: "tools.end"
          outputParameters:
            - type: object
              mapping: "$."

        - name: list-labels
          description: "List all available metric label names across Thanos stores"
          hints:
            readOnly: true
            openWorld: true
            idempotent: true
          call: "thanos-query.get-labels"
          outputParameters:
            - type: object
              mapping: "$."

        - name: get-active-alerts
          description: "Get all currently firing and pending alerts from Thanos"
          hints:
            readOnly: true
            openWorld: false
            idempotent: true
          call: "thanos-query.get-alerts"
          outputParameters:
            - type: object
              mapping: "$."

        - name: get-rules
          description: "Get alerting and recording rules configured in Thanos Ruler"
          hints:
            readOnly: true
            openWorld: false
            idempotent: true
          call: "thanos-query.get-rules"
          with:
            type: "tools.type"
          outputParameters:
            - type: object
              mapping: "$."

        - name: inspect-stores
          description: "Inspect connected Thanos store endpoints, health status, and data time ranges"
          hints:
            readOnly: true
            openWorld: false
            idempotent: true
          call: "thanos-query.get-stores"
          outputParameters:
            - type: object
              mapping: "$."