Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .changeset/busy-clowns-deny.md

This file was deleted.

11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,34 @@ Prometheus ๋ฉ”ํŠธ๋ฆญ ์ˆ˜์ง‘ ๋ฐ ๋‚ด๋ณด๋‚ด๊ธฐ๋ฅผ ์œ„ํ•œ TypeScript ๋ผ์ด๋ธŒ๋Ÿฌ
์ด ๋ชจ๋…ธ๋ ˆํฌ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ํŒจํ‚ค์ง€๋“ค๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค:

### ๐Ÿ“ฆ [@naverpay/prometheus-core](./packages/core)

ํ•ต์‹ฌ Prometheus ์œ ํ‹ธ๋ฆฌํ‹ฐ ๋ฐ PM2 ํ†ตํ•ฉ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•˜๋Š” ๊ธฐ๋ณธ ํŒจํ‚ค์ง€์ž…๋‹ˆ๋‹ค.

**์ฃผ์š” ๊ธฐ๋Šฅ:**

- Prometheus ํžˆ์Šคํ† ๊ทธ๋žจ ๋ฐ ๊ฒŒ์ด์ง€ ๋ฉ”ํŠธ๋ฆญ ๋“ฑ๋ก
- PM2 ํ”„๋กœ์„ธ์Šค ๊ฐ„ ๋ฉ”ํŠธ๋ฆญ ์ˆ˜์ง‘ ๋ฐ ์ง‘๊ณ„
- Next.js ๋ผ์šฐํŠธ ์ •๊ทœํ™”
- HTTP ์ƒํƒœ ์ฝ”๋“œ ๊ทธ๋ฃนํ™”
- ๊ธฐ๋ณธ Node.js ๋ฉ”ํŠธ๋ฆญ ์ˆ˜์ง‘

### ๐Ÿ“ฆ [@naverpay/prometheus-koa](./packages/koa)

Koa.js ํ”„๋ ˆ์ž„์›Œํฌ์šฉ Prometheus ๋ฏธ๋“ค์›จ์–ด ๋ฐ ๋ผ์šฐํ„ฐ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

**์ฃผ์š” ๊ธฐ๋Šฅ:**

- HTTP ์š”์ฒญ ๋ฉ”ํŠธ๋ฆญ ์ˆ˜์ง‘ ๋ฏธ๋“ค์›จ์–ด
- ๋ฉ”ํŠธ๋ฆญ ์—”๋“œํฌ์ธํŠธ ๋ผ์šฐํ„ฐ
- API ํŠธ๋ ˆ์ด์‹ฑ ๋ฏธ๋“ค์›จ์–ด
- ์š”์ฒญ ๊ฒฝ๋กœ ์ •๊ทœํ™” ์ง€์›

### ๐Ÿ“ฆ [@naverpay/prometheus-next](./packages/next)

Next.js ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์šฉ ํ†ตํ•ฉ ์„œ๋ฒ„ ์†”๋ฃจ์…˜์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

**์ฃผ์š” ๊ธฐ๋Šฅ:**

- ๋ฉ”ํŠธ๋ฆญ ์ˆ˜์ง‘์ด ํ†ตํ•ฉ๋œ Next.js ์„œ๋ฒ„
- ์ž๋™ ๋ผ์šฐํŠธ ํŒจํ„ด ๋งค์นญ
- PM2 ํด๋Ÿฌ์Šคํ„ฐ ํ™˜๊ฒฝ ์ง€์›
Expand Down Expand Up @@ -89,21 +95,25 @@ server.listen(3000)
๊ฐ ํŒจํ‚ค์ง€๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ฉ”ํŠธ๋ฆญ์„ ์ˆ˜์ง‘ํ•ฉ๋‹ˆ๋‹ค:

### HTTP ์š”์ฒญ ๋ฉ”ํŠธ๋ฆญ

- **๋ฉ”ํŠธ๋ฆญ๋ช…**: `http_request_duration_seconds`
- **ํƒ€์ž…**: Histogram
- **๋ผ๋ฒจ**: `status_code`, `method`, `path`

### API ์š”์ฒญ ๋ฉ”ํŠธ๋ฆญ (Koa API ํŠธ๋ ˆ์ด์‹ฑ)

- **๋ฉ”ํŠธ๋ฆญ๋ช…**: `http_api_request_duration_seconds`
- **ํƒ€์ž…**: Histogram
- **๋ผ๋ฒจ**: `path`, `status`, `method`

### ์„œ๋น„์Šค ์ƒํƒœ ๋ฉ”ํŠธ๋ฆญ

- **๋ฉ”ํŠธ๋ฆญ๋ช…**: `up`
- **ํƒ€์ž…**: Gauge
- **์„ค๋ช…**: ์„œ๋น„์Šค ๊ฐ€์šฉ์„ฑ (1 = ์‹คํ–‰ ์ค‘, 0 = ์ค‘๋‹จ)

### ๊ธฐ๋ณธ Node.js ๋ฉ”ํŠธ๋ฆญ

- CPU ์‚ฌ์šฉ๋ฅ 
- ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰
- ์ด๋ฒคํŠธ ๋ฃจํ”„ ์ง€์—ฐ
Expand Down Expand Up @@ -273,4 +283,3 @@ pnpm markdownlint:fix
## ๋ผ์ด์„ ์Šค

์ด ํ…œํ”Œ๋ฆฟ์€ ๋„ค์ด๋ฒ„ ํŒŒ์ด๋‚ธ์…œ ์œ ์ €ํ”Œ๋žซํผ ์‚ฐํ•˜ ๊ณตํ†ต๊ฐœ๋ฐœTF (@NaverPayDev/frontend)์— ์˜ํ•ด ๊ด€๋ฆฌ๋˜๋ฉฐ, ํ•ด๋‹น ๋ผ์ด์„ ์Šค ์ •์ฑ…์„ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
"author": "@NaverPayDev/frontend",
"type": "module",
"scripts": {
"build": "turbo run build",
"clean": "turbo run clean && rm -rf ./node_modules && pnpm i",
"postinstall": "lefthook install",
"lint": "eslint . --cache --cache-location .cache/.eslintcache",
"lint:fix": "pnpm run lint --fix",
"markdownlint": "markdownlint '**/*.md' '#.changeset' '#**/CHANGELOG.md'",
"markdownlint:fix": "markdownlint --fix '**/*.md' '#.changeset' '#**/CHANGELOG.md'",
"prettier": "prettier --check . --cache --cache-location .cache/.prettiercache",
"prettier:fix": "prettier --write . --cache --cache-location .cache/.prettiercache",
"release": "pnpm run build && changeset publish",
"release:canary": "pnpm run build && changeset publish --no-git-tag",
"test": "turbo run test",
"typecheck": "turbo run typecheck"
},
"build": "turbo run build",
"clean": "turbo run clean && rm -rf ./node_modules && pnpm i",
"postinstall": "lefthook install",
"lint": "eslint . --cache --cache-location .cache/.eslintcache",
"lint:fix": "pnpm run lint --fix",
"markdownlint": "markdownlint '**/*.md' '#.changeset' '#**/CHANGELOG.md'",
"markdownlint:fix": "markdownlint --fix '**/*.md' '#.changeset' '#**/CHANGELOG.md'",
"prettier": "prettier --check . --cache --cache-location .cache/.prettiercache",
"prettier:fix": "prettier --write . --cache --cache-location .cache/.prettiercache",
"release": "pnpm run build && changeset publish",
"release:canary": "pnpm run build && changeset publish --no-git-tag",
"test": "turbo run test",
"typecheck": "turbo run typecheck"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": [
"prettier --write",
Expand Down
7 changes: 7 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @naverpay/prometheus-core

## 1.0.0

### Major Changes

- 557e235: prometheus exporter ํŒจํ‚ค์ง€๋ฅผ ์ถœ์‹œํ•ฉ๋‹ˆ๋‹ค.
26 changes: 25 additions & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@ npm install @naverpay/prometheus-core
## ์ฃผ์š” ๊ธฐ๋Šฅ

### ๐ŸŽฏ ๋ฉ”ํŠธ๋ฆญ ๊ด€๋ฆฌ

- **ํžˆ์Šคํ† ๊ทธ๋žจ ๋“ฑ๋ก**: HTTP ์š”์ฒญ ์ง€์†์‹œ๊ฐ„ ๋“ฑ์„ ์ธก์ •ํ•˜๋Š” ํžˆ์Šคํ† ๊ทธ๋žจ ๋ฉ”ํŠธ๋ฆญ ์ƒ์„ฑ
- **ํŠธ๋ ˆ์ด์‹ฑ**: ์š”์ฒญ ์‹œ์ž‘๋ถ€ํ„ฐ ์ข…๋ฃŒ๊นŒ์ง€์˜ ์‹œ๊ฐ„ ์ธก์ • ๋ฐ ๋ผ๋ฒจ ๊ด€๋ฆฌ
- **๊ฒŒ์ด์ง€ ๋ฉ”ํŠธ๋ฆญ**: ์„œ๋น„์Šค ์ƒํƒœ ํ‘œ์‹œ๋ฅผ ์œ„ํ•œ ์—…ํƒ€์ž„ ๊ฒŒ์ด์ง€

### ๐Ÿ”„ PM2 ํด๋Ÿฌ์Šคํ„ฐ ์ง€์›

- **ํ”„๋กœ์„ธ์Šค ๊ฐ„ ํ†ต์‹ **: PM2 message bus๋ฅผ ํ†ตํ•œ ๋ฉ”ํŠธ๋ฆญ ์ˆ˜์ง‘
- **๋ฉ”ํŠธ๋ฆญ ์ง‘๊ณ„**: ์—ฌ๋Ÿฌ ์›Œ์ปค ํ”„๋กœ์„ธ์Šค์˜ ๋ฉ”ํŠธ๋ฆญ์„ ์ž๋™์œผ๋กœ ์ง‘๊ณ„
- **์—ฐ๊ฒฐ ๊ด€๋ฆฌ**: PM2 ์—ฐ๊ฒฐ ์ƒ์„ฑ ๋ฐ ํ•ด์ œ

### ๐Ÿ›ฃ๏ธ Next.js ํ†ตํ•ฉ

- **๋ผ์šฐํŠธ ์ •๊ทœํ™”**: Next.js ๋ผ์šฐํŠธ ๋งค๋‹ˆํŽ˜์ŠคํŠธ๋ฅผ ํ™œ์šฉํ•œ ๋™์  ๋ผ์šฐํŠธ ๊ทธ๋ฃนํ™”
- **์ •์  ํŒŒ์ผ ์ฒ˜๋ฆฌ**: Next.js ์ •์  ํŒŒ์ผ ์š”์ฒญ ๋ถ„๋ฅ˜

### ๐Ÿšฆ ์œ ํ‹ธ๋ฆฌํ‹ฐ

- **๊ฒฝ๋กœ ํ•„ํ„ฐ๋ง**: ํ—ฌ์Šค์ฒดํฌ, ๋ฉ”ํŠธ๋ฆญ ์—”๋“œํฌ์ธํŠธ ๋“ฑ ๋ถˆํ•„์š”ํ•œ ์š”์ฒญ ์ œ์™ธ
- **์ƒํƒœ ์ฝ”๋“œ ๊ทธ๋ฃนํ™”**: HTTP ์ƒํƒœ ์ฝ”๋“œ๋ฅผ ๋ฉ”ํŠธ๋ฆญ ์ˆ˜์ง‘์— ์ ํ•ฉํ•œ ํ˜•ํƒœ๋กœ ๋ณ€ํ™˜

Expand All @@ -33,6 +37,7 @@ npm install @naverpay/prometheus-core
### ๋ฉ”ํŠธ๋ฆญ ๊ด€๋ฆฌ

#### `registerHistogram(type, name, labelNames, buckets?)`

์ƒˆ๋กœ์šด ํžˆ์Šคํ† ๊ทธ๋žจ ๋ฉ”ํŠธ๋ฆญ์„ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.

```typescript
Expand All @@ -47,6 +52,7 @@ registerHistogram(
```

#### `startTraceHistogram(type, labelValues)`

ํžˆ์Šคํ† ๊ทธ๋žจ ํƒ€์ด๋จธ๋ฅผ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

```typescript
Expand All @@ -63,6 +69,7 @@ endTraceHistogram(trace, { status_code: '200' })
```

#### `registerGaugeUp(prefix?)`

์„œ๋น„์Šค ์ƒํƒœ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” up ๊ฒŒ์ด์ง€๋ฅผ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.

```typescript
Expand All @@ -74,6 +81,7 @@ registerGaugeUp('myservice_') // myservice_up ๋ฉ”ํŠธ๋ฆญ ์ƒ์„ฑ
### PM2 ์ปค๋„ฅํ„ฐ

#### `pm2Connector.connect()`

PM2 message bus์— ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.

```typescript
Expand All @@ -83,6 +91,7 @@ await pm2Connector.connect()
```

#### `pm2Connector.getMetrics()`

๋ชจ๋“  PM2 ํ”„๋กœ์„ธ์Šค์˜ ๋ฉ”ํŠธ๋ฆญ์„ ์ˆ˜์ง‘ํ•˜๊ณ  ์ง‘๊ณ„ํ•ฉ๋‹ˆ๋‹ค.

```typescript
Expand All @@ -91,6 +100,7 @@ console.log(metrics) // Prometheus ํ˜•์‹์˜ ๋ฉ”ํŠธ๋ฆญ ๋ฌธ์ž์—ด
```

#### `pm2Connector.disconnect()`

PM2 ์—ฐ๊ฒฐ์„ ํ•ด์ œํ•˜๊ณ  ๋ฉ”ํŠธ๋ฆญ ๋ ˆ์ง€์ŠคํŠธ๋ฆฌ๋ฅผ ์ดˆ๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค.

```typescript
Expand All @@ -100,6 +110,7 @@ await pm2Connector.disconnect()
### Next.js ์œ ํ‹ธ๋ฆฌํ‹ฐ

#### `getNextRoutesManifest()`

Next.js ๋ผ์šฐํŠธ ๋งค๋‹ˆํŽ˜์ŠคํŠธ ํŒŒ์ผ์„ ์ฝ์–ด ํŒŒ์‹ฑํ•ฉ๋‹ˆ๋‹ค.

```typescript
Expand All @@ -109,6 +120,7 @@ const { basePath, routes } = getNextRoutesManifest()
```

#### `createNextRoutesUrlGroup()`

Next.js URL์„ ๋ผ์šฐํŠธ ํŒจํ„ด์œผ๋กœ ์ •๊ทœํ™”ํ•˜๋Š” ํ•จ์ˆ˜๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

```typescript
Expand All @@ -122,6 +134,7 @@ console.log(normalizeUrl('/api/data.json')) // 'STATIC'
### ์œ ํ‹ธ๋ฆฌํ‹ฐ ํ•จ์ˆ˜

#### `isBypassPath(path)`

๊ฒฝ๋กœ๊ฐ€ ๋ฉ”ํŠธ๋ฆญ ์ˆ˜์ง‘์—์„œ ์ œ์™ธ๋˜์–ด์•ผ ํ•˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

```typescript
Expand All @@ -134,6 +147,7 @@ console.log(isBypassPath('/api/users')) // false
```

#### `getStatusCodeGroup(statusCode)`

HTTP ์ƒํƒœ ์ฝ”๋“œ๋ฅผ ๋ฉ”ํŠธ๋ฆญ ์ˆ˜์ง‘์šฉ์œผ๋กœ ๊ทธ๋ฃนํ™”ํ•ฉ๋‹ˆ๋‹ค.

```typescript
Expand All @@ -146,6 +160,7 @@ console.log(getStatusCodeGroup(500)) // 500
```

#### `enableCollectDefaultMetrics()`

Node.js ๊ธฐ๋ณธ ๋ฉ”ํŠธ๋ฆญ ์ˆ˜์ง‘์„ ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค.

```typescript
Expand All @@ -158,19 +173,25 @@ enableCollectDefaultMetrics()
## ์ƒ์ˆ˜

### `DEFAULT_METRICS_PATH`

๊ธฐ๋ณธ ๋ฉ”ํŠธ๋ฆญ ์—”๋“œํฌ์ธํŠธ ๊ฒฝ๋กœ์ž…๋‹ˆ๋‹ค.

```typescript
console.log(DEFAULT_METRICS_PATH) // '/metrics'
```

### `BUCKETS`

๊ธฐ๋ณธ ํžˆ์Šคํ† ๊ทธ๋žจ ๋ฒ„ํ‚ท ์„ค์ •์ž…๋‹ˆ๋‹ค.

```typescript
console.log(BUCKETS) // [0.1, 0.3, 0.95, 1.2, 3, 5, 7, 9, 10, 20, 30, 40, 50, 60, 70]
```

### `DEFAULT_METRICS_TYPE`

๊ธฐ๋ณธ ๋ฉ”ํŠธ๋ฆญ ํƒ€์ž… ์—ด๊ฑฐํ˜•์ž…๋‹ˆ๋‹ค.

```typescript
console.log(DEFAULT_METRICS_TYPE.HTTP_REQUEST) // 'http_request'
console.log(DEFAULT_METRICS_TYPE.HTTP_API_REQUEST) // 'http_api_request'
Expand Down Expand Up @@ -244,6 +265,7 @@ async function handleRequest(req, res) {
## ํƒ€์ž… ์ •์˜

### `CommonPrometheusExporterOptions`

```typescript
interface CommonPrometheusExporterOptions {
/** PM2 ํด๋Ÿฌ์Šคํ„ฐ๋ง ์ง€์› ํ™œ์„ฑํ™” ์—ฌ๋ถ€ */
Expand All @@ -258,11 +280,13 @@ interface CommonPrometheusExporterOptions {
```

### `PM2MessageHandler`

```typescript
type PM2MessageHandler<T = any, R = any> = (data: T) => Promise<R> | R
```

### `PM2GetMessageOptions`

```typescript
interface PM2GetMessageOptions {
/** ํ”„๋กœ์„ธ์Šค ํ•„ํ„ฐ ํ•จ์ˆ˜ */
Expand All @@ -282,4 +306,4 @@ interface PM2GetMessageOptions {

## ๋ผ์ด์„ผ์Šค

MIT License
MIT License
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@naverpay/prometheus-core",
"version": "0.0.0",
"version": "1.0.0",
"description": "Core utilities for Prometheus monitoring and metrics collection.",
"keywords": [
"prometheus",
Expand Down
12 changes: 12 additions & 0 deletions packages/koa/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# @naverpay/prometheus-koa

## 1.0.0

### Major Changes

- 557e235: prometheus exporter ํŒจํ‚ค์ง€๋ฅผ ์ถœ์‹œํ•ฉ๋‹ˆ๋‹ค.

### Patch Changes

- Updated dependencies [557e235]
- @naverpay/prometheus-core@1.0.0
9 changes: 8 additions & 1 deletion packages/koa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,25 @@ npm install @naverpay/prometheus-koa
## ์ฃผ์š” ๊ธฐ๋Šฅ

### ๐ŸŽฏ HTTP ๋ฉ”ํŠธ๋ฆญ ์ˆ˜์ง‘

- **์š”์ฒญ ์ง€์†์‹œ๊ฐ„**: ๋ชจ๋“  HTTP ์š”์ฒญ์˜ ์‘๋‹ต ์‹œ๊ฐ„ ์ธก์ •
- **์ž๋™ ๋ผ๋ฒจ๋ง**: ์ƒํƒœ ์ฝ”๋“œ, HTTP ๋ฉ”์„œ๋“œ, ๊ฒฝ๋กœ ์ž๋™ ์ˆ˜์ง‘
- **๊ฒฝ๋กœ ์ •๊ทœํ™”**: ๋™์  ๋ผ์šฐํŠธ๋ฅผ ํŒจํ„ด์œผ๋กœ ๊ทธ๋ฃนํ™”

### ๐Ÿšฆ ์Šค๋งˆํŠธ ํ•„ํ„ฐ๋ง

- **์ž๋™ ๋ฐ”์ดํŒจ์Šค**: ํ—ฌ์Šค์ฒดํฌ, ๋ฉ”ํŠธ๋ฆญ ์—”๋“œํฌ์ธํŠธ ๋“ฑ ์ž๋™ ์ œ์™ธ
- **์ปค์Šคํ…€ ํ•„ํ„ฐ**: ์‚ฌ์šฉ์ž ์ •์˜ ๋ฐ”์ดํŒจ์Šค ๋กœ์ง ์ง€์›
- **Next.js ์ง€์›**: Next.js ์ •์  ํŒŒ์ผ ๋ฐ ๋ผ์šฐํŠธ ์ž๋™ ์ฒ˜๋ฆฌ

### ๐Ÿ“Š API ํŠธ๋ ˆ์ด์‹ฑ

- **์ „์šฉ API ๋ฉ”ํŠธ๋ฆญ**: API ์—”๋“œํฌ์ธํŠธ ์ „์šฉ ์„ธ๋ฐ€ํ•œ ๋ชจ๋‹ˆํ„ฐ๋ง
- **์ปค์Šคํ…€ ์ƒํƒœ ์ฒ˜๋ฆฌ**: ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง ๊ธฐ๋ฐ˜ ์ƒํƒœ ๋ถ„๋ฅ˜
- **404 ํ•ธ๋“ค๋ง**: API ๋ฏธ๋งค์นญ ์š”์ฒญ ์ž๋™ ์ฒ˜๋ฆฌ

### ๐Ÿ”ง ์œ ์—ฐํ•œ ์„ค์ •

- **๊ฒฝ๋กœ ์ •๊ทœํ™”**: ์ปค์Šคํ…€ ๊ฒฝ๋กœ ๊ทธ๋ฃนํ™” ํ•จ์ˆ˜
- **์ƒํƒœ ์ฝ”๋“œ ํฌ๋งทํŒ…**: ์‚ฌ์šฉ์ž ์ •์˜ ์ƒํƒœ ๋ถ„๋ฅ˜
- **PM2 ํ†ตํ•ฉ**: ํด๋Ÿฌ์Šคํ„ฐ ํ™˜๊ฒฝ์—์„œ ๋ฉ”ํŠธ๋ฆญ ์ง‘๊ณ„
Expand Down Expand Up @@ -280,6 +284,7 @@ apiRouter.all('(.*)', endApiTrace)
๋ชจ๋“  HTTP ์š”์ฒญ์˜ ์‘๋‹ต ์‹œ๊ฐ„์„ ํžˆ์Šคํ† ๊ทธ๋žจ์œผ๋กœ ์ˆ˜์ง‘ํ•ฉ๋‹ˆ๋‹ค.

**๋ผ๋ฒจ:**

- `status_code`: HTTP ์ƒํƒœ ์ฝ”๋“œ (๊ทธ๋ฃนํ™”๋จ)
- `method`: HTTP ๋ฉ”์„œ๋“œ (GET, POST, etc.)
- `path`: ์ •๊ทœํ™”๋œ ์š”์ฒญ ๊ฒฝ๋กœ
Expand All @@ -289,13 +294,15 @@ apiRouter.all('(.*)', endApiTrace)
API ํŠธ๋ ˆ์ด์‹ฑ ๋ฏธ๋“ค์›จ์–ด๊ฐ€ ํ™œ์„ฑํ™”๋œ ๊ฒฝ์šฐ ์ˆ˜์ง‘๋ฉ๋‹ˆ๋‹ค.

**๋ผ๋ฒจ:**

- `path`: ์ •๊ทœํ™”๋œ API ๊ฒฝ๋กœ
- `status`: ์‘๋‹ต ์ƒํƒœ
- `method`: HTTP ๋ฉ”์„œ๋“œ

### ์„œ๋น„์Šค ์ƒํƒœ ๋ฉ”ํŠธ๋ฆญ (`up`)

์„œ๋น„์Šค ๊ฐ€์šฉ์„ฑ์„ ๋‚˜ํƒ€๋‚ด๋Š” ๊ฒŒ์ด์ง€ ๋ฉ”ํŠธ๋ฆญ์ž…๋‹ˆ๋‹ค.

- `1`: ์„œ๋น„์Šค ์‹คํ–‰ ์ค‘
- `0`: ์„œ๋น„์Šค ์ค‘๋‹จ

Expand Down Expand Up @@ -401,4 +408,4 @@ app.use(metricsRouter.routes()) // ๋งˆ์ง€๋ง‰์— ์ถ”๊ฐ€

## ๋ผ์ด์„ผ์Šค

MIT License
MIT License
3 changes: 1 addition & 2 deletions packages/koa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@naverpay/prometheus-koa",
"version": "0.0.0",
"version": "1.0.0",
"description": "Koa middleware for Prometheus metrics integration.",
"keywords": [
"koa",
Expand Down Expand Up @@ -53,5 +53,4 @@
"@koa/router": ">=14.0.0"
},
"packageManager": "pnpm@10.6.5"

}
12 changes: 12 additions & 0 deletions packages/next/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# @naverpay/prometheus-next

## 1.0.0

### Major Changes

- 557e235: prometheus exporter ํŒจํ‚ค์ง€๋ฅผ ์ถœ์‹œํ•ฉ๋‹ˆ๋‹ค.

### Patch Changes

- Updated dependencies [557e235]
- @naverpay/prometheus-core@1.0.0
Loading