Skip to content

stats-exporter() editorial #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: stats-exporter() source options
id: adm-src--stats-exporter-opt
description: >-
The stats-exporter() sources directly can serve the output of syslog-ng-ctl stats and syslog-ng-ctl query to a HTTP Scraper. Unlike the stats-exporter-dont-log() that suppresses log messages from incoming scraper requests, the stats-exporter() logs the unparsed messages, storing incoming scraper HTTP requests in the MSG field.
The stats-exporter() sources directly can serve the output of syslog-ng-ctl stats and syslog-ng-ctl query to an HTTP Scraper. Unlike the stats-exporter-dont-log() that suppresses log messages from incoming scraper requests, the stats-exporter() logs the unparsed messages, storing incoming scraper HTTP requests in the MSG field.
---

Technically, both sources are specialized versions of the network() source. See the network() source options for details.
Technically, both sources are specialized versions of the network() source. For more options and details, see the network() source options.

>**NOTE:** A destination is not required for this source to work; the `stats-exporter()` sources will respond to the scraper regardless of whether a destination is present in the log path.
>**NOTE:** A destination is not required for this source to work; the stats-exporter() sources will respond to the scraper regardless of whether a destination is present in the log path.
{: .notice--info}

These drivers have the following additional options:
Expand All @@ -17,43 +17,43 @@ These drivers have the following additional options:
|Accepted values:| query \| stats |
|Default: | stats |

*Description:* The stat type you wish to provide in the response to a HTTP Scraper request, just like for the syslog-ng-ctl command line tool.
*Description:* This option sets the desired stat type to be produced in response to an HTTP Scraper request. This method operates like the syslog-ng-ctl command line tool.

## stat-query()

|Accepted values:| regular expression |
|Default: | |

*Description:* The query regex string that can be used to filter the output of a `query` type request.
*Description:* This option sets the query regex string which can be used to filter the output of a query type request.

## stat-format()

|Accepted values:| csv \| kv \| prometheus |
|Default: | prometheus |

*Description:* Specifies the format of the statistics output in HTTP responses, similar to the options available in syslog-ng-ctl. The available formats are:
*Description:* This option specifies the format of the statistics output in HTTP responses, similar to the options available in syslog-ng-ctl. The available formats are the following:

- csv – comma-separated values format
- kv – key-value pairs, one per line
- prometheus – Prometheus-compatible exposition format
- `csv` – comma-separated values format
- `kv` – key-value pairs, one per line
- `prometheus` – Prometheus-compatible exposition format

## scrape-pattern()

|Accepted values:| regular expression |
|Default: | GET /metrics* |
|Default: | `GET /metrics*` |

*Description:* The pattern used to match the HTTP header of incoming scraping requests. A stat response will be generated and sent only if the header matches the scrape-pattern().
*Description:* This option sets the pattern used to match the HTTP header of incoming scraping requests. A stat response will be generated and sent only if the header matches the one set in the `scrape-pattern()` option.

## scrape-freq-limit()

|Accepted values:| number |
|Default: | 0 |
|Default: | `0` |

*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.
*Description:* This option limits the frequency of repeated scraper requests to the specified number of seconds. Any repeated request within this period will be ignored. A set value of `0` means no limit.

## single-instance()

|Accepted values:| yes \| no |
|Default: | no |

*Description:* If set to `yes` only one scraper connection and request will be allowed at once.
*Description:* If this option is set to `yes`, only one scraper connection and request will be allowed at once.
4 changes: 2 additions & 2 deletions doc/_admin-guide/060_Sources/153_stats_exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ log {
};
```

Example usage for a generic HTTP Scraper which sends e.g. the `GET /stats HTTP/1.1` HTTP request to get statistics of {{ site.product.short_name }}, do not want to log or further process the HTTP requests in the log pipe, and needs the response in CSV format:
Example usage for a generic HTTP Scraper which sends the `GET /stats HTTP/1.1` HTTP request to get statistics of a {{ site.product.short_name }} system, which is not required to log or further process the HTTP requests in the log pipe, and needs the response in CSV format:

``` config
@version: 4.9
Expand All @@ -53,5 +53,5 @@ log {
};
```

>**NOTE:** A destination is not required for this to work; the `stats-exporter()` sources will respond to the scraper regardless of whether a destination is present in the log path.
>**NOTE:** A destination is not required for this to work. The stats-exporter() sources will respond to the scraper regardless of whether a destination is present in the log path or not.
{: .notice--info}