> ## Documentation Index
> Fetch the complete documentation index at: https://docs.springwinter.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitor Performance Metrics for Your Springwinter Services

> View CPU, memory, request rate, and error metrics pulled live from AWS CloudWatch for every resource running in your own AWS account.

Springwinter reads CloudWatch metrics directly from your AWS account and displays CPU utilization, memory utilization, request rate, and error counts for each running service. The metrics dashboard gives you a real-time view of service health without requiring you to open the AWS Console or configure any additional monitoring tools.

## Available Metrics by Resource Type

Different resource types expose different CloudWatch metric dimensions. Here is what Springwinter surfaces for each.

<CardGroup cols={2}>
  <Card title="Web Servers" icon="server">
    **ECS + ALB metrics**

    * CPU utilization (%)
    * Memory utilization (%)
    * Request count
    * Error rate (4xx and 5xx responses)
  </Card>

  <Card title="Workers" icon="gear">
    **ECS metrics**

    * CPU utilization (%)
    * Memory utilization (%)
    * Running task count
  </Card>

  <Card title="Caches" icon="database">
    **ElastiCache metrics**

    * Cache hits and misses
    * Memory used (bytes)
    * Active connections
  </Card>

  <Card title="Static Websites" icon="globe">
    **CloudFront + S3 metrics**

    * Request count
    * Bytes transferred
    * Error rate
  </Card>

  <Card title="Storage" icon="box-archive">
    **S3 metrics**

    * Number of objects
    * Bucket size (bytes)
    * Request count
  </Card>
</CardGroup>

## Viewing Metrics in the Dashboard

<Steps>
  <Step title="Open the resource">
    Navigate to your project and click on the resource you want to monitor — a web server, worker, cache, static website, or storage bucket.
  </Step>

  <Step title="Select the Metrics tab">
    Click the **Metrics** tab on the resource detail page. Charts for all available dimensions load automatically.
  </Step>

  <Step title="Adjust the time range">
    Use the time range selector to zoom in on a specific window, such as the last hour, last 24 hours, or last 7 days.
  </Step>
</Steps>

## Metrics API

Fetch raw metric data programmatically for dashboards, alerting integrations, or automated runbooks.

<Tabs>
  <Tab title="Web Servers">
    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/web_servers/{id}/metrics \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>

  <Tab title="Workers">
    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/workers/{id}/metrics \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>

  <Tab title="Static Websites">
    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/static_websites/{id}/metrics \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>

  <Tab title="Caches">
    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/redis/{id}/metrics \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>

  <Tab title="Storage">
    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/storage/{id}/metrics \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>
</Tabs>

### Metrics API Reference

<AccordionGroup>
  <Accordion title="GET /api/projects/{project_id}/web_servers/{id}/metrics">
    Returns CloudWatch metrics for the specified web server, including CPU and memory utilization from ECS and request/error metrics from the Application Load Balancer.

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the web server.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the web server resource.
    </ParamField>
  </Accordion>

  <Accordion title="GET /api/projects/{project_id}/workers/{id}/metrics">
    Returns ECS CloudWatch metrics for the specified worker, including CPU utilization, memory utilization, and running task count.

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the worker.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the worker resource.
    </ParamField>
  </Accordion>

  <Accordion title="GET /api/projects/{project_id}/static_websites/{id}/metrics">
    Returns CloudFront and S3 metrics for the specified static website, including request counts and bytes transferred.

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the static website.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the static website resource.
    </ParamField>
  </Accordion>

  <Accordion title="GET /api/projects/{project_id}/redis/{id}/metrics">
    Returns ElastiCache metrics for the specified cache resource, including hit/miss rates, memory usage, and active connections.

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the cache.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the cache resource.
    </ParamField>
  </Accordion>

  <Accordion title="GET /api/projects/{project_id}/storage/{id}/metrics">
    Returns S3 metrics for the specified private storage bucket, including object count, bucket size, and request count.

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the storage bucket.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the storage resource.
    </ParamField>
  </Accordion>
</AccordionGroup>

<Note>
  Metrics are read live from CloudWatch and appear only once a resource is running and CloudWatch has begun collecting data. A newly deployed service may show no data for the first few minutes while the first metric points accumulate.
</Note>
