fluent-plugin-opentelemetry 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +75 -0
  3. data/CHANGELOG.md +5 -0
  4. data/LICENSE +202 -0
  5. data/README.md +154 -0
  6. data/Rakefile +35 -0
  7. data/TODO.md +108 -0
  8. data/lib/fluent/plugin/in_opentelemetry.rb +211 -0
  9. data/lib/fluent/plugin/opentelemetry/constant.rb +29 -0
  10. data/lib/fluent/plugin/opentelemetry/request.rb +67 -0
  11. data/lib/fluent/plugin/opentelemetry/response.rb +90 -0
  12. data/lib/fluent/plugin/opentelemetry/service_handler.rb +37 -0
  13. data/lib/fluent/plugin/opentelemetry/service_stub.rb +45 -0
  14. data/lib/fluent/plugin/out_opentelemetry.rb +207 -0
  15. data/lib/opentelemetry/proto/collector/logs/v1/logs_service_pb.rb +27 -0
  16. data/lib/opentelemetry/proto/collector/logs/v1/logs_service_services_pb.rb +48 -0
  17. data/lib/opentelemetry/proto/collector/metrics/v1/metrics_service_pb.rb +27 -0
  18. data/lib/opentelemetry/proto/collector/metrics/v1/metrics_service_services_pb.rb +48 -0
  19. data/lib/opentelemetry/proto/collector/profiles/v1development/profiles_service_pb.rb +27 -0
  20. data/lib/opentelemetry/proto/collector/profiles/v1development/profiles_service_services_pb.rb +47 -0
  21. data/lib/opentelemetry/proto/collector/trace/v1/trace_service_pb.rb +27 -0
  22. data/lib/opentelemetry/proto/collector/trace/v1/trace_service_services_pb.rb +48 -0
  23. data/lib/opentelemetry/proto/common/v1/common_pb.rb +26 -0
  24. data/lib/opentelemetry/proto/logs/v1/logs_pb.rb +29 -0
  25. data/lib/opentelemetry/proto/metrics/v1/metrics_pb.rb +41 -0
  26. data/lib/opentelemetry/proto/profiles/v1development/profiles_pb.rb +36 -0
  27. data/lib/opentelemetry/proto/resource/v1/resource_pb.rb +23 -0
  28. data/lib/opentelemetry/proto/trace/v1/trace_pb.rb +33 -0
  29. metadata +140 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c8f0a6c1b314b0737a832920decef09f6066acd10d578271b65edc4bc535b540
4
+ data.tar.gz: b5b1fd56d7c410ac7decfc50b67459277cb14d1a20b762bfdc414edaeaf1f4ef
5
+ SHA512:
6
+ metadata.gz: fe86042e9aa128f24f0479332aee03e753ef82e6e04fe34b6d49cc1226753f2ca26a775d5b938cce67cf02b710f5230c8106f278cb5afc19dc69faefc439a3c5
7
+ data.tar.gz: 65c174366007116fd6b7fa2422914224414f5ec7c976732550d448fd219edd25c7b413e1a077ad243ab341d2e2fbd688369e1c525ba417c8418c32d5d17532b2
data/.rubocop.yml ADDED
@@ -0,0 +1,75 @@
1
+ AllCops:
2
+ Exclude:
3
+ - 'lib/opentelemetry/**/*'
4
+ - 'vendor/bundle/**/*'
5
+ NewCops: enable
6
+ SuggestExtensions: false
7
+ TargetRubyVersion: 3.2
8
+
9
+ Layout/LineLength:
10
+ Enabled: false
11
+
12
+ Lint/UnusedMethodArgument:
13
+ Enabled: false
14
+
15
+ Metrics:
16
+ Enabled: false
17
+
18
+ Naming/BlockForwarding:
19
+ Enabled: false
20
+
21
+ Naming/MethodParameterName:
22
+ Enabled: false
23
+
24
+ Naming/VariableNumber:
25
+ Enabled: false
26
+
27
+ Style/ArgumentsForwarding:
28
+ Enabled: false
29
+
30
+ Style/ClassAndModuleChildren:
31
+ Enabled: false
32
+
33
+ Style/ClassVars:
34
+ Exclude:
35
+ - 'test/**/*.rb'
36
+
37
+ Style/Copyright:
38
+ Enabled: false
39
+
40
+ Style/Documentation:
41
+ Enabled: false
42
+
43
+ Style/FetchEnvVar:
44
+ Enabled: false
45
+
46
+ Style/GuardClause:
47
+ Enabled: false
48
+
49
+ Style/IfUnlessModifier:
50
+ Enabled: false
51
+
52
+ Style/MixinUsage:
53
+ Exclude:
54
+ - 'test/helper.rb'
55
+
56
+ Style/NumericLiterals:
57
+ Enabled: false
58
+
59
+ Style/PercentLiteralDelimiters:
60
+ Enabled: false
61
+
62
+ Style/RequireOrder:
63
+ Enabled: true
64
+
65
+ Style/StringConcatenation:
66
+ Enabled: false
67
+
68
+ Style/StringHashKeys:
69
+ Enabled: false
70
+
71
+ Style/StringLiterals:
72
+ EnforcedStyle: double_quotes
73
+
74
+ Style/TrivialAccessors:
75
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2025-03-31
4
+
5
+ - Initial release
data/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,154 @@
1
+ # fluent-plugin-opentelemetry
2
+
3
+ [Fluentd](https://fluentd.org/) input/output plugin to forward [OpenTelemetry Protocol](https://github.com/open-telemetry/opentelemetry-proto) data.
4
+
5
+ ## Installation
6
+
7
+ ### RubyGems
8
+
9
+ ```sh
10
+ gem install fluent-plugin-opentelemetry
11
+ ```
12
+
13
+ ### Bundler
14
+
15
+ ```ruby
16
+ gem "fluent-plugin-opentelemetry"
17
+ ```
18
+
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` |
57
+
58
+ * `<transport>` section
59
+
60
+ Refer [Config: Transport Section](https://docs.fluentd.org/configuration/transport-section)
61
+
62
+ #### Example
63
+
64
+ ```
65
+ <source>
66
+ @type opentelemetry
67
+ tag opentelemetry
68
+
69
+ <http>
70
+ bind 0.0.0.0
71
+ port 4318
72
+ </http>
73
+
74
+ <grpc>
75
+ bind 0.0.0.0
76
+ port 4317
77
+ </grpc>
78
+ </source>
79
+ ```
80
+
81
+ ### Output plugin
82
+
83
+ To send data, this plugin requires `<http>` or `<grpc>` section.
84
+
85
+ #### `<http>` section
86
+
87
+ This requires to send data via HTTP/HTTPS.
88
+
89
+ | parameter | type | description | default |
90
+ |---------------------------------|---------|----------------------------------------------------------------|-------------------------|
91
+ | endpoint | string | The endpoint for HTTP/HTTPS request | `http://127.0.0.1:4318` |
92
+ | proxy | string | The proxy for HTTP/HTTPS request | `nil` |
93
+ | error_response_as_unrecoverable | bool | Raise UnrecoverableError when the response code is not SUCCESS | `true` |
94
+ | retryable_response_codes | array | The list of retryable response codes | `[429, 502, 503, 504]` |
95
+ | read_timeout | integer | The read timeout in seconds | `60` |
96
+ | write_timeout | integer | The write timeout in seconds | `60` |
97
+ | connect_timeout | integer | The connect timeout in seconds | `60` |
98
+
99
+ | parameter | type | description | available values | default |
100
+ |-----------|--------|-------------------------------------------|------------------|---------|
101
+ | compress | enum | The option to compress HTTP request body | `text` / `gzip` | `text` |
102
+
103
+ #### `<grpc>` section
104
+
105
+ This requires to send data via gRPC.
106
+
107
+ > [!WARNING]
108
+ > Now, gRPC feature status is experimental.
109
+
110
+ | parameter | type | description | default |
111
+ |---------------------------------|---------|----------------------------------------------------------------|------------------|
112
+ | endpoint | string | The endpoint for HTTP/HTTPS request | `127.0.0.1:4317` |
113
+
114
+ #### `<transport>` section
115
+
116
+ | parameter | type | description | default |
117
+ |------------------------|---------|------------------------------------------------|---------|
118
+ | cert_path | string | Specifies the path of Certificate file | `nil` |
119
+ | private_key_path | string | Specifies the path of Private Key file | `nil` |
120
+ | private_key_passphrase | string | Specifies the public CA private key passphrase | `nil` |
121
+
122
+ | parameter | type | description | available values | default |
123
+ |-------------|------|-------------------------------------------------------------|--------------------------------|---------|
124
+ | min_version | enum | Specifies the lower bound of the supported SSL/TLS protocol | `TLS1_1` / `TLS1_2` / `TLS1_3` | `nil` |
125
+ | max_version | enum | The endpoint for HTTP/HTTPS request | `TLS1_1` / `TLS1_2` / `TLS1_3` | `nil` |
126
+
127
+ Refer [Config: Transport Section](https://docs.fluentd.org/configuration/transport-section)
128
+
129
+ #### `<buffer>` section
130
+
131
+ | parameter | type | description | default |
132
+ |------------|--------|-----------------------------------------------------------|---------|
133
+ | chunk_keys | array | Overwrites the default `chunk_keys` value in this plugin. | `tag` |
134
+
135
+ Refer [Config: Buffer Section](https://docs.fluentd.org/configuration/buffer-section)
136
+
137
+ #### Example
138
+
139
+ ```
140
+ <match opentelemetry.**>
141
+ @type opentelemetry
142
+
143
+ <http>
144
+ endpoint "https://127.0.0.1:4318"
145
+ </http>
146
+ </match>
147
+ ```
148
+
149
+ ## Copyright
150
+
151
+ * Copyright(c) 2025- Shizuo Fujita
152
+ * License
153
+ * Apache License, Version 2.0
154
+
data/Rakefile ADDED
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+ require "tmpdir"
6
+
7
+ Rake::TestTask.new(:test) do |t|
8
+ t.libs << "test"
9
+ t.libs << "lib"
10
+ t.test_files = FileList["test/**/test_*.rb"]
11
+
12
+ # Disable displaying 'warning: literal string will be frozen in the future'
13
+ ENV["RUBYOPT"] = "--disable=frozen_string_literal"
14
+ end
15
+
16
+ task default: :test
17
+
18
+ desc "Regenerate 'lib/opentelemetry'"
19
+ task :"regenerate:opentelemetry" do
20
+ lib_path = File.expand_path("lib/opentelemetry")
21
+
22
+ rm_rf lib_path
23
+ cd Dir.tmpdir do
24
+ sh "git clone https://github.com/open-telemetry/opentelemetry-proto.git --depth 1"
25
+ cd "opentelemetry-proto" do
26
+ files = Dir.glob("opentelemetry/**/*.proto")
27
+
28
+ mkdir_p "gen"
29
+ sh "grpc_tools_ruby_protoc --grpc_out=./gen --ruby_out=./gen --proto_path=. #{files.join(' ')}"
30
+ mv "./gen/opentelemetry", lib_path
31
+ end
32
+ ensure
33
+ rm_rf "opentelemetry-proto"
34
+ end
35
+ end
data/TODO.md ADDED
@@ -0,0 +1,108 @@
1
+ This checklist indicates the implementation status of MUST / SHOULD in the protocol specification.
2
+ Ref. https://github.com/open-telemetry/opentelemetry-proto/blob/main/docs/specification.md
3
+
4
+ # Protocol Details
5
+ ## OTLP/gRPC
6
+ - [ ] [MUST] All server components MUST support the following transport compression options:
7
+ - [ ] [MUST] No compression, denoted by none.
8
+ - [ ] [MUST] Gzip compression, denoted by gzip.
9
+
10
+ ### OTLP/gRPC Concurrent Requests
11
+ - [ ] [SHOULD] The implementations that need to achieve high throughput SHOULD support concurrent Unary calls to achieve higher throughput.
12
+ - [ ] [SHOULD] The client SHOULD send new requests without waiting for the response to the earlier sent requests, essentially creating a pipeline of requests that are currently in flight that are not acknowledged.
13
+ - [ ] [SHOULD] The number of concurrent requests SHOULD be configurable.
14
+ - [ ] [SHOULD] The client implementation SHOULD expose an option to turn on and off the waiting during a shutdown.
15
+
16
+ ### OTLP/gRPC Response
17
+ - Full Success
18
+ - [x] [MUST] On success, the server response MUST be a Export<signal>ServiceResponse message.
19
+ - [x] [MUST] The server MUST leave the partial_success field unset in case of a successful response.
20
+ - [ ] [SHOULD] If the server receives an empty request the server SHOULD respond with success.
21
+ - Partial Success (NOTE: Currentry, it does not support partially accepting)
22
+ - [ ] [MUST] The server response MUST be the same Export<signal>ServiceResponse message as in the Full Success case.
23
+ - [ ] [MUST] The server MUST initialize the partial_success field, and it MUST set the respective rejected_spans, rejected_data_points, rejected_log_records or rejected_profiles field with the number of spans/data points/log records/profiles it rejected.
24
+ - [ ] [MUST] Servers MAY also use the partial_success field to convey warnings/suggestions to clients even when the server fully accepts the request. The rejected_<signal> field MUST have a value of 0, and the error_message field MUST be non-empty.
25
+ - [ ] [MUST] The client MUST NOT retry the request when it receives a partial success response where the partial_success is populated.
26
+ - [ ] [SHOULD] The server SHOULD populate the error_message field with a human-readable error message in English.
27
+ - Failures
28
+ - [ ] [MUST] Not-retryable errors indicate that telemetry data processing failed, and the client MUST NOT retry sending the same telemetry data. The client MUST drop the telemetry data.
29
+ - [ ] [MUST] The server MUST indicate retryable errors using code Unavailable.
30
+ - [ ] [SHOULD] Retryable errors indicate that telemetry data processing failed, and the client SHOULD record the error and may retry exporting the same data.
31
+ - [ ] [SHOULD] The client SHOULD maintain a counter of such dropped data.
32
+ - [ ] [SHOULD] The client SHOULD interpret gRPC status codes as retryable or not-retryable according to the following table.
33
+ - [ ] [SHOULD] When retrying, the client SHOULD implement an exponential backoff strategy.
34
+ - [ ] [SHOULD] The client SHOULD interpret RESOURCE_EXHAUSTED code as retryable only if the server signals that the recovery from resource exhaustion is possible.
35
+
36
+ ### OTLP/gRPC Throttling
37
+ - [ ] [MUST] The client MUST then throttle itself to avoid overwhelming the server.
38
+ - [ ] [MUST] To signal backpressure when using gRPC transport, the server MUST return an error with code Unavailable.
39
+ - [ ] [SHOULD] If the server is unable to keep up with the pace of data it receives from the client then it SHOULD signal that fact to the client.
40
+ - [ ] [SHOULD] When the client receives this signal, it SHOULD follow the recommendations outlined in documentation for RetryInfo.
41
+ - [ ] [SHOULD] The server SHOULD choose a retry_delay value that is big enough to give the server time to recover yet is not too big to cause the client to drop data while being throttled.
42
+
43
+
44
+ ## OTLP/HTTP
45
+ - [x] [MUST] All server components MUST support the following transport compression options:
46
+ - [x] [MUST] No compression, denoted by none.
47
+ - [x] [MUST] Gzip compression, denoted by gzip.
48
+ - [ ] [SHOULD] Implementations that use HTTP/2 transport SHOULD fallback to HTTP/1.1 transport if HTTP/2 connection cannot be established.
49
+
50
+ ### Binary Protobuf Encoding
51
+ - [x] [MUST] The client and the server MUST set "Content-Type: application/x-protobuf" request and response headers when sending binary Protobuf encoded payload.
52
+
53
+ ### JSON Protobuf Encoding
54
+ - [x] [MUST] The client and the server MUST set "Content-Type: application/json" request and response headers when sending JSON Protobuf encoded payload.
55
+ - [x] [MUST] Values of enum fields MUST be encoded as integer values.
56
+ - [x] [MUST] OTLP/JSON receivers MUST ignore message fields with unknown names and MUST unmarshal the message as if the unknown field was not present in the payload.
57
+
58
+ ### OTLP/HTTP Request
59
+ - [x] [MUST] The client MAY gzip the content and in that case MUST include "Content-Encoding: gzip" request header.
60
+
61
+ ### OTLP/HTTP Response
62
+ - [x] [MUST] The response body MUST be the appropriate serialized Protobuf message.
63
+ - [x] [MUST] The server MUST set "Content-Type: application/x-protobuf" header if the response body is binary-encoded Protobuf payload.
64
+ - [x] [MUST] The server MUST set "Content-Type: application/json" if the response is JSON-encoded Protobuf payload.
65
+ - [x] [MUST] The server MUST use the same "Content-Type" in the response as it received in the request.
66
+ - Full Success
67
+ - [x] [MUST] On success, the server MUST respond with HTTP 200 OK
68
+ - [x] [MUST] The response body MUST be a Protobuf-encoded Export<signal>ServiceResponse message.
69
+ - [x] [MUST] The server MUST leave the partial_success field unset in case of a successful response.
70
+ - [x] [SHOULD] If the server receives an empty request the server SHOULD respond with success.
71
+ - Partial Success (NOTE: Currentry, it does not support partially accepting)
72
+ - [ ] [MUST] If the request is only partially accepted, the server MUST respond with HTTP 200 OK.
73
+ - [ ] [MUST] The response body MUST be the same Export<signal>ServiceResponse message as in the Full Success case.
74
+ - [ ] [MUST] The server MUST initialize the partial_success field, and it MUST set the respective rejected_spans, rejected_data_points, rejected_log_records or rejected_profiles field with the number of spans/data points/log records it rejected.
75
+ - [ ] [MUST] Servers MAY also use the partial_success field to convey warnings/suggestions to clients even when it fully accepts the request. In such cases, the rejected_<signal> field MUST have a value of 0, and the error_message field MUST be non-empty.
76
+ - [ ] [MUST] The client MUST NOT retry the request when it receives a partial success response where the partial_success is populated.
77
+ - [ ] [SHOULD] The server SHOULD populate the error_message field with a human-readable error message in English.
78
+ - Failures
79
+ - [x] [MUST] If the processing of the request fails, the server MUST respond with appropriate HTTP 4xx or HTTP 5xx status code.
80
+ - [ ] [MUST] The response body for all HTTP 4xx and HTTP 5xx responses MUST be a Protobuf-encoded Status message that describes the problem.
81
+ - [ ] [SHOULD] The Status.message field SHOULD contain a developer-facing error message as defined in Status message schema.
82
+ - [ ] [SHOULD] The server SHOULD use HTTP response status codes to indicate retryable and not-retryable errors for a particular erroneous situation.
83
+ - [x] [SHOULD] The client SHOULD honour HTTP response status codes as retryable or not-retryable.
84
+ - Retryable Response Codes
85
+ - [x] [MUST] All other 4xx or 5xx response status codes MUST NOT be retried.
86
+ - [x] [SHOULD] The requests that receive a response status code listed in following table SHOULD be retried.
87
+ - Bad Data
88
+ - [x] [MUST] If the processing of the request fails because the request contains data that cannot be decoded or is otherwise invalid and such failure is permanent, then the server MUST respond with HTTP 400 Bad Request.
89
+ - [x] [MUST] The client MUST NOT retry the request when it receives HTTP 400 Bad Request response.
90
+ - [ ] [SHOULD] The Status.details field in the response SHOULD contain a BadRequest that describes the bad data.
91
+ - OTLP/HTTP Throttling
92
+ - [ ] [SHOULD] If the server receives more requests than the client is allowed or the server is overloaded, the server SHOULD respond with HTTP 429 Too Many Requests or HTTP 503 Service Unavailable.
93
+ - [ ] [SHOULD] The client SHOULD honour the waiting interval specified in the "Retry-After" header if it is present.
94
+ - [ ] [SHOULD] The "Retry-After" header is not present in the response, then the client SHOULD implement an exponential backoff strategy between retries.
95
+ - All Other Responses
96
+ - [x] [SHOULD] If the server disconnects without returning a response, the client SHOULD retry and send the same request.
97
+ - [x] [SHOULD] The client SHOULD implement an exponential backoff strategy between retries to avoid overwhelming the server.
98
+
99
+ ### OTLP/HTTP Connection
100
+ - [ ] [SHOULD] If the client cannot connect to the server, the client SHOULD retry the connection using an exponential backoff strategy between retries.
101
+ - [ ] [SHOULD] The client SHOULD keep the connection alive between requests.
102
+ - [ ] [SHOULD] Server implementations SHOULD accept OTLP/HTTP with binary-encoded Protobuf payload and OTLP/HTTP with JSON-encoded Protobuf payload requests on the same port and multiplex the requests to the corresponding payload decoder based on the "Content-Type" request header.
103
+
104
+ ### OTLP/HTTP Concurrent Requests
105
+ - [ ] [SHOULD] To achieve higher total throughput, the client MAY send requests using several parallel HTTP connections. In that case, the maximum number of parallel connections SHOULD be configurable.
106
+
107
+ # Future Versions and Interoperability
108
+ - [ ] [MUST] When possible, the interoperability MUST be ensured between all versions of OTLP that are not declared obsolete.