> 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가 특정 기간 동안 수집 및/또는 처리한 바이트와 이벤트의 총 수
* 특정 기간 동안 각 Severity 유형별로 생성된 경고 내역\\

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 쿼리, 뮤테이션 및 end-to-end 워크플로 예시를 아래 섹션에서 확인하세요.

### `totalBytesIngested` 대 `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` field는 시간축을 X축으로 사용하는 차트에만 유용합니다. 이 필드는 타임스탬프 -> 값의 맵을 해당 `값` field의 구성 요소로 나눈 "breakdown" 형태로 생성합니다.
{% endhint %}

### end-to-end 예시

아래에서는 [일반적인 작업](#common-metrics-operations) 예시를 바탕으로 end-to-end 사용 사례 흐름을 보여드립니다.

#### **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="Node.js" %}

```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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
