Skip to content

Commit 2a9ec0a

Browse files
committed
Adding YAML examples and fixing table layouts for OpenTelemetry output plugin doc. Part of isssue #1926.
Signed-off-by: Eric D. Schabell <[email protected]>
1 parent d4bd2aa commit 2a9ec0a

File tree

1 file changed

+84
-30
lines changed

1 file changed

+84
-30
lines changed

pipeline/outputs/opentelemetry.md

Lines changed: 84 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,93 @@ The OpenTelemetry plugin allows you to take logs, metrics, and traces from Fluen
88

99
Important Note: At the moment only HTTP endpoints are supported.
1010

11-
| Key | Description | Default |
12-
| -------------------- | ------------------------------------------------------------ | --------- |
13-
| host | IP address or hostname of the target HTTP Server | 127.0.0.1 |
14-
| http_user | Basic Auth Username | |
15-
| http_passwd | Basic Auth Password. Requires HTTP_user to be set | |
16-
| port | TCP port of the target HTTP Server | 80 |
17-
| proxy | Specify an HTTP Proxy. The expected format of this value is `http://HOST:PORT`. Note that HTTPS is **not** currently supported. It is recommended not to set this and to configure the [HTTP proxy environment variables](https://docs.fluentbit.io/manual/administration/http-proxy) instead as they support both HTTP and HTTPS. | |
18-
| http2 | Defines whether HTTP/2 protocol is enabled. This setting also supports the `force` option, which forces HTTP/2 over a plaintext connection. | On |
19-
| grpc | Enables gRPC over an HTTP/2 connection. This setting applies to HTTP/2 only. | off |
20-
| metrics_uri | Specify an optional HTTP URI for the target web server listening for metrics, e.g: /v1/metrics | / |
21-
| logs_uri | Specify an optional HTTP URI for the target web server listening for logs, e.g: /v1/logs | / |
22-
| traces_uri | Specify an optional HTTP URI for the target web server listening for traces, e.g: /v1/traces | / |
23-
| header | Add a HTTP header key/value pair. Multiple headers can be set. | |
24-
| log_response_payload | Log the response payload within the Fluent Bit log | false |
25-
| logs_body_key | The log body key to look up in the log events body/message. Sets the Body field of the opentelemtry logs data model. | message |
26-
| logs_trace_id_message_key | The trace id key to look up in the log events body/message. Sets the TraceId field of the opentelemtry logs data model. | traceId |
27-
| logs_span_id_message_key | The span id key to look up in the log events body/message. Sets the SpanId field of the opentelemtry logs data model. | spanId |
28-
| logs_severity_text_message_key | The severity text id key to look up in the log events body/message. Sets the SeverityText field of the opentelemtry logs data model. | severityText |
29-
| logs_severity_number_message_key | The severity number id key to look up in the log events body/message. Sets the SeverityNumber field of the opentelemtry logs data model. | severityNumber |
30-
| add_label | This allows you to add custom labels to all metrics exposed through the OpenTelemetry exporter. You may have multiple of these fields | |
31-
| compress | Set payload compression mechanism. Option available is 'gzip' | |
32-
| logs_observed_timestamp_metadata_key | Specify an ObservedTimestamp key to look up in the metadata. | $ObservedKey |
33-
| logs_timestamp_metadata_key |Specify a Timestamp key to look up in the metadata. | $Timestamp |
34-
| logs_severity_key_metadata_key |Specify a SeverityText key to look up in the metadata.| $SeverityText |
35-
| logs_severity_number_metadata_key | Specify a SeverityNumber key to look up in the metadata.| $SeverityNumber |
36-
| logs_trace_flags_metadata_key |Specify a Flags key to look up in the metadata.| $Flags |
37-
| logs_span_id_metadata_key |Specify a SpanId key to look up in the metadata.| $SpanId |
38-
| logs_trace_id_metadata_key |Specify a TraceId key to look up in the metadata.| $TraceId |
39-
| logs_attributes_metadata_key |Specify an Attributes key to look up in the metadata.| $Attributes |
40-
| workers | The number of [workers](../../administration/multithreading.md#outputs) to perform flush operations for this output. | `0` |
11+
| Key | Description | Default |
12+
|--------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|
13+
| host | IP address or hostname of the target HTTP Server | 127.0.0.1 |
14+
| http_user | Basic Auth Username | |
15+
| http_passwd | Basic Auth Password. Requires HTTP_user to be set | |
16+
| port | TCP port of the target HTTP Server | 80 |
17+
| proxy | Specify an HTTP Proxy. The expected format of this value is `http://HOST:PORT`. Note that HTTPS is **not** currently supported. It is recommended not to set this and to configure the [HTTP proxy environment variables](https://docs.fluentbit.io/manual/administration/http-proxy) instead as they support both HTTP and HTTPS. | |
18+
| http2 | Defines whether HTTP/2 protocol is enabled. This setting also supports the `force` option, which forces HTTP/2 over a plaintext connection. | On |
19+
| grpc | Enables gRPC over an HTTP/2 connection. This setting applies to HTTP/2 only. | off |
20+
| metrics_uri | Specify an optional HTTP URI for the target web server listening for metrics, e.g: /v1/metrics | / |
21+
| logs_uri | Specify an optional HTTP URI for the target web server listening for logs, e.g: /v1/logs | / |
22+
| traces_uri | Specify an optional HTTP URI for the target web server listening for traces, e.g: /v1/traces | / |
23+
| header | Add a HTTP header key/value pair. Multiple headers can be set. | |
24+
| log_response_payload | Log the response payload within the Fluent Bit log | false |
25+
| logs_body_key | The log body key to look up in the log events body/message. Sets the Body field of the opentelemtry logs data model. | message |
26+
| logs_trace_id_message_key | The trace id key to look up in the log events body/message. Sets the TraceId field of the opentelemtry logs data model. | traceId |
27+
| logs_span_id_message_key | The span id key to look up in the log events body/message. Sets the SpanId field of the opentelemtry logs data model. | spanId |
28+
| logs_severity_text_message_key | The severity text id key to look up in the log events body/message. Sets the SeverityText field of the opentelemtry logs data model. | severityText |
29+
| logs_severity_number_message_key | The severity number id key to look up in the log events body/message. Sets the SeverityNumber field of the opentelemtry logs data model. | severityNumber |
30+
| add_label | This allows you to add custom labels to all metrics exposed through the OpenTelemetry exporter. You may have multiple of these fields | |
31+
| compress | Set payload compression mechanism. Option available is 'gzip' | |
32+
| logs_observed_timestamp_metadata_key | Specify an ObservedTimestamp key to look up in the metadata. | $ObservedKey |
33+
| logs_timestamp_metadata_key | Specify a Timestamp key to look up in the metadata. | $Timestamp |
34+
| logs_severity_key_metadata_key | Specify a SeverityText key to look up in the metadata. | $SeverityText |
35+
| logs_severity_number_metadata_key | Specify a SeverityNumber key to look up in the metadata. | $SeverityNumber |
36+
| logs_trace_flags_metadata_key | Specify a Flags key to look up in the metadata. | $Flags |
37+
| logs_span_id_metadata_key | Specify a SpanId key to look up in the metadata. | $SpanId |
38+
| logs_trace_id_metadata_key | Specify a TraceId key to look up in the metadata. | $TraceId |
39+
| logs_attributes_metadata_key | Specify an Attributes key to look up in the metadata. | $Attributes |
40+
| workers | The number of [workers](../../administration/multithreading.md#outputs) to perform flush operations for this output. | `0` |
4141

4242
## Getting Started
4343

4444
The OpenTelemetry plugin works with logs and only the metrics collected from one of the metric input plugins. In the following example, log records generated by the dummy plugin and the host metrics collected by the node exporter metrics plugin are exported by the OpenTelemetry output plugin.
4545

46+
{% tabs %}
47+
{% tab title="fluent-bit.yaml" %}
48+
49+
```yaml
50+
# Dummy Logs & traces with Node Exporter Metrics export using OpenTelemetry output plugin
51+
# -------------------------------------------
52+
# The following example collects host metrics on Linux and dummy logs & traces and delivers
53+
# them through the OpenTelemetry plugin to a local collector :
54+
#
55+
service:
56+
flush: 1
57+
log_level: info
58+
59+
pipeline:
60+
inputs:
61+
- name: node_exporter_metrics
62+
tag: node_metrics
63+
scrape_interval: 2
64+
65+
- name: dummy
66+
tag: dummy.log
67+
rate: 3
68+
69+
- name: event_type
70+
type: traces
71+
72+
outputs:
73+
- name: opentelemetry
74+
match: '*'
75+
host: localhost
76+
port: 443
77+
metrics_uri: /v1/metrics
78+
logs_uri: /v1/logs
79+
traces_uri: /v1/traces
80+
log_response_payload: true
81+
tls: on
82+
tls.verify: off
83+
logs_body_key: $message
84+
logs_span_id_message_key: span_id
85+
logs_trace_id_message_key: trace_id
86+
logs_severity_text_message_key: loglevel
87+
logs_severity_number_message_key: lognum
88+
# add user-defined labels
89+
add_label:
90+
- app fluent-bit
91+
- color blue
4692
```
93+
94+
{% endtab %}
95+
{% tab title="fluent-bit.conf" %}
96+
97+
```text
4798
# Dummy Logs & traces with Node Exporter Metrics export using OpenTelemetry output plugin
4899
# -------------------------------------------
49100
# The following example collects host metrics on Linux and dummy logs & traces and delivers
@@ -87,3 +138,6 @@ The OpenTelemetry plugin works with logs and only the metrics collected from one
87138
add_label app fluent-bit
88139
add_label color blue
89140
```
141+
142+
{% endtab %}
143+
{% endtabs %}

0 commit comments

Comments
 (0)