Skip to content

Commit 24617ae

Browse files
agup006gitbook-bot
authored andcommitted
GitBook: [#3] Modifying Log Based Metrics
1 parent 175ac3b commit 24617ae

File tree

2 files changed

+89
-5
lines changed

2 files changed

+89
-5
lines changed

SUMMARY.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,13 @@
7878

7979
* [Pipeline Monitoring](pipeline/pipeline-monitoring.md)
8080
* [Inputs](pipeline/inputs/README.md)
81+
* [Prometheus Scrape Metrics](pipeline/inputs/prometheus-scrape-metrics.md)
8182
* [Node Exporter Metrics](pipeline/inputs/node-exporter-metrics.md)
8283
* [Windows Exporter Metrics](pipeline/inputs/windows-exporter-metrics.md)
8384
* [Collectd](pipeline/inputs/collectd.md)
84-
* [CPU Metrics](pipeline/inputs/cpu-metrics.md)
85-
* [Disk I/O Metrics](pipeline/inputs/disk-io-metrics.md)
86-
* [Docker Metrics](pipeline/inputs/docker-metrics.md)
85+
* [CPU Log Based Metrics](pipeline/inputs/cpu-metrics.md)
86+
* [Disk I/O Log Based Metrics](pipeline/inputs/disk-io-metrics.md)
87+
* [Docker Log Based Metrics](pipeline/inputs/docker-metrics.md)
8788
* [Docker Events](pipeline/inputs/docker-events.md)
8889
* [Dummy](pipeline/inputs/dummy.md)
8990
* [Exec](pipeline/inputs/exec.md)
@@ -95,8 +96,8 @@
9596
* [Kernel Logs](pipeline/inputs/kernel-logs.md)
9697
* [Memory Metrics](pipeline/inputs/memory-metrics.md)
9798
* [MQTT](pipeline/inputs/mqtt.md)
98-
* [Network I/O Metrics](pipeline/inputs/network-io-metrics.md)
99-
* [Process Metrics](pipeline/inputs/process.md)
99+
* [Network I/O Log Based Metrics](pipeline/inputs/network-io-metrics.md)
100+
* [Process Log Based Metrics](pipeline/inputs/process.md)
100101
* [Random](pipeline/inputs/random.md)
101102
* [Serial Interface](pipeline/inputs/serial-interface.md)
102103
* [Standard Input](pipeline/inputs/standard-input.md)
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Prometheus Scrape Metrics
2+
3+
Fluent Bit 1.9 includes additional metrics features to allow you to collect both logs and metrics with the same collector. 
4+
5+
The initial release of the Prometheus Scrape metric allows you to collect metrics from a Prometheus-based endpoint at a set interval. These metrics can be routed to metric supported endpoints such as [Prometheus Exporter](../outputs/prometheus-exporter.md), [InfluxDB](../outputs/influxdb.md), or [Prometheus Remote Write](../outputs/prometheus-remote-write.md)
6+
7+
## Configuration <a href="#configuration" id="configuration"></a>
8+
9+
| Key | Description | Default |
10+
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
11+
| host | The host of the prometheus metric endpoint that you want to scrape | |
12+
| port | The port of the promethes metric endpoint that you want to scrape | |
13+
| scrape interval | The interval to scrape metrics | 10s |
14+
| metrics\_path | <p>The metrics URI endpoint, that must start with a forward slash.<br><br>Note: Parameters can also be added to the path by using <code>?</code></p> | /metrics |
15+
16+
## Example
17+
18+
If an endpoint exposes Prometheus Metrics we can specify the configuration to scrape and then output the metrics. In the following example, we retrieve metrics from the HashiCorp Vault application.
19+
20+
```
21+
[INPUT]
22+
name prometheus_scrape
23+
host 0.0.0.0
24+
port 8201
25+
tag vault
26+
metrics_path /v1/sys/metrics?format=prometheus
27+
scrape_interval 10s
28+
29+
[OUTPUT]
30+
name stdout
31+
match *
32+
33+
```
34+
35+
**Example Output**
36+
37+
```
38+
2022-03-26T23:01:29.836663788Z go_memstats_alloc_bytes_total = 31891336
39+
2022-03-26T23:01:29.836663788Z go_memstats_frees_total = 313264
40+
2022-03-26T23:01:29.836663788Z go_memstats_lookups_total = 0
41+
2022-03-26T23:01:29.836663788Z go_memstats_mallocs_total = 378992
42+
2022-03-26T23:01:29.836663788Z process_cpu_seconds_total = 1.6200000000000001
43+
2022-03-26T23:01:29.836663788Z go_goroutines = 19
44+
2022-03-26T23:01:29.836663788Z go_info{version="go1.17.7"} = 1
45+
2022-03-26T23:01:29.836663788Z go_memstats_alloc_bytes = 12547800
46+
2022-03-26T23:01:29.836663788Z go_memstats_buck_hash_sys_bytes = 1468900
47+
2022-03-26T23:01:29.836663788Z go_memstats_gc_cpu_fraction = 8.1509688352783453e-06
48+
2022-03-26T23:01:29.836663788Z go_memstats_gc_sys_bytes = 5875576
49+
2022-03-26T23:01:29.836663788Z go_memstats_heap_alloc_bytes = 12547800
50+
2022-03-26T23:01:29.836663788Z go_memstats_heap_idle_bytes = 2220032
51+
2022-03-26T23:01:29.836663788Z go_memstats_heap_inuse_bytes = 14000128
52+
2022-03-26T23:01:29.836663788Z go_memstats_heap_objects = 65728
53+
2022-03-26T23:01:29.836663788Z go_memstats_heap_released_bytes = 2187264
54+
2022-03-26T23:01:29.836663788Z go_memstats_heap_sys_bytes = 16220160
55+
2022-03-26T23:01:29.836663788Z go_memstats_last_gc_time_seconds = 1648335593.2483871
56+
2022-03-26T23:01:29.836663788Z go_memstats_mcache_inuse_bytes = 2400
57+
2022-03-26T23:01:29.836663788Z go_memstats_mcache_sys_bytes = 16384
58+
2022-03-26T23:01:29.836663788Z go_memstats_mspan_inuse_bytes = 150280
59+
2022-03-26T23:01:29.836663788Z go_memstats_mspan_sys_bytes = 163840
60+
2022-03-26T23:01:29.836663788Z go_memstats_next_gc_bytes = 16586496
61+
2022-03-26T23:01:29.836663788Z go_memstats_other_sys_bytes = 422572
62+
2022-03-26T23:01:29.836663788Z go_memstats_stack_inuse_bytes = 557056
63+
2022-03-26T23:01:29.836663788Z go_memstats_stack_sys_bytes = 557056
64+
2022-03-26T23:01:29.836663788Z go_memstats_sys_bytes = 24724488
65+
2022-03-26T23:01:29.836663788Z go_threads = 8
66+
2022-03-26T23:01:29.836663788Z process_max_fds = 65536
67+
2022-03-26T23:01:29.836663788Z process_open_fds = 12
68+
2022-03-26T23:01:29.836663788Z process_resident_memory_bytes = 200638464
69+
2022-03-26T23:01:29.836663788Z process_start_time_seconds = 1648333791.45
70+
2022-03-26T23:01:29.836663788Z process_virtual_memory_bytes = 865849344
71+
2022-03-26T23:01:29.836663788Z process_virtual_memory_max_bytes = 1.8446744073709552e+19
72+
2022-03-26T23:01:29.836663788Z vault_runtime_alloc_bytes = 12482136
73+
2022-03-26T23:01:29.836663788Z vault_runtime_free_count = 313256
74+
2022-03-26T23:01:29.836663788Z vault_runtime_heap_objects = 65465
75+
2022-03-26T23:01:29.836663788Z vault_runtime_malloc_count = 378721
76+
2022-03-26T23:01:29.836663788Z vault_runtime_num_goroutines = 12
77+
2022-03-26T23:01:29.836663788Z vault_runtime_sys_bytes = 24724488
78+
2022-03-26T23:01:29.836663788Z vault_runtime_total_gc_pause_ns = 1917611
79+
2022-03-26T23:01:29.836663788Z vault_runtime_total_gc_runs = 19
80+
```
81+
82+
83+

0 commit comments

Comments
 (0)