Portainer icon

Portainer

Work with Portainer API data to manage Docker

Container → Get Stats

AI-generated

Overview

This node operation retrieves usage statistics for a specific Docker container managed through Portainer. It is useful for monitoring container performance metrics such as CPU, memory, and network usage. For example, a user can get real-time stats of a running container to analyze its resource consumption or troubleshoot performance issues.

Use Case Examples

  1. Monitoring resource usage of a web server container to optimize performance.
  2. Collecting container stats for logging and alerting in a DevOps workflow.

Properties

Name Meaning
Environment ID The ID of the environment/endpoint in Portainer where the container is running.
Container ID The unique identifier of the Docker container for which stats are requested.

Output

JSON

  • body - The JSON response containing the container's usage statistics such as CPU, memory, and network metrics.

Dependencies

  • Requires Portainer API access with an API key credential.

Troubleshooting

  • Ensure the Environment ID and Container ID are correct and correspond to existing resources in Portainer.
  • Check that the API key credential has sufficient permissions to access container stats.
  • If SSL issues occur, consider enabling the option to ignore SSL certificate validation in the request options.

Links

Discussion