Skip to content

Commit 4ccf56b

Browse files
committed
Adding YAML examples, formatting table, and cleaning up shell usage for Vivo Exporter output plugin doc. Part of issue #1941.
Signed-off-by: Eric D. Schabell <[email protected]>
1 parent a0bb578 commit 4ccf56b

File tree

1 file changed

+74
-25
lines changed

1 file changed

+74
-25
lines changed

pipeline/outputs/vivo-exporter.md

Lines changed: 74 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,55 @@ Vivo Exporter is an output plugin that exposes logs, metrics, and traces through
55
### Configuration Parameters
66

77
| Key | Description | Default |
8-
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | ------- |
8+
|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------|---------|
99
| `empty_stream_on_read` | If enabled, when an HTTP client consumes the data from a stream, the stream content will be removed. | Off |
1010
| `stream_queue_size` | Specify the maximum queue size per stream. Each specific stream for logs, metrics and traces can hold up to `stream_queue_size` bytes. | 20M |
1111
| `http_cors_allow_origin` | Specify the value for the HTTP Access-Control-Allow-Origin header (CORS). | |
12-
| `workers` | The number of [workers](../../administration/multithreading.md#outputs) to perform flush operations for this output. | `1` |
12+
| `workers` | The number of [workers](../../administration/multithreading.md#outputs) to perform flush operations for this output. | `1` |
1313

1414

1515
### Getting Started
1616

1717
Here is a simple configuration of Vivo Exporter, note that this example is not based on defaults.
1818

19-
```python
19+
{% tabs %}
20+
{% tab title="fluent-bit.yaml" %}
21+
22+
```yaml
23+
pipeline:
24+
inputs:
25+
- name: dummy
26+
tag: events
27+
rate: 2
28+
29+
outputs:
30+
- name: vivo_exporter
31+
match: '*'
32+
empty_stream_on_read: off
33+
stream_queue_size: 20M
34+
http_cors_allow_origin: '*'
35+
```
36+
37+
{% endtab %}
38+
{% tab title="fluent-bit.conf" %}
39+
40+
```text
2041
[INPUT]
21-
name dummy
22-
tag events
23-
rate 2
42+
name dummy
43+
tag events
44+
rate 2
2445

2546
[OUTPUT]
26-
name vivo_exporter
27-
match *
28-
empty_stream_on_read off
29-
stream_queue_size 20M
30-
http_cors_allow_origin *
47+
name vivo_exporter
48+
match *
49+
empty_stream_on_read off
50+
stream_queue_size 20M
51+
http_cors_allow_origin *
3152
```
3253

54+
{% endtab %}
55+
{% endtabs %}
56+
3357
### How it works
3458

3559
Vivo Exporter provides buffers that serve as streams for each telemetry data type, in this case, `logs`, `metrics`, and `traces`. Each buffer contains a fixed capacity in terms of size (20M by default). When the data arrives at a stream, it's appended to the end. If the buffer is full, it removes the older entries to make room for new data.
@@ -41,7 +65,7 @@ The `data` that arrives is a `chunk`. A chunk is a group of events that belongs
4165
By using a simple HTTP request, you can retrieve the data from the streams. The following are the endpoints available:
4266

4367
| endpoint | Description |
44-
| ---------- | ----------------------------------------------------------------------------------------------------------------------------- |
68+
|------------|-------------------------------------------------------------------------------------------------------------------------------|
4569
| `/logs` | Exposes log events in JSON format. Each event contains a timestamp, metadata and the event content. |
4670
| `/metrics` | Exposes metrics events in JSON format. Each metric contains name, metadata, metric type and labels (dimensions). |
4771
| `/traces` | Exposes traces events in JSON format. Each trace contains a name, resource spans, spans, attributes, events information, etc. |
@@ -50,29 +74,50 @@ The example below will generate dummy log events which will be consuming by usin
5074

5175
**Configure and start Fluent Bit**
5276

53-
```python
77+
78+
{% tabs %}
79+
{% tab title="fluent-bit.yaml" %}
80+
81+
```yaml
82+
pipeline:
83+
inputs:
84+
- name: dummy
85+
tag: events
86+
rate: 2
87+
88+
outputs:
89+
- name: vivo_exporter
90+
match: '*'
91+
```
92+
93+
{% endtab %}
94+
{% tab title="fluent-bit.conf" %}
95+
96+
```text
5497
[INPUT]
55-
name dummy
56-
tag events
57-
rate 2
98+
name dummy
99+
tag events
100+
rate 2
58101

59102
[OUTPUT]
60-
name vivo_exporter
61-
match *
62-
103+
name vivo_exporter
104+
match *
63105
```
64106

107+
{% endtab %}
108+
{% endtabs %}
109+
65110
**Retrieve the data**
66111

67-
```bash
112+
```shell
68113
curl -i http://127.0.0.1:2025/logs
69114
```
70115

71116
> We are using the `-i` curl option to print also the HTTP response headers.
72117
73118
Curl output would look like this:
74119

75-
```bash
120+
```shell
76121
HTTP/1.1 200 OK
77122
Server: Monkey/1.7.0
78123
Date: Tue, 21 Mar 2023 16:42:28 GMT
@@ -88,6 +133,7 @@ Vivo-Stream-End-ID: 3
88133
[[1679416947459806000,{"_tag":"events"}],{"message":"dummy"}]
89134
[[1679416947958777000,{"_tag":"events"}],{"message":"dummy"}]
90135
[[1679416948459391000,{"_tag":"events"}],{"message":"dummy"}]
136+
...
91137
```
92138

93139
### Streams and IDs
@@ -105,18 +151,20 @@ A client might be interested into always retrieve the latest chunks available an
105151
To query ranges or starting from specific chunks IDs, remember that they are incremental, you can use a mix of the following options:
106152

107153
| Query string option | Description |
108-
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
154+
|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
109155
| `from` | Specify the first chunk ID that is desired to be retrieved. Note that if the `chunk` ID does not exists the next one in the queue will be provided. |
110156
| `to` | The last chunk ID is desired. If not found, the whole stream will be provided (starting from `from` if was set). |
111157
| `limit` | Limit the output to a specific number of chunks. The default value is `0`, which means: send everything. |
112158

113159
The following example specifies the range from chunk ID 1 to chunk ID 3 and only 1 chunk:
114160

115-
`curl -i "http://127.0.0.1:2025/logs?from=1&to=3&limit=1"`&#x20;
161+
```shell
162+
curl -i "http://127.0.0.1:2025/logs?from=1&to=3&limit=1"`&#x20;
163+
```
116164

117165
Output:
118166

119-
```bash
167+
```shell
120168
HTTP/1.1 200 OK
121169
Server: Monkey/1.7.0
122170
Date: Tue, 21 Mar 2023 16:45:05 GMT
@@ -127,4 +175,5 @@ Vivo-Stream-End-ID: 1
127175
128176
[[1679416945959398000,{"_tag":"events"}],{"message":"dummy"}]
129177
[[1679416946459271000,{"_tag":"events"}],{"message":"dummy"}]
130-
```
178+
...
179+
```

0 commit comments

Comments
 (0)