|
13 | 13 | // limitations under the License.
|
14 | 14 |
|
15 | 15 | // Package opencensus provides a migration bridge from OpenCensus to
|
16 |
| -// OpenTelemetry. The NewTracer function should be used to create an |
17 |
| -// OpenCensus Tracer from an OpenTelemetry Tracer. This Tracer can be use in |
18 |
| -// place of any existing OpenCensus Tracer and will generate OpenTelemetry |
19 |
| -// spans for traces. These spans will be exported by the OpenTelemetry |
20 |
| -// TracerProvider the original OpenTelemetry Tracer came from. |
| 16 | +// OpenTelemetry for metrics and traces. The bridge incorporates metrics and |
| 17 | +// traces from OpenCensus into the OpenTelemetry SDK, combining them with |
| 18 | +// metrics and traces from OpenTelemetry instrumentation. |
21 | 19 | //
|
22 |
| -// There are known limitations to this bridge: |
| 20 | +// # Migration Guide |
23 | 21 | //
|
24 |
| -// - The AddLink method for OpenCensus Spans is not compatible with the |
25 |
| -// OpenTelemetry Span. No link can be added to an OpenTelemetry Span once it |
26 |
| -// is started. Any calls to this method for the OpenCensus Span will result |
27 |
| -// in an error being sent to the OpenTelemetry default ErrorHandler. |
| 22 | +// For most applications, it would be difficult to migrate an application |
| 23 | +// from OpenCensus to OpenTelemetry all-at-once. Libraries used by the |
| 24 | +// application may still be using OpenCensus, and the application itself may |
| 25 | +// have many lines of instrumentation. |
28 | 26 | //
|
29 |
| -// - The NewContext method of the OpenCensus Tracer cannot embed an OpenCensus |
30 |
| -// Span in a context unless that Span was created by that Tracer. |
| 27 | +// Bridges help in this situation by allowing your application to have "mixed" |
| 28 | +// instrumentation, while incorporating all instrumentation into a single |
| 29 | +// export path. To migrate with bridges, a user would: |
31 | 30 | //
|
32 |
| -// - Conversion of custom OpenCensus Samplers to OpenTelemetry is not |
33 |
| -// implemented. An error will be sent to the OpenTelemetry default |
34 |
| -// ErrorHandler if this is attempted. |
| 31 | +// 1. Configure the OpenTelemetry SDK for metrics and traces, with the OpenTelemetry exporters matching to your current OpenCensus exporters. |
| 32 | +// 2. Install this OpenCensus bridge, which sends OpenCensus telemetry to your new OpenTelemetry exporters. |
| 33 | +// 3. Over time, migrate your instrumentation from OpenCensus to OpenTelemetry. |
| 34 | +// 4. Once all instrumentation is migrated, remove the OpenCensus bridge. |
| 35 | +// |
| 36 | +// With this approach, you can migrate your telemetry, including in dependent |
| 37 | +// libraries over time without disruption. |
| 38 | +// |
| 39 | +// # Warnings |
| 40 | +// |
| 41 | +// Installing a metric or tracing bridge will cause OpenCensus telemetry to be |
| 42 | +// exported by OpenTelemetry exporters. Since OpenCensus telemetry uses globals, |
| 43 | +// installing a bridge will result in telemetry collection from _all_ libraries |
| 44 | +// that use OpenCensus, including some you may not expect, such as the |
| 45 | +// telemetry exporter itself. |
| 46 | +// |
| 47 | +// # Limitations |
| 48 | +// |
| 49 | +// There are known limitations to the trace bridge: |
| 50 | +// |
| 51 | +// - The AddLink method for OpenCensus Spans is ignored, and an error is sent |
| 52 | +// to the OpenTelemetry ErrorHandler. |
| 53 | +// - The NewContext method of the OpenCensus Tracer cannot embed an OpenCensus |
| 54 | +// Span in a context unless that Span was created by that Tracer. |
| 55 | +// - Conversion of custom OpenCensus Samplers to OpenTelemetry is not |
| 56 | +// implemented, and An error will be sent to the OpenTelemetry ErrorHandler. |
| 57 | +// |
| 58 | +// There are known limitations to the metric bridge: |
| 59 | +// - Summary-typed metrics are dropped |
| 60 | +// - GaugeDistribution-typed metrics are dropped |
| 61 | +// - Histogram's SumOfSquaredDeviation field is dropped |
| 62 | +// - Exemplars on Histograms are dropped |
35 | 63 | package opencensus // import "go.opentelemetry.io/otel/bridge/opencensus"
|
0 commit comments