그런데 그래프가 하루만 그려진다.
모든 준비가 끝나 예쁜 그래프를 보면서 모니터링을 잘 할 수 있을거라 생각했지만...
1. 하루 살이.
위 그림과 같이 이틀 동안의 그래프를 보도록 설정하고 데이터는 이미 충분히 오랫동안
수집하고 있는 상태지만 다음 그림과 같이 보인다.
2. storage-schemas.conf.
파일 이름과 같이 whisper database를 위한 schema를 정의하는 파일입니다.
파일을 열어보면 앞 부분에 친절하게 적혀 있듯이 위에서부터 순서대로 적용되게 되어
있어 파일 제일 뒤에 내용을 추가하면 적용되지 않습니다.
이유는 [default_1min_for_1day] 항목에서 모두 만족하기 때문에 그 다음 항목이 적용
대상인지 확인할 필요가 없기 때문입니다.
어쨌든, 그럼 우리가 필요한 schema를 정의해 보도록 합니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# Schema definitions for Whisper files. Entries are scanned in order,
# and first match wins. This file is scanned for changes every 60 seconds.
# [name]
# pattern = regex
# retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ...
# Carbon's internal metrics. This entry should match what is specified in
# CARBON_METRIC_PREFIX and CARBON_METRIC_INTERVAL settings
[carbon]
pattern = ^carbon\.
retentions = 60:90d
[sample]
pattern = ^sample\.
retentions = 60s:1d,5m:7d,30m:1y
[default_1min_for_1day]
pattern = .*
retentions = 60s:1d
|
cs |
그리고 graphite container를 재시작 해보지만 역시나 하루만 보이게 됩니다.
3. 해결 방법.
Whisper database는 rrd와 마찬가지로 최초 schema에 맞춰 database를 생성하고 그 상태
그대로 유지합니다. 일반적으로는 whisper database file을 삭제하고 재시작 하게 되면
schema 변경에 맞춰 적용되겠지만 고맙게도 whisper-resize(.py) 라는 도구를
지원합니다.
http://github.com/graphite-project/whisper
위 사이트를 방문해서 whisper-resize에 대한 설명을 확인해 보면 다음과 같이 되어
있습니다.
Usage: whisper-resize.py path timePerPoint:timeToStore [timePerPoint:timeToStore]*
timePerPoint and timeToStore specify lengths of time, for example:
60:1440 60 seconds per datapoint, 1440 datapoints = 1 day of retention
15m:8 15 minutes per datapoint, 8 datapoints = 2 hours of retention
1h:7d 1 hour per datapoint, 7 days of retention
12h:2y 12 hours per datapoint, 2 years of retention
Options:
-h, --help show this help message and exit
--xFilesFactor=XFILESFACTOR
Change the xFilesFactor
--aggregationMethod=AGGREGATIONMETHOD
Change the aggregation function (average, sum, last,
max, min)
--force Perform a destructive change
--newfile=NEWFILE Create a new database file without removing the
existing one
--nobackup Delete the .bak file after successful execution
--aggregate Try to aggregate the values to fit the new archive
better. Note that this will make things slower and use
more memory.
그럼 이제 graphite container에 접속해서 whisper database 수정을 해보자.
1 | whisper-resize ./5032.wsp 60s:1d 5m:7d 30m:1y | cs |
이제 다음 그림과 같이 그래프의 왼쪽 영역에도 나오기 시작한다.
댓글 없음:
댓글 쓰기