|
| 1 | +# Versioning and Releasing |
| 2 | + |
| 3 | +[OTP] Applications and the [OpenTelemetry Spec] itself use [semver v2]. |
| 4 | + |
| 5 | +In this document, references to OTP concepts are distinguished by capitalizing the word |
| 6 | +(for example Application and Release) while the generic term (like release) is |
| 7 | +lowercase. |
| 8 | + |
| 9 | +[OTP]: http://erlang.org/doc/system_architecture_intro/sys_arch_intro.html |
| 10 | +[OpenTelemetry Spec]: https://github.com/open-telemetry/opentelemetry-specification |
| 11 | +[semver v2]: https://semver.org/spec/v2.0.0.html |
| 12 | + |
| 13 | +## Module Prefix |
| 14 | + |
| 15 | +The module prefix for all modules in any of these core Applications is |
| 16 | +`otel`. This means modules can move between Applications without their name |
| 17 | +changing. Because of Erlang's flat namespace, there is no code for a user to change |
| 18 | +when an API graduates from experimental to stable, if the user was |
| 19 | +using the latest version of the experimental API. |
| 20 | + |
| 21 | +This also allows flexibility for modules that might be in the SDK but are found |
| 22 | +to be better placed in the API, or vice versa. This has happened a few times in |
| 23 | +the pre-1.0 world as functionality was floating from SDK to API at times. |
| 24 | + |
| 25 | +## OTP Applications |
| 26 | + |
| 27 | +### Experimental API (`opentelemetry_api_experimental`) |
| 28 | + |
| 29 | +The experimental package is where any API that is not stable when 1.0 is |
| 30 | +released [MUST] live. At this time (prior to 1.0) that means Metrics and Logging. |
| 31 | + |
| 32 | +This package will always be 0.x because it is never stable and modules will be |
| 33 | +removed when they are moved to the stable API package. Breaking changes, |
| 34 | +as well as non-trivial additions, to the experimental API will only result in a |
| 35 | +minor version bump. |
| 36 | +[MUST]: https://tools.ietf.org/html/rfc2119#section-1 |
| 37 | + |
| 38 | +### API (`opentelemetry_api`) |
| 39 | + |
| 40 | +The API package must provide semver-defined backwards-compatibility |
| 41 | +once a major version (e.g. 1.0.0) is released. When a particular part of the API |
| 42 | +becomes stable, its modules are moved from `opentelemetry_api_experimental` to |
| 43 | +`opentelemetry_api` and a new minor release of both is published. |
| 44 | + |
| 45 | +At the release of version 1.0, the following signal APIs will be included |
| 46 | +in `opentelemetry_api`: |
| 47 | + |
| 48 | +* Tracing |
| 49 | +* Baggage |
| 50 | +* Context |
| 51 | + |
| 52 | +### Experimental SDK (`opentelemetry_sdk_experimental`) |
| 53 | + |
| 54 | +The experimental SDK contains the implementations for the APIs in the |
| 55 | +experimental API of the same minor version. For example, there may be |
| 56 | +multiple patch-level releases (`v0.3.2`, `v0.3.3`) of the experimental |
| 57 | +SDK for each minor version of the experimental API (`v0.3.0`). |
| 58 | +Any setup for signals contained in the experimental SDK must be done on startup |
| 59 | +of the experimental SDK. For example, setting the default Meter would be done |
| 60 | +in `start/2` of `opentelemetry_sdk_experimental`. |
| 61 | + |
| 62 | +### SDK (`opentelemetry`) |
| 63 | + |
| 64 | +Functionality is implemented in this Application and the API is dynamically |
| 65 | +configured to use a particular SDK -- at this time there is only 1 SDK |
| 66 | +implementation, the default implementation. |
| 67 | + |
| 68 | +A goal is that the latest SDK can always be used with any version of the API, so |
| 69 | +that a user can always pull the latest implementation into their final Release |
| 70 | +to run with any API versions that were used in instrumented Applications within the |
| 71 | +Release. |
| 72 | + |
| 73 | +### OTLP Exporter (`opentelemetry_exporter`) |
| 74 | + |
| 75 | +Exporter implementations are tied to the SDK's public API. |
| 76 | + |
| 77 | +## Releases |
| 78 | + |
| 79 | +### Experimental API |
| 80 | + |
| 81 | +As noted in the previous section, `opentelemetry_api_experimental` is versioned |
| 82 | +separately from the rest and will always remain 0.x. |
| 83 | + |
| 84 | +### API |
| 85 | + |
| 86 | +Additions to the API are released with minor version bumps. |
| 87 | + |
| 88 | +### Experimental SDK |
| 89 | + |
| 90 | +As noted in the previous section, `opentelemetry_sdk_experimental` is versioned |
| 91 | +separately from the rest, but in lockstep with `opentelemetry_api_experimental`, |
| 92 | +and will always remain 0.x. |
| 93 | + |
| 94 | +### SDK |
| 95 | + |
| 96 | +Additions to the SDK are released with minor version bumps. |
| 97 | + |
| 98 | +## Deprecation |
| 99 | + |
| 100 | +Code is only marked as deprecated when the replacement is stable. |
| 101 | + |
| 102 | +Unlikely example: There is a Tracing v2 spec defined. The module will be named |
| 103 | +`otel_trace2` and the functions in `otel_trace` marked as deprecated. |
| 104 | + |
| 105 | +Deprecated functions must be marked with `-deprecated` in the module so that |
| 106 | +`xref` provides a warning about usage to the user. |
| 107 | + |
| 108 | +## Removal |
| 109 | + |
| 110 | +A major version bump is required to remove a signal or module. |
| 111 | + |
| 112 | +In the unlikely example mentioned in the Deprecation section, this step would mean removal of the |
| 113 | +original module (`otel_trace`) and a major version bump release. |
| 114 | + |
| 115 | +## Examples |
| 116 | + |
| 117 | +Purely for illustration purposes, not intended to represent actual releases: |
| 118 | + |
| 119 | +- v1.0.0 release: |
| 120 | + - `opentelemetry_api` 1.0.0 |
| 121 | + - Contains APIs for tracing, baggage, propagators |
| 122 | + - `opentelemetry_api_experimental` 0.2.0 |
| 123 | + - Contains APIs for metrics |
| 124 | + - `opentelemetry_sdk` 1.0.0 |
| 125 | + - `opentelemetry_sdk_experimental` 0.2.0 |
| 126 | +- v1.15.0 release (with metrics) |
| 127 | + - `opentelemetry_api` 1.15.0 |
| 128 | + - Contains APIs for tracing, baggage, propagators, metrics |
| 129 | + - `opentelemetry_api_experimental` 0.42.0 |
| 130 | + - No longer contains APIs for metrics |
| 131 | + - `opentelemetry_sdk` 1.15.0 |
| 132 | + - `opentelemetry_sdk_experimental` 0.42.0 |
| 133 | + |
0 commit comments