charts

Metric weights queries

Multi-node, multi-context, multi-instance, multi-dimension weights (metric correlations) queries. An optional limit (alias cardinality_limit) returns only the strongest entries; result_limit in the response describes the cut.

Scope contexts. Each scope.contexts entry is a literal context ID or an Agent simple pattern: * wildcards, ! negation, and several patterns in one entry separated by ,, |, tab or newline (space is not a separator). Negated entries apply to every included entry; if all entries are negated, all contexts are included.

Routing. scope (not selectors) decides which Agent answers for each node. When every entry is a literal, each (node, context) pair is routed on its own, and only nodes that have the context are queried. When any entry is a pattern, each node is routed once and all entries are sent together to its Agent, so overlapping entries (e.g. system.cpu and system.*) return each dimension once; nodes without matching contexts return no results.

Partial failures. Nodes that lack the requested contexts, or that have no instance able to answer (capabilities, retention within the window), are omitted. Nodes that fail because of a routing error are listed in dictionaries.nodes with an error status (full format only). If no request can be routed, the response is 400 ErrAllNodesFailed.

post/api/v3/spaces/{spaceID}/rooms/{roomID}/weights

Request

Path parameters

spaceIDstring uuid required

The unique identifier of the requested space.

roomIDstring uuid required

The unique identifier of the requested room.

Request body

cardinality_limitinteger

CardinalityLimit is the same cap as limit and wins when both are supplied.

limitinteger

Limit caps the response to the strongest entries: dimensions for full results, groups for grouped results. Omitted, null or zero means unlimited. Alias of cardinality_limit, which takes precedence when both are supplied. Full results spanning several nodes are cut on every node before they are merged, so their normalized weights are ranks within the merged returned dimensions rather than within the whole query.

methodstring
optionsstring[]
timeoutinteger

Example request

{
  "aggregations": {
    "metrics": [
      {
        "group_by": [
          "selected"
        ],
        "group_by_label": [
          "a_label_key"
        ]
      }
    ],
    "time": {
      "time_group": "min",
      "time_group_options": "countif",
      "time_resampling": 60
    }
  },
  "cardinality_limit": 1000,
  "limit": 1000,
  "scope": {
    "contexts": [
      "disk.space"
    ],
    "dimensions": [
      "avail",
      "used"
    ],
    "instances": [
      "disk_space./@bd498fed-8aa1-440c-a9d6-7c33db570608"
    ],
    "labels": [
      "filesystem:btrfs",
      "mount_point:/host/var/log"
    ],
    "nodes": [
      "node_id_1",
      "node_id_2"
    ]
  },
  "selectors": {
    "alerts": [
      "*"
    ],
    "contexts": [
      "*"
    ],
    "dimensions": [
      "sent",
      "received"
    ],
    "instances": [
      "instance1@machine_guid1",
      "instance2@machine_guid1",
      "instanceX@machine_guidX"
    ],
    "labels": [
      "*"
    ],
    "nodes": [
      "*"
    ]
  },
  "window": {
    "after": 1745928492,
    "baseline": {
      "after": 1745928492,
      "before": 1745929392,
      "points": 100
    },
    "before": 1745929392,
    "points": 100
  }
}

Response

OK

apiinteger
correlated_dimensionsinteger
requestinteger[]
resultinteger[]
total_dimensions_countinteger

Example response

{
  "agents": [
    {
      "claim_id": "550e8400-e29b-41d4-a716-446655440000",
      "mg": "550e8400-e29b-41d4-a716-446655440000",
      "nd": "550e8400-e29b-41d4-a716-446655440000",
      "nm": "my_node"
    }
  ],
  "dictionaries": {
    "nodes": [
      {
        "st": {
          "code": 200,
          "msg": "timed out"
        }
      }
    ]
  },
  "result_limit": {
    "limit": 1000,
    "returned": 1000,
    "total": 25000
  },
  "view": {
    "baseline": {
      "after": 1745928492,
      "before": 1745929392,
      "points": 100
    },
    "window": {
      "after": 1745928492,
      "before": 1745929392,
      "points": 100
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.