Debian Codegraph @

docs/component-stability.md

raw
1 # Stability Levels and versioning
2
3 ## Stability levels
4
5 The Collector components and implementation are in different stages of stability, and usually split between
6 functionality and configuration. While we intend to provide high-quality components as part of this repository,
7 we acknowledge that not all of them are ready for prime time. Moreover, the stability of components that can
8 handle multiple signals can depend on the signal in question.
9
10 As such, each component should list its current stability level for each telemetry signal in its README file, according to
11 the following definitions:
12
13 ### Development
14
15 Not all pieces of the component are in place yet and it might not be available as part of any distributions yet. Bugs and performance issues should be reported, but it is likely that the component owners might not give them much attention. Your feedback is still desired, especially when it comes to the user-experience (configuration options, component observability, technical implementation details, ...). Configuration options might break often depending on how things evolve. The component should not be used in production.
16
17 ### Alpha
18
19 The component is ready to be used for limited non-critical workloads and the authors of this component would welcome your feedback. Bugs and performance problems should be reported, but component owners might not work on them right away.
20
21 #### Configuration changes
22
23 Configuration for alpha components can be changed with minimal notice. Documenting them as part of the changelog is
24 sufficient. We still recommend giving users one or two minor versions' notice before breaking the configuration, such as
25 when removing or renaming a configuration option. Providing a migration path in the component's repository is NOT
26 required for alpha components, although it is still recommended.
27
28 - when adding a new configuration option, components MAY mark the new option as required and are not required to provide
29 a reasonable default.
30 - when renaming a configuration option, components MAY treat the old name as an alias to the new one and log a WARN
31 level message in case the old option is being used.
32 - when removing a configuration option, components MAY keep the old option for a few minor releases and log a WARN level
33 message instructing users to remove the option.
34
35 #### Documentation requirements
36
37 Alpha components should document how to use them in the most common situations, including:
38 - One or more example configuration snippets for the most common use cases.
39
40 ### Beta
41
42 Same as Alpha, but the configuration options are deemed stable. While there might be breaking changes between releases, component owners should try to minimize them. A component at this stage is expected to have had exposure to non-critical production workloads already during its **Alpha** phase, making it suitable for broader usage.
43
44 #### Configuration changes
45
46 Backward incompatible changes should be rare events for beta components. Users of those components are not expecting to
47 have their Collector instances failing at startup because of a configuration change. When doing backward incompatible
48 changes, component owners should add the migration path to a place within the component's repository, linked from the
49 component's main README. This is to ensure that people using older instructions can understand how to migrate to the
50 latest version of the component.
51
52 When adding a new required option:
53 - the option MUST come with a sensible default value
54
55 When renaming or removing a configuration option:
56 - the option MUST be deprecated in one version
57 - a WARN level message should be logged, with a link to a place within the component's repository where the change is
58 documented and a migration path is provided
59 - the option MUST be kept for at least N+1 version and MAY be hidden behind a feature gate in N+2
60 - the option and the WARN level message MUST NOT be removed earlier than N+2 or 6 months, whichever comes later
61
62 Additionally, when removing an option:
63 - the option MAY be made non-operational already by the same version where it is deprecated
64
65 #### Documentation requirements
66
67 Beta components should have a set of documentation that documents its usage in most cases,
68 including:
69 - One or more example configuration snippets for the most common use cases.
70 - Advanced configuration options that are known to be used in common environments.
71 - All component-specific feature gates including a description for them and when they should be
72 used.
73 - Warnings about known limitations and ways to misuse the component.
74
75 Receivers that produce a fixed set of telemetry should document the telemetry they produce,
76 including:
77 - For all signals, the resource attributes that are expected to be present in telemetry.
78 - For metrics, the name, description, type, units and attributes of each metric.
79
80 ### Stable
81
82 The component is ready for general availability. Bugs and performance problems should be reported and there's an expectation that the component owners will work on them. Breaking changes, including configuration options and the component's output are not expected to happen without prior notice, unless under special circumstances.
83
84 #### Configuration changes
85
86 Stable components MUST be compatible between minor versions unless critical security issues are found. In that case, the
87 component owner MUST provide a migration path and a reasonable time frame for users to upgrade. The same rules from beta
88 components apply to stable when it comes to configuration changes.
89
90 #### Testing requirements
91
92 Stable components MUST have a comprehensive test suite. In particular they MUST have:
93 1. A **test coverage** that exceeds the highest between 80% coverage and the repository-wide
94 minimum. The unit test suite SHOULD cover all configuration options. The coverage MUST be shown as
95 part of the component documentation.
96 2. At least one **lifecycle test** that tests the component's initialization with a valid
97 configuration and ensures proper context propagation if applicable.
98 3. At least one **benchmark test** for each stable signal. The component's documentation MUST
99 include a link to the latest run of benchmark results.
100
101 #### Documentation requirements
102
103 Stable components should have a complete set of documentation, including:
104 - One or more example configuration snippets for the most common use cases.
105 - All configuration options supported by the component and a description for each of them.
106 - All component-specific feature gates including a description for them and when they should be
107 used.
108 - All component-specific self-observability features that are not available for other components and
109 what they provide.
110 - Compatibility guarantees with external dependencies including the versions it is compatible with
111 and under what conditions.
112 - Guidance related to the component's usage in production environments, including how to scale a deployment of this component properly if it needs special considerations.
113 - If stateful, how to configure the component to use persistent storage and how to gracefully
114 shutdown and restart the component.
115 - Warnings about known limitations and ways to misuse the component.
116
117 Receivers that produce a fixed set of telemetry should document the telemetry they produce,
118 including:
119 - For all signals, the resource attributes that are expected to be present in telemetry.
120 - For metrics, the name, description, type, units and attributes of each metric.
121
122 #### Observability requirements
123
124 Stable components should emit enough internal telemetry to let users detect errors, as well as data
125 loss and performance issues inside the component, and to help diagnose them if possible.
126
127 For extension components, this means some way to monitor errors (for example through logs or span
128 events), and some way to monitor performance (for example through spans or histograms). Because
129 extensions can be so diverse, the details will be up to the component authors, and no further
130 constraints are set out in this document.
131
132 For pipeline components however, this section details the kinds of values that should be observable
133 via internal telemetry for all stable components.
134
135 > [!NOTE]
136 > - The following categories MUST all be covered, unless justification is given as to why one may
137 > not be applicable.
138 > - However, for each category, many reasonable implementations are possible, as long as the
139 > relevant information can be derived from the emitted telemetry; everything after the basic
140 > category description is a recommendation, and is not normative.
141 > - Of course, a component may define additional internal telemetry which is not in this list.
142 > - Some of this internal telemetry may already be provided by pipeline auto-instrumentation or
143 > helper modules (such as `receiverhelper`, `scraperhelper`, `processorhelper`, or
144 > `exporterhelper`). Please check the documentation to verify which parts, if any, need to be
145 > implemented manually.
146
147 **Definition:** In the following, an "item" refers generically to a single log record, metric point,
148 or span.
149
150 The internal telemetry of a stable pipeline component should allow observing the following:
151
152 1. How much data the component receives.
153
154 For receivers, this could be a metric counting requests, received bytes, scraping attempts, etc.
155
156 For other components, this would typically be the number of items received through the
157 `Consumer` API.
158
159 2. How much data the component outputs.
160
161 For exporters, this could be a metric counting requests, sent bytes, etc.
162
163 For other components, this would typically be the number of items forwarded to the next
164 component through the `Consumer` API.
165
166 3. How much data is dropped because of errors.
167
168 For receivers, this could include a metric counting payloads that could not be parsed in.
169
170 For receivers and exporters that interact with an external service, this could include a metric
171 counting requests that failed because of network errors.
172
173 For processors, this could be an `outcome` (`success` or `failure`) attribute on a "received
174 items" metric defined for point 1.
175
176 The goal is to be able to easily pinpoint the source of data loss in the Collector pipeline, so
177 this should either:
178 - only include errors internal to the component, or;
179 - allow distinguishing said errors from ones originating in an external service, or propagated
180 from downstream Collector components.
181
182 4. Details for error conditions.
183
184 This could be in the form of logs or spans detailing the reason for an error. As much detail as
185 necessary should be provided to ease debugging. Processed signal data should not be included for
186 security and privacy reasons.
187
188 5. Other possible discrepancies between input and output, if any. This may include:
189
190 - How much data is dropped as part of normal operation (eg. filtered out).
191
192 - How much data is created by the component.
193
194 - How much data is currently held by the component, and how much can be held if there is a fixed
195 capacity.
196
197 This would typically be an UpDownCounter keeping track of the size of an internal queue, along
198 with a gauge exposing the queue's capacity.
199
200 6. Processing performance.
201
202 This could include spans for each operation of the component, or a histogram of end-to-end
203 component latency.
204
205 The goal is to be able to easily pinpoint the source of latency in the Collector pipeline, so
206 this should either:
207 - only include time spent processing inside the component, or;
208 - allow distinguishing this latency from that caused by an external service, or from time spent
209 in downstream Collector components.
210
211 As an application of this, components which hold items in a queue should allow differentiating
212 between time spent processing a batch of data and time where the batch is simply waiting in the
213 queue.
214
215 If multiple spans are emitted for a given batch (before and after a queue for example), they
216 should either belong to the same trace, or have span links between them, so that they can be
217 correlated.
218
219 When measuring amounts of data, it is recommended to use "items" as your unit of measure. Where this
220 can't easily be done, any relevant unit may be used, as long as zero is a reliable indicator of the
221 absence of data. In any case, all metrics should have a defined unit (not "1").
222
223 All internal telemetry emitted by a component should have attributes identifying the specific
224 component instance that it originates from. This should follow the same conventions as the
225 [pipeline universal telemetry](rfcs/component-universal-telemetry.md).
226
227 If data can be dropped/created/held at multiple distinct points in a component's pipeline (eg.
228 scraping, validation, processing, etc.), it is recommended to define additional attributes to help
229 diagnose the specific source of the discrepancy, or to define different signals for each.
230
231 The breakdown of emitted telemetry per telemetry level (basic / normal / detailed) should follow
232 the guidelines in [the Go package documentation for `configtelemetry`](/config/configtelemetry/doc.go).
233
234 ### Deprecated
235
236 The component is planned to be removed in a future version and no further support will be provided. Note that new issues will likely not be worked on. When a component enters "deprecated" mode, it is expected to exist for at least two minor releases. See the component's readme file for more details on when a component will cease to exist.
237
238 ### Unmaintained
239
240 A component identified as unmaintained does not have an active code owner. Such component may have never been assigned a code owner or a previously active code owner has not responded to requests for feedback within 6 weeks of being contacted. Issues and pull requests for unmaintained components will be labelled as such. After 3 months of being unmaintained, these components will be removed from official distribution. Components that are unmaintained are actively seeking contributors to become code owners.
241
242 Components that were accepted based on being vendor-specific components will be marked as unmaintained if
243 they have no active code owners from the vendor even if there are other code owners listed. As part of being marked unmaintained, we'll attempt to contact the vendor to notify them of the change. Other active code
244 owners may petition for its continued maintenance if they want, at which point the component will no
245 longer be considered vendor-specific.
246
247 ## Moving between stability levels
248
249 Components can move between stability levels. The valid transitions are described in the following diagram:
250
251 ```mermaid
252 stateDiagram-v2
253 state Maintained {
254 InDevelopment --> Alpha
255 Alpha --> Beta
256 Beta --> Stable
257 }
258
259 InDevelopment: In Development
260
261 Maintained --> Unmaintained
262 Unmaintained --> Maintained
263 Maintained --> Deprecated
264 Deprecated --> Maintained: (should be rare)
265 ```
266
267 To move within the 'Maintained' ladder ("graduate"), the process for doing so is as follows:
268
269 1. One of the component owners should file an issue with the 'Graduation' issue template to request
270 the graduation.
271 2. An approver is assigned in a rotating basis to evaluate the request and provide feedback. For
272 vendor specific components, the approver should be from a different employer to the one owning
273 the component.
274 3. If approved, a PR to change the stability level should be opened and MUST be approved by all
275 listed code owners.
276
277 ## Graduation criteria
278
279 In addition to the requirements outlined above, additional criteria should be met before a component
280 can graduate to a higher stability level. These ensure that the component is ready for the increased
281 usage and scrutiny that comes with a higher stability level, and that the community around it is
282 sufficiently healthy.
283
284 If the graduation criteria are not met, the approver should provide feedback on what is missing and
285 how to address it. The component owners can then address the feedback and re-request graduation on
286 the same issue.
287
288 ## In development to alpha
289
290 No additional criteria are required to graduate from development to alpha.
291 The component still needs to meet the general requirements for alpha components.
292
293 ## Alpha to beta
294
295 To graduate any signal from alpha to beta on a component:
296 1. The component MUST have at least two active code owners.
297 3. Within the 30 days prior to the graduation request, the code owners MUST have reviewed and
298 replied to at least 80% of the issues and pull requests opened against the component. This
299 excludes general PRs or issues that are not specific to the component itself (e.g. repo-wide API
300 updates). It is not necessary that the issues and PRs are closed or merged, but that they have
301 been reviewed and replied to appropriately.
302
303 ## Beta to stable
304
305 To graduate any signal from beta to stable on a component:
306 1. The component MUST have at least three active code owners.
307 2. The component benchmark results MUST have been updated within the last 30 days and published in the component's README.
308 3. Within the 60 days prior to the graduation request, the code owners MUST have reviewed and
309 replied to at least 80% of the issues and pull requests opened against the component. This
310 excludes general PRs or issues that are not specific to the component itself (e.g. repo-wide API
311 updates). It is not necessary that the issues and PRs are closed or merged, but that they have
312 been reviewed and replied to appropriately.
313
314 ## Deprecation Information
315
316 When a component is moved to deprecated, a deprecation section should indicate the date it was deprecated
317 as well as any migration guidance. In some occasions might not be offered migration guidance but reviewers should
318 explicitly agree on this, and use a "No migration is offered for this component" hint.
319
320 ## Versioning
321
322 For a component to be marked as 1.x it MUST be stable for at least one signal.
323 Even if a component has a 1.x or greater version, its behavior for specific signals might change in ways that break end users if the component is not stable for a particular signal.
324
325 However, components are Go modules and as such follow [semantic versioning](https://semver.org/). Go API stability guarantees are covered in the [VERSIONING.md](../VERSIONING.md) document.
326 The versioning of a component, and the Go API stability guarantees that come with it, apply to ALL signals simultaneously, regardless of their stability level.
327 This means that, once a component is marked as 1.x, signal-specific configuration options MUST NOT be removed or changed in a way that breaks our Go API compatibility promise, even if the signal is not stable.