-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] Added promeheus-exporter capabilities & nginx cache cusomisatio…
…n capabilities
- Loading branch information
Hadrien Huvelle
committed
Jun 29, 2023
1 parent
e5a1c34
commit becf8b3
Showing
7 changed files
with
122 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[template] | ||
|
||
# The name of the template that will be used to render the application's configuration file | ||
# Confd will look in `/etc/conf.d/templates` for these files by default | ||
src = "logrotate.conf.tmpl" | ||
|
||
# The location to place the rendered configuration file | ||
dest = "/etc/logrotate.conf" | ||
|
||
# File ownership and mode information | ||
owner = "root" | ||
mode = "0644" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[template] | ||
|
||
# The name of the template that will be used to render the application's configuration file | ||
# Confd will look in `/etc/conf.d/templates` for these files by default | ||
src = "config.hcl.tmpl" | ||
|
||
# The location to place the rendered configuration file | ||
dest = "/etc/prometheus-nginxlog-exporter.hcl" | ||
|
||
# File ownership and mode information | ||
owner = "root" | ||
mode = "0644" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
listen { | ||
port = 4040 | ||
|
||
// "metrics_endpoint" can be used to configure an alternative metrics URL | ||
// path. Default value is "/metrics". | ||
// | ||
// metrics_endpoint = "/metrics" | ||
} | ||
|
||
namespace "nginx" { | ||
source = { | ||
files = [ | ||
"/var/log/nginx/access_prometheus.log", | ||
] | ||
} | ||
|
||
format = "$remote_addr - $remote_user [$time_local] \"$request\" \"$request_id\" $status \"$upstream_cache_status\" $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\" rt=$request_time uct=\"$upstream_connect_time\" uht=\"$upstream_header_time\" urt=\"$upstream_response_time\"" | ||
|
||
labels { | ||
app = "odoo" | ||
website = "ocms" | ||
} | ||
|
||
relabel "request_method" { | ||
from = "request" | ||
split = 1 | ||
} | ||
relabel "request_url" { | ||
from = "request" | ||
split = 2 | ||
} | ||
|
||
relabel "request_url_formated" { | ||
from = "request" | ||
split = 2 | ||
|
||
match "/web/assets/.*" { | ||
replacement = "/web/assets" | ||
} | ||
|
||
match "([^?]+).*" { | ||
replacement = "$1" | ||
} | ||
} | ||
|
||
|
||
relabel "remote_addr" { | ||
from = "remote_addr" | ||
} | ||
|
||
relabel "cache" { | ||
from = "upstream_cache_status" | ||
} | ||
|
||
relabel "remote_user" { | ||
from = "remote_user" | ||
} | ||
|
||
|
||
histogram_buckets = [.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10] | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/var/log/nginx/access_prometheus.log { | ||
copytruncate | ||
nocompress | ||
rotate 5 | ||
size 10M | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters