Skip to content
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
33 changes: 18 additions & 15 deletions pipeline/inputs/prometheus-textfile.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Prometheus Textfile
# Prometheus text file

The **prometheus_textfile** input plugin allows Fluent Bit to read metrics from Prometheus text format files (.prom files) on the local filesystem. This plugin is particularly useful for collecting custom metrics that are written to files by external applications or scripts, similar to the Prometheus Node Exporter textfile collector.
The _Prometheus text file_ input plugin allows Fluent Bit to read metrics from Prometheus text format files (`.prom` files) on the local filesystem. Use this plugin to collect custom metrics that are written to files by external applications or scripts, similar to the Prometheus Node Exporter text file collector.

## Configuration Parameters
## Configuration parameters

| Key | Description | Default |
|-----|-------------|---------|
| path | File or directory path pattern. Supports glob patterns with `*` wildcard (e.g., `/var/lib/prometheus/*.prom`) | |
| scrape_interval | Interval in seconds between file scans | 10s |
| `path` | File or directory path pattern. Supports glob patterns with `*` wildcard (for example, `/var/lib/prometheus/*.prom`). | _none_ |
| `scrape_interval` | Interval in seconds between file scans. | `10s` |

## Getting Started
## Get started

### Simple Configuration
### Basic configuration

The following configuration will monitor `/var/lib/prometheus/textfile` directory for `.prom` files every 15 seconds:

Expand All @@ -29,11 +29,11 @@ pipeline:
port: 2021
```

## Prometheus Text Format
## Prometheus text format

The plugin expects files to be in the standard Prometheus text exposition format. Here's an example of a valid `.prom` file:

```
```text
# HELP custom_counter_total A custom counter metric
# TYPE custom_counter_total counter
custom_counter_total{instance="server1",job="myapp"} 42
Expand All @@ -52,9 +52,9 @@ custom_histogram_sum 125.5
custom_histogram_count 50
```

## Use Cases
## Use cases

### Custom Application Metrics
### Custom application metrics

Applications can write custom metrics to `.prom` files, and this plugin will collect them:

Expand All @@ -66,7 +66,8 @@ echo "app_requests_total{status=\"200\"} 1500" >> /var/lib/prometheus/textfile/a
echo "app_requests_total{status=\"404\"} 23" >> /var/lib/prometheus/textfile/app.prom
```

### Batch Job Metrics
### Batch job metrics

Cron jobs or batch processes can write completion metrics:

```bash
Expand All @@ -88,12 +89,14 @@ backup_last_success_timestamp_seconds ${BACKUP_END}
EOF
```

### System Integration
### System integration

External monitoring tools can write metrics that Fluent Bit will collect and forward.

## Integration with Other Plugins
## Integration with other plugins


### OpenTelemetry Destination
### OpenTelemetry destination

```yaml
pipeline:
Expand Down
2 changes: 2 additions & 0 deletions vale-styles/FluentBit/Spelling-exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Config
Coralogix
coroutine
coroutines
cron
Crowdstrike
CRDs
DaemonSet
Expand Down Expand Up @@ -216,6 +217,7 @@ templated
temporality
Tensorflow
Terraform
textfile
Thanos
Timeshift
tolerations
Expand Down