Skip to content

Commit

Permalink
add patterns for squid logs
Browse files Browse the repository at this point in the history
  • Loading branch information
psycofdj committed Jul 21, 2022
1 parent e036007 commit fe7a154
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
23 changes: 23 additions & 0 deletions manifests/operations/loghost-exporter-enable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,29 @@
<<: *labels
ips: "{{.ips}}"
username: "{{.username}}"
- name: loghost_squid_tunnel_queries
type: counter
help: number of tunnel queries handled by squid proxy
match: "squid\\[rs2\\] %{DATA} %{IP:ip} %{DATA}/%{NUMBER:status} %{NUMBER} CONNECT %{DATA:domain} %{DATA:user} %{DATA}/"
scope: local
labels:
<<: *labels
ip: "{{.ip}}"
domain: "{{.domain}}"
user: "{{.user}}"
status: "{{.status}}"
- name: loghost_squid_http_queries
type: counter
help: number of http queries handled by squid proxy
match: "squid\\[rs2\\] %{DATA} %{IP:ip} %{DATA}/%{NUMBER:status} %{NUMBER} %{DATA:method} %{DATA:scheme}://%{URIHOST:domain}%{DATA} %{DATA:user} %{DATA}/"
scope: local
labels:
<<: *labels
ip: "{{.ip}}"
scheme: "{{.scheme}}"
domain: "{{.domain}}"
user: "{{.user}}"
status: "{{.status}}"
local-directors:
- ((director_name))
remote-directors: []
Expand Down
16 changes: 16 additions & 0 deletions manifests/operations/prometheus/loghost-enable-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@
sum(loghost_diego_ssh_success offset 5m or loghost_diego_ssh_success{} * 0) by (director, deployment, group, user, username)
) >= 0
- record: loghost_squid_tunnel_failure_last_5m
expr: |
(
sum(loghost_squid_tunnel_queries{status=~"4.*"} or loghost_squid_tunnel_queries{status=~"4.*"} * 0) by (director, deployment, group, ip, status)
-
sum(loghost_squid_tunnel_queries{status=~"4.*"} offset 5m or loghost_squid_tunnel_queries{status=~"4.*"} * 0) by (director, deployment, group, ip, status)
) >= 0
- record: loghost_squid_http_failure_last_5m
expr: |
(
sum(loghost_squid_http_queries{status=~"4.*"} or loghost_squid_http_queries{status=~"4.*"} * 0) by (director, deployment, group, ip, status)
-
sum(loghost_squid_http_queries{status=~"4.*"} offset 5m or loghost_squid_http_queries{status=~"4.*"} * 0) by (director, deployment, group, ip, status)
) >= 0
- type: replace
path: /instance_groups/name=grafana/jobs/name=loghost_dashboards/properties/loghost_dashboards/security/enabled
value: true
Expand Down

0 comments on commit fe7a154

Please sign in to comment.