-
Notifications
You must be signed in to change notification settings - Fork 79
/
fluentd_sample.conf
170 lines (152 loc) · 3.31 KB
/
fluentd_sample.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
## Prometheus Input Plugin Configuration
# input plugin that exports metrics
<source>
@type prometheus
</source>
<source>
@type monitor_agent
</source>
<source>
@type forward
</source>
# input plugin that collects metrics from MonitorAgent
<source>
@type prometheus_monitor
<labels>
host ${hostname}
</labels>
</source>
# input plugin that collects metrics for output plugin
<source>
@type prometheus_output_monitor
<labels>
host ${hostname}
</labels>
</source>
# input plugin that collects metrics for in_tail plugin
<source>
@type prometheus_tail_monitor
<labels>
host ${hostname}
</labels>
</source>
## Nginx Access Log Configuration
<source>
@type tail
format nginx
tag nginx
path /var/log/nginx/access.log
pos_file /tmp/fluent_nginx.pos
types size:integer
</source>
<filter nginx>
@type prometheus
# You can use counter type with specifying a key,
# and increments counter by the value
<metric>
name nginx_size_counter_bytes
type counter
desc nginx bytes sent
key size
<labels>
host ${hostname}
foo bar
</labels>
</metric>
# You can use counter type without specifying a key
# This just increments counter by 1
<metric>
name nginx_record_counts
type counter
desc the number of emited records
<labels>
host ${hostname}
</labels>
</metric>
</filter>
<match nginx>
@type copy
# for MonitorAgent sample
<store>
@id test_forward
@type forward
buffer_type memory
flush_interval 1s
max_retry_wait 2s
<buffer>
# max_retry_wait 10s
flush_interval 1s
# retry_type periodic
disable_retry_limit
</buffer>
# retry_limit 3
disable_retry_limit
<server>
host 127.0.0.1
port 20000
</server>
</store>
<store>
@type stdout
</store>
</match>
## Nginx Proxy Log Configuration
<source>
@type tail
format ltsv
tag nginx_proxy
path /var/log/nginx/access_proxy.log
pos_file /tmp/fluent_nginx_proxy.pos
types size:integer,request_length:integer,bytes_sent:integer,body_bytes_sent:integer,request_time:float,upstream_response_time:float
</source>
<filter nginx_proxy>
@type prometheus
# common labels for all metrics
<labels>
host ${hostname}
method ${request_method}
status ${status}
</labels>
<metric>
name nginx_proxy_request_length_total_bytes
type counter
desc nginx proxy request length bytes
key request_length
</metric>
<metric>
name nginx_proxy_bytes_sent_total_bytes
type counter
desc nginx proxy bytes sent
key bytes_sent
</metric>
<metric>
name nginx_proxy_request_duration_total_milliseconds
type counter
desc nginx proxy request time
key request_time
</metric>
<metric>
name nginx_proxy_upstream_response_duration_total_milliseconds
type counter
desc nginx proxy upstream response time
key upstream_response_time
</metric>
<metric>
name nginx_proxy_request_duration_milliseconds
type summary
desc nginx proxy request duration summary
key request_time
</metric>
<metric>
name nginx_proxy_upstream_duration_milliseconds
type summary
desc nginx proxy upstream response duration summary
key upstream_response_time
</metric>
</filter>
<match nginx_proxy>
@type copy
<store>
@type stdout
</store>
</match>