---
name: collecting-infrastructure-metrics
description: Collect comprehensive infrastructure performance metrics across compute, storage, network, containers, load balancers, and databases. Use when monitoring system performance or troubleshooting infrastructure issues. Trigger with phrases like "collect infrastructure metrics", "monitor server performance", or "track system resources".
version: 1.20.0
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(metrics:*), Bash(monitoring:*), Bash(system:*)
license: MIT
author: Jeremy Longshore <jeremy@intentsolutions.io>
tags:
  - performance
  - database
  - monitoring
compatibility: Designed for Claude Code
title: collecting-infrastructure-metrics
canonical_url: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/collecting-infrastructure-metrics
last_updated: 2026-10-07T06:06:28.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [assets/README.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/collecting-infrastructure-metrics/assets/README.md), [references/README.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/collecting-infrastructure-metrics/references/README.md), [scripts/README.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/collecting-infrastructure-metrics/scripts/README.md).
>
> If the user asked to install this Skill, run `npx skilld install jeremylongshore/tons-of-skills-marketplace/collecting-infrastructure-metrics`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/collecting-infrastructure-metrics`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/jeremylongshore/tons-of-skills-marketplace/collecting-infrastructure-metrics) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/collecting-infrastructure-metrics`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/collecting-infrastructure-metrics --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/collecting-infrastructure-metrics --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Infrastructure Metrics Collector

Collect and centralize infrastructure metrics across compute, storage, network, containers, load balancers, and databases using Prometheus, Datadog, or CloudWatch.

## Overview

This skill automates the process of setting up infrastructure metrics collection. It identifies key performance indicators (KPIs) across various infrastructure layers, configures agents to collect these metrics, and assists in setting up central aggregation and visualization.

## How It Works

1. **Identify Infrastructure Layers**: Determines the infrastructure layers to monitor (compute, storage, network, containers, load balancers, databases).
2. **Configure Metrics Collection**: Sets up agents (Prometheus, Datadog, CloudWatch) to collect metrics from the identified layers.
3. **Aggregate Metrics**: Configures central aggregation of the collected metrics for analysis and visualization.
4. **Create Dashboards**: Generates infrastructure dashboards for health monitoring, performance analysis, and capacity tracking.

## When to Use This Skill

This skill activates when you need to:

- Monitor the performance of your infrastructure.
- Identify bottlenecks in your system.
- Set up dashboards for real-time monitoring.

## Examples

### Example 1: Setting up basic monitoring

User request: "Collect infrastructure metrics for my web server."

The skill will:

1. Identify compute, storage, and network layers relevant to the web server.
2. Configure Prometheus to collect CPU, memory, disk I/O, and network bandwidth metrics.

### Example 2: Troubleshooting database performance

User request: "I'm seeing slow database queries. Can you help me monitor the database performance?"

The skill will:

1. Identify the database layer and relevant metrics such as connection pool usage, replication lag, and cache hit rates.
2. Configure Datadog to collect these metrics and create a dashboard to visualize performance trends.

## Best Practices

- **Agent Selection**: Choose the appropriate agent (Prometheus, Datadog, CloudWatch) based on your existing infrastructure and monitoring tools.
- **Metric Granularity**: Balance the granularity of metrics collection with the storage and processing overhead. Collect only the essential metrics for your use case.
- **Alerting**: Configure alerts based on thresholds for key metrics to proactively identify and address performance issues.

## Integration

This skill can be integrated with other plugins for deployment, configuration management, and alerting to provide a comprehensive infrastructure management solution. For example, it can be used with a deployment plugin to automatically configure metrics collection after deploying new infrastructure.

## Prerequisites

- Access to infrastructure monitoring systems (Prometheus, Datadog, CloudWatch)
- System permissions for metrics agent installation
- Network access to monitored infrastructure components
- Storage for metrics data in ${CLAUDE_SKILL_DIR}/metrics/

## Instructions

1. Identify infrastructure layers to monitor (compute, storage, network, databases)
2. Select appropriate metrics collection agent based on environment
3. Configure agent with target endpoints and metric types
4. Set up central aggregation for collected metrics
5. Create dashboards for visualization
6. Configure alerts for critical metrics thresholds

## Output

- Metrics collection configuration files
- Agent installation and setup scripts
- Dashboard definitions for infrastructure monitoring
- Metric export configurations
- Alert rules for critical thresholds

## Error Handling

If metrics collection fails:

- Verify agent installation and permissions
- Check network connectivity to targets
- Validate authentication credentials
- Review firewall and security group rules
- Confirm metric endpoint availability

## Resources

- Prometheus documentation for metric collection
- Datadog agent configuration guides
- AWS CloudWatch metrics reference
- Infrastructure monitoring best practices
