netapp.storagegrid.na_sg_grid_metrics module – NetApp StorageGRID grab metrics.

Note

This module is part of the netapp.storagegrid collection (version 21.16.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install netapp.storagegrid.

To use it in a playbook, specify: netapp.storagegrid.na_sg_grid_metrics.

New in netapp.storagegrid 21.16.0

Synopsis

  • Get metrics on NetApp StorageGRID.

Parameters

Parameter

Comments

api_url

string / required

The url to the StorageGRID Admin Node REST API.

auth_token

string / required

The authorization token for the API request

end_time

string

End time for the query range.

query

string / required

Prometheus query string to execute.

step

string

Step width/interval duration for the query range.

time

aliases: start_time

string

Evaluation time for the query. If not provided, default current time(date-time) is used.

Use it as start_time for query over range of time.

timeout

string

Timeout duration for the query execution.

validate_certs

boolean

Should https certificates be validated?

Choices:

  • false

  • true ← (default)

Notes

Note

  • The modules prefixed with na_sg are built to manage NetApp StorageGRID.

Examples

- name: Query metrics
  netapp.storagegrid.na_sg_grid_metrics:
    api_url: "https://<storagegrid-endpoint-url>"
    auth_token: "storagegrid-auth-token"
    validate_certs: false
    query: storagegrid_storage_utilization_usable_space_bytes
    time: 2025-08-01T00:00:00.000Z
    timeout: 30s
  register: sg_metric

- name: Query metrics over range of time
  netapp.storagegrid.na_sg_grid_metrics:
    api_url: "https://<storagegrid-endpoint-url>"
    auth_token: "storagegrid-auth-token"
    validate_certs: false
    query: storagegrid_storage_utilization_usable_space_bytes{site_name="site1"}
    start_time: 2025-08-27T10:10:58.668Z
    end_time: 2025-08-27T10:11:59.668Z
    step: 60s
    timeout: 30s
  register: sg_metric

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

sg_metric

dictionary

Returns information about the StorageGRID metrics.

Returned: always

Sample: {"query": {"result": [{"metric": {"__name__": "storagegrid_storage_utilization_usable_space_bytes", "instance": "sg-sn-01", "job": "ldr", "node_id": "658a91d7-d6f4-4d8e-a8ba-e15e6408b604", "service": "ldr", "site_id": "99d94acc-b2d4-4e4e-86e5-b715af68b40b", "site_name": "site1"}, "value": [1756195871.224, "29456490549248"]}], "resultType": "vector"}}

Authors

  • NetApp Ansible Team (@vinaykus)