File tree 4 files changed +28
-5
lines changed
content/en/docs/languages/rust
4 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,12 @@ cSpell:ignore: chrono millis ostream
9
9
## OTLP endpoint
10
10
11
11
To send trace data to a OTLP endpoint (like the [ collector] ( /docs/collector ) or
12
- Jaeger) you'll want to use an exporter crate, such as ` opentelemetry_otlp ` :
12
+ Jaeger) you'll want to use an exporter crate, such as
13
+ [ opentelemetry-otlp] ( https://crates.io/crates/opentelemetry-otlp ) :
13
14
14
15
``` toml
15
16
[dependencies ]
16
- opentelemetry-otlp = { version = " 0.13 " , features = [" default" ] }
17
+ opentelemetry-otlp = { version = " {{% version-from-registry exporter-rust-otlp %}} " , features = [" default" ] }
17
18
```
18
19
19
20
Next, configure the exporter to point at an OTLP endpoint. For example you can
Original file line number Diff line number Diff line change @@ -103,11 +103,14 @@ Listening on 127.0.0.1:8080
103
103
## Instrumentation
104
104
105
105
To add OpenTelemetry to your application, update the ` Cargo.toml ` with the
106
- following additional dependencies:
106
+ dependencies for the OpenTelemetry Rust SDK
107
+ [ ` opentelemetry ` ] ( https://crates.io/crates/opentelemetry ) and the OpenTelemetry
108
+ Stdout Exporter
109
+ [ ` opentelemetry-stdout ` ] ( https://crates.io/crates/opentelemetry-stdout ) :
107
110
108
111
``` toml
109
- opentelemetry = { version = " 0.20 " , features = [" trace" ] }
110
- opentelemetry-stdout = { version = " 0.1 " , features = [" trace" ] }
112
+ opentelemetry = { version = " {{% version-from-registry otel-rust %}} " , features = [" trace" ] }
113
+ opentelemetry-stdout = { version = " {{% version-from-registry exporter-rust-stdout %}} " , features = [" trace" ] }
111
114
```
112
115
113
116
Update the ` dice_server.rs ` file with code to initialize a tracer and to emit
Original file line number Diff line number Diff line change @@ -10,3 +10,7 @@ authors:
10
10
urls :
11
11
repo : https://github.com/open-telemetry/opentelemetry-rust
12
12
createdAt : 2020-02-04
13
+ package :
14
+ registry : crates
15
+ name : opentelemetry
16
+ version : 0.21.0
Original file line number Diff line number Diff line change
1
+ {{ $name := (.Get 0) -}}
2
+
3
+ {{ with $name -}}
4
+ {{ with index $.Site.Data.registry . -}}
5
+ {{ with .package.version -}}
6
+ {{ . -}}
7
+ {{ else -}}
8
+ {{ errorf "No 'package.version' in registry entry %q: %s" $name $.Position -}}
9
+ {{ end -}}
10
+ {{ else -}}
11
+ {{ errorf "Registry entry %q not found: %s" $name $.Position -}}
12
+ {{ end -}}
13
+ {{ else -}}
14
+ {{ errorf "Shortcode parameter 'name' is missing %s: " $.Position -}}
15
+ {{ end -}}
You can’t perform that action at this time.
0 commit comments