Monitoring Your Container Deployments with HCS
HostSpace's HCS provides a comprehensive UI for managing and monitoring your containerized applications without needing to use the command line. Here’s how you can set up and use monitoring features via the HCS UI:
Step-by-Step Guide for Monitoring Deployments on HCS
Access the Metrics Section
Log in to your HCS account.
Navigate to your dashboard and select the project/deployment you want to monitor.
Go to the "Metrics" section within your selected deployment.
Enable Monitoring
Ensure that monitoring is enabled for your deployment. This might involve toggling a switch or setting up monitoring configurations provided by HCS.
Set Up Monitoring Tools
Using Grafana and Prometheus
Grafana Configuration:
Install Grafana: Ensure Grafana is installed and running.
Add Prometheus as a Data Source:
Open Grafana, navigate to Configuration > Data Sources.
Click on "Add data source" and select "Prometheus."
Enter the URL of your Prometheus server, e.g.,
http://prometheus-server:9090
.Save and test the data source to ensure connectivity.
Create Dashboards:
Go to Dashboards > New Dashboard.
Add panels to the dashboard to visualize key metrics like CPU usage, memory usage, disk I/O, and application-specific metrics.
Customize the panels to show real-time data and set appropriate time ranges for better visibility.
Prometheus Configuration:
Set Up Prometheus:
Ensure Prometheus is installed and configured to scrape metrics from your deployment.
Add HCS endpoints to Prometheus' scrape configuration, typically in the
prometheus.yml
file.Example configuration:
Define Alerting Rules:
Create alerting rules in the
prometheus.yml
file to trigger alerts based on specific metric thresholds.Example alerting rule:
Configure Metrics Collection
Use HCS built-in metrics exporters or deploy additional exporters to collect necessary metrics from your deployment.
Ensure that metrics such as CPU usage, memory usage, disk I/O, and network traffic are being collected.
Set Up Alerts
Grafana Alerting:
Navigate to Alerting > Notification Channels in Grafana.
Add a new notification channel, specifying your preferred method (email, Slack, etc.).
Create alert rules within your dashboards and link them to the notification channel.
Prometheus Alerting:
Configure alert manager in Prometheus to handle alert notifications.
Example configuration:
Visualize Metrics
In Grafana, customize your dashboards to provide a comprehensive view of your deployment’s health.
Organize panels by different aspects of your deployments, such as resource utilization, application performance, and service health.
Advanced Operations
Resource Operations
Access the "Resource Operations" section in HCS to manage operations like scaling, restarting, or stopping the deployment as needed.
Scheduled Tasks
Set up scheduled tasks in the "Scheduled Tasks" section for automated operations and maintenance activities.
Webhooks
Configure webhooks in the "Webhooks" section to trigger actions or notifications based on deployment events.
Last updated