|
1 | 1 | # Fluent::Plugin::Otlp
|
2 | 2 |
|
3 |
| -TODO: Delete this and the text below, and describe your gem |
4 |
| - |
5 |
| -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/fluent/plugin/otel`. To experiment with that code, run `bin/console` for an interactive prompt. |
| 3 | +[Fluentd](https://fluentd.org/) input/output plugin to forward [OpenTelemetry Protocol](https://github.com/open-telemetry/opentelemetry-proto) data. |
6 | 4 |
|
7 | 5 | ## Installation
|
8 | 6 |
|
9 |
| -TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org. |
| 7 | +### RubyGems |
| 8 | + |
| 9 | +```sh |
| 10 | +gem install fluent-plugin-otlp |
| 11 | +``` |
10 | 12 |
|
11 |
| -Install the gem and add to the application's Gemfile by executing: |
| 13 | +### Bundler |
12 | 14 |
|
13 |
| -```bash |
14 |
| -bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG |
| 15 | +```ruby |
| 16 | +gem "fluent-plugin-otlp" |
15 | 17 | ```
|
16 | 18 |
|
17 |
| -If bundler is not being used to manage dependencies, install the gem by executing: |
| 19 | +And then execute: |
| 20 | + |
| 21 | +```sh |
| 22 | +$ bundle |
| 23 | +``` |
| 24 | + |
| 25 | +## Configuration |
| 26 | + |
| 27 | +### Input plugin |
| 28 | + |
| 29 | +To receive data, this plugin requires `<http>` or `<grpc>` section, or both. |
| 30 | + |
| 31 | +* Root section |
| 32 | + |
| 33 | +| parameter | type | description | default | |
| 34 | +|-----------|--------|----------------------|----------| |
| 35 | +| tag | string | The tag of the event | required | |
| 36 | + |
| 37 | +* `<http>` section |
| 38 | + |
| 39 | +This requires to receive data via HTTP/HTTPS. |
| 40 | + |
| 41 | +| parameter | type | description | default | |
| 42 | +|-----------|---------|------------------------|-----------| |
| 43 | +| bind | string | The address to bind to | `0.0.0.0` | |
| 44 | +| port | integer | The port to listen to | `4318` | |
| 45 | + |
| 46 | +* `<grpc>` section |
| 47 | + |
| 48 | +This requires to receive data via gRPC. |
| 49 | + |
| 50 | +> [!WARNING] |
| 51 | +> Now, gRPC feature status is experimental. |
| 52 | +
|
| 53 | +| parameter | type | description | default | |
| 54 | +|-----------|---------|------------------------|-----------| |
| 55 | +| bind | string | The address to bind to | `0.0.0.0` | |
| 56 | +| port | integer | The port to listen to | `4318` | |
18 | 57 |
|
19 |
| -```bash |
20 |
| -gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG |
| 58 | +* `<transport>` section |
| 59 | + |
| 60 | +Refer [Config: Transport Section](https://docs.fluentd.org/configuration/transport-section) |
| 61 | + |
| 62 | + |
| 63 | +#### Example |
| 64 | + |
| 65 | +``` |
| 66 | +<source> |
| 67 | + @type otlp |
| 68 | + tag otlp |
| 69 | +
|
| 70 | + <http> |
| 71 | + bind 0.0.0.0 |
| 72 | + port 4318 |
| 73 | + </http> |
| 74 | +
|
| 75 | + <grpc> |
| 76 | + bind 0.0.0.0 |
| 77 | + port 4317 |
| 78 | + </grpc> |
| 79 | +</source> |
21 | 80 | ```
|
22 | 81 |
|
23 |
| -## Usage |
| 82 | +### Output plugin |
| 83 | + |
| 84 | +To send data, this plugin requires `<http>` or `<grpc>` section. |
| 85 | + |
| 86 | +* `<http>` section |
| 87 | + |
| 88 | +| parameter | type | description | default | |
| 89 | +|---------------------------------|---------|----------------------------------------------------------------|-------------------------| |
| 90 | +| endpoint | string | The endpoint for HTTP/HTTPS request | `http://127.0.0.1:4318` | |
| 91 | +| proxy | string | The proxy for HTTP/HTTPS request | optional | |
| 92 | +| error_response_as_unrecoverable | bool | Raise UnrecoverableError when the response code is not SUCCESS | `true` | |
| 93 | +| retryable_response_codes | array | The list of retryable response codes | `nil` | |
| 94 | +| read_timeout | integer | The read timeout in seconds | `60` | |
| 95 | +| write_timeout | integer | The write timeout in seconds | `60` | |
| 96 | +| connect_timeout | integer | The connect timeout in seconds | `60` | |
| 97 | + |
| 98 | +| parameter | type | description | available values | default | |
| 99 | +|-----------|--------|-------------------------------------------|------------------|---------| |
| 100 | +| compress | enum | The option to compress HTTP request body | `text` / `gzip` | `text` | |
24 | 101 |
|
25 |
| -TODO: Write usage instructions here |
| 102 | +* `<grpc>` section |
26 | 103 |
|
27 |
| -## Development |
| 104 | +| parameter | type | description | default | |
| 105 | +|---------------------------------|---------|----------------------------------------------------------------|------------------| |
| 106 | +| endpoint | string | The endpoint for HTTP/HTTPS request | `127.0.0.1:4317` | |
28 | 107 |
|
29 |
| -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. |
| 108 | +* `<transport>` section |
30 | 109 |
|
31 |
| -To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). |
| 110 | +| parameter | type | description | default | |
| 111 | +|------------------------|---------|------------------------------------------------|---------| |
| 112 | +| cert_path | string | Specifies the path of Certificate file | `nil` | |
| 113 | +| private_key_path | string | Specifies the path of Private Key file | `nil` | |
| 114 | +| private_key_passphrase | string | Specifies the public CA private key passphrase | `nil` | |
32 | 115 |
|
33 |
| -## Contributing |
| 116 | +| parameter | type | description | available values | default | |
| 117 | +|-------------|------|-------------------------------------------------------------|--------------------------------|---------| |
| 118 | +| min_version | enum | Specifies the lower bound of the supported SSL/TLS protocol | `TLS1_1` / `TLS1_2` / `TLS1_3` | `nil` | |
| 119 | +| max_version | enum | The endpoint for HTTP/HTTPS request | `TLS1_1` / `TLS1_2` / `TLS1_3` | `nil` | |
34 | 120 |
|
35 |
| -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/fluent-plugin-otlp. |
| 121 | +Refer [Config: Transport Section](https://docs.fluentd.org/configuration/transport-section) |
| 122 | + |
| 123 | +* `<buffer>` section |
| 124 | + |
| 125 | +| parameter | type | description | default | |
| 126 | +|------------------------|--------|------------------------------------------------|---------| |
| 127 | +| chunk_keys | array | Specifies the path of Certificate file | `nil` | |
| 128 | +| private_key_path | string | Specifies the path of Private Key file | `nil` | |
| 129 | +| private_key_passphrase | string | Specifies the public CA private key passphrase | `nil` | |
| 130 | + |
| 131 | +Refer [Config: Buffer Section](https://docs.fluentd.org/configuration/buffer-section) |
| 132 | + |
| 133 | +#### Example |
| 134 | + |
| 135 | +``` |
| 136 | +<match otlp.**> |
| 137 | + @type otlp |
| 138 | +
|
| 139 | + <http> |
| 140 | + endpoint "https://127.0.0.1:4318" |
| 141 | + </http> |
| 142 | +</match> |
| 143 | +``` |
36 | 144 |
|
37 | 145 | ## Copyright
|
38 | 146 |
|
|
0 commit comments