Skip to content

Commit ab724a5

Browse files
committed
prometheus_stats: added its details
Signed-off-by: Hofi <hofione@gmail.com>
1 parent 2268e87 commit ab724a5

File tree

6 files changed

+85
-2
lines changed

6 files changed

+85
-2
lines changed

_data/external_links.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,11 @@ postgresql:
11071107
url: https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG
11081108
title: [ "PostgreSQL" ]
11091109

1110+
prometheus-scraper:
1111+
id: prometheus-scraper
1112+
url: https://prometheus.io/docs/prometheus/latest/getting_started/#configure-prometheus-to-monitor-the-sample-targets
1113+
title: [ "/[Pp]rometheus [Ss]craper/" ]
1114+
11101115
qbittorrent:
11111116
id: qbittorrent
11121117
url: https://www.qbittorrent.org/

_data/link_aliases.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ adm-about-glossary#bsd-syslog-protocol:
9999
adm-about-glossary#ietf-syslog-protocol:
100100
aliases: [ "IETF-syslog protocol", "IETF-syslog" ]
101101

102+
adm-src-prometheus-stats:
103+
aliases: [ "prometheus-stats-dont-log()" ]
104+
102105
adm-src-wild:
103106
aliases: [ "/wildcard-file(?:\\(\\))? source[s]?/" ]
104107

_data/navigation.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ admin-guide-nav:
236236
subnav:
237237
- title: "program() source options"
238238
url: /admin-guide/060_Sources/130_Program/000_Program_source_options
239+
- title: "prometheus-stats"
240+
url: /admin-guide/060_Sources/135_Prometheus/README
241+
subnav:
242+
- title: "prometheus-stats() source options"
243+
url: /admin-guide/060_Sources/135_Prometheus/000_prometheus-stats_source_options
239244
- title: "python"
240245
url: /admin-guide/060_Sources/140_Python/README
241246
subnav:
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: prometheus-stats() source options
3+
id: adm-src-prometheus-stats-opt
4+
description: >-
5+
The prometheus-stats() sources directly can serve the output of syslog-ng-ctl stats and syslog-ng-ctl query to a Prometheus Scraper. Unlike the prometheus-stats-dont-log() that suppresses log messages from incoming scraper requests, the prometheus-stats() logs the unparsed messages, storing incoming scraper HTTP requests in the MSG field.
6+
---
7+
8+
Technically, both sources are specialized versions of the network() source. See the network() source options for details.
9+
10+
These drivers have the following additional options:
11+
12+
## stat-type()
13+
14+
|Accepted values:| query \| stats |
15+
|Default: | stats |
16+
17+
*Description:* The stat type you wish to provide in the response to a Prometheus Scraper request, just like for the syslog-ng-ctl command line tool.
18+
19+
## stat-query()
20+
21+
|Accepted values:| regular expression |
22+
|Default: | |
23+
24+
*Description:* The query regex string that can be used to filter the output of a `query` type request.
25+
26+
## scrape-freq-limit()
27+
28+
|Accepted values:| number |
29+
|Default: | 0 |
30+
31+
*Description:* Limits the frequency of repeated scraper requests to the specified number of seconds. Any repeated request within this period will be ignored. A value of 0 means no limit.
32+
33+
## single-instance()
34+
35+
|Accepted values:| yes \| no |
36+
|Default: | no |
37+
38+
*Description:* If set to `yes` only one scraper connection and request will be allowed at once.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: 'prometheus-stats: Providing various statistics information to a Prometheus Scraper'
3+
short_title: prometheus-stats
4+
id: adm-src-prometheus-stats
5+
description: >-
6+
The prometheus-stats() and prometheus-stats-dont-log() sources can directly serve the output of
7+
syslog-ng-ctl stats and syslog-ng-ctl query to a Prometheus Scraper.
8+
---
9+
10+
Example usage:
11+
12+
``` config
13+
@version: 4.9
14+
@include "scl.conf"
15+
16+
source s_prometheus_stat {
17+
prometheus-stats-dont-log(
18+
ip("0.0.0.0")
19+
port(8080)
20+
stat-type("query")
21+
stat-query("*")
22+
scrape-freq-limit(30)
23+
single-instance(yes)
24+
);
25+
};
26+
27+
log {
28+
source(s_prometheus_stat);
29+
};
30+
```
31+
32+
>**NOTE:** A destination is not required for this to work; the `prometheus-stats()` sources will respond to the scraper regardless of whether a destination is present in the log path.
33+
{: .notice--info}

doc/_admin-guide/150_Statistics_of_syslog-ng/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ description: >-
1212

1313
## Recommended: Structured, selective methods
1414

15-
- Using the syslog-ng-ctl
16-
query command.
15+
- Using the syslog-ng-ctl query command.
1716

1817
For further information about using syslog-ng-ctl commands, see
1918
The {{ site.product.short_name }} manual pages.

0 commit comments

Comments
 (0)