> For the complete documentation index, see [llms.txt](https://docs.panther.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.panther.com/ko/panther/api/graphql/metrics.md).

# 지표

## 개요

Panther API는 다음 사용자 메트릭 작업을 제공합니다:

* Panther가 특정 기간 동안 수집 및/또는 처리한 바이트와 이벤트의 총 수
* 특정 기간 동안 각 심각도 유형별로 생성된 경고의 내역\\

Console의 API Playground 또는 GraphQL-over-HTTP API를 사용하여 Panther의 API를 호출할 수 있습니다. 이러한 방법에 대해 더 알아보려면 다음을 참조하세요: [Panther API](/ko/panther/api.md#step-1-choose-a-method-for-invoking-the-api).

기본 메트릭 작업에 대한 GraphQL 쿼리, 변이, 종단 간 워크플로 예시는 아래 섹션을 참조하세요.

### `totalBytesIngested` vs. `totalBytesProcessed`

해당 `totalBytesIngested` 그리고 `totalBytesProcessed` 메트릭은 비슷하게 들리지만, 다음과 같이 다릅니다:

* `totalBytesIngested`: Panther가 지난 1년 동안(현재 날짜 기준 최근 365일) 수집한 총 바이트 수입니다.
* `totalBytesProcessed`: 쿼리에서 정의한 특정 기간 내에 Panther가 수집한 총 바이트 수입니다.

## 일반적인 메트릭 작업

아래는 Panther에서 가장 일반적인 GraphQL 메트릭 작업 중 일부입니다. 이 예시는 GraphQL 클라이언트(또는 `curl`)를 사용해 Panther의 GraphQL API를 호출하기 위해 전송해야 하는 문서를 보여줍니다.

**메트릭 쿼리**

```graphql
# `GetMetrics`는 작업의 별칭입니다. 관심 없는 
# 필드/정보는 생략하고 원하는 것만 쿼리할 수 있습니다
query GetMetrics {
  metrics(input: { 
    fromDate: "2021-01-01T00:00:00Z"
    toDate: "2021-12-31T23:59:59Z"
  }) {
    alertsPerSeverity {
      label
      값
      breakdown
    }
    alertsPerRule {
      label
      값
      entityId
    }
    eventsProcessedPerLogType {
      label
      값
      breakdown
    }
    bytesProcessedPerSource {
      label
      값
      breakdown
    }
    latencyPerLogType {
      label
      값
    }
    bytesIngestedPerSource {
      label
      값
    }
    bytesQueriedPerSource {
      label
      값
      breakdown
    }
    totalAlerts
    totalBytesIngested
    totalBytesProcessed
    totalBytesQueried
    totalEventsProcessed
  }
}
```

{% hint style="info" %}
해당 `breakdown` 이 필드는 X축으로 시간을 사용하는 차트에만 유용합니다. 이 필드는 타임스탬프 -> 값의 맵을 생성하며, `값` 필드를 구성 요소로 분해한 "breakdown"을 제공합니다.
{% endhint %}

### 종단 간 예시

아래에서는 [일반적인 작업](#common-metrics-operations) 예제를 바탕으로 종단 간 사용 사례 흐름을 보여줍니다.

#### **Panther의 로그 메트릭 가져오기**

{% tabs %}
{% tab title="Python" %}

```python
# pip install gql aiohttp

from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport

transport = AIOHTTPTransport(
  url="YOUR_PANTHER_API_URL",
  headers={"X-API-Key": "YOUR_API_KEY"},
)

client = Client(transport=transport, fetch_schema_from_transport=True)

get_metrics = gql(
  """
  query GetMetrics($input: MetricsInput!)  {
    metrics(input: $input) {
      totalAlerts
      totalEventsProcessed
    }
  }
  """
)

data = client.execute(
  get_metrics,
  variable_values= {
    "input": {
      "fromDate": "2022-07-01T00:00:00Z",
      "toDate": "2022-07-31T23:59:59Z",
    }
  }
)

print(f'7월에 Panther는 {data["metrics"]["totalEventsProcessed"]}개의 이벤트를 처리하고 {data["metrics"]["totalAlerts"]}개의 경고를 생성했습니다')
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
import { GraphQLClient, gql } from "graphql-request";

const client = new GraphQLClient(
  "YOUR_PANTHER_API_URL",
  { headers: { "X-API-Key": "YOUR_API_KEY" } }
);



const getMetrics = gql`
  query GetMetrics($input: MetricsInput!)  {
    metrics(input: $input) {
      totalAlerts
      totalEventsProcessed
    }
  }
`;

(async () => {
  try {
    const data = await client.request(getMetrics, {
      input: {
        fromDate: "2022-07-01T00:00:00Z",
        toDate: "2022-07-31T23:59:59Z"
      }
    });

    console.log(
      `7월에 Panther는 ${data.metrics.totalEventsProcessed}개의 이벤트를 처리하고 ${data.metrics.totalAlerts}개의 경고를 생성했습니다.`
    );
  } catch (err) {
    console.error(err);
  }
})();

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.panther.com/ko/panther/api/graphql/metrics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
