Actions86
- Config Actions
- Container Actions
- Edge Group Actions
- Edge Stack Actions
- Environment Actions
- Image Actions
- Network Actions
- Node Actions
- Registry Actions
- Secret Actions
- Service Actions
- Setting Actions
- Stack Actions
- System Actions
- Team Actions
- Template Actions
- User Actions
- Volume Actions
- Webhook Actions
Container → Get Stats
AI-generatedOverview
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
- Monitoring resource usage of a web server container to optimize performance.
- 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
- Portainer API - Get Container Stats - Official Portainer API documentation for retrieving container statistics.