bundles/nginx: add anonymous timing logging for http requests
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
72d4826dbb
commit
db83b1614b
7 changed files with 216 additions and 0 deletions
|
@ -181,3 +181,29 @@ def firewall(metadata):
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'telegraf/input_plugins/tail',
|
||||
)
|
||||
def telegraf_anon_timing(metadata):
|
||||
result = {}
|
||||
|
||||
for vhost in metadata.get('nginx/vhosts', {}):
|
||||
result[f'nginx-{vhost}'] = {
|
||||
'files': [f'/var/log/nginx-timing/{vhost}.log'],
|
||||
'from_beginning': False,
|
||||
'grok_patterns': ['%{LOGPATTERN}'],
|
||||
'grok_custom_patterns': 'LOGPATTERN \[%{HTTPDATE:ts:ts-httpd}\] %{NUMBER:request_time:float} (?:%{NUMBER:upstream_response_time:float}|-) "%{WORD:verb:tag} %{NOTSPACE:request} HTTP/%{NUMBER:http_version:float}" %{NUMBER:resp_code:tag}',
|
||||
'data_format': 'grok',
|
||||
'name_override': 'nginx_timing',
|
||||
}
|
||||
|
||||
return {
|
||||
'telegraf': {
|
||||
'input_plugins': {
|
||||
'tail': result,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue