Skip to content

Commit c8ccc0f

Browse files
committed
nits
1 parent 8bdd564 commit c8ccc0f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

opentelemetry-otlp/examples/basic-otlp-http/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn init_logs() -> Result<sdklogs::LoggerProvider, opentelemetry_sdk::logs::LogEr
4343
.build())
4444
}
4545

46-
fn init_tracer_provider() -> Result<sdktrace::TracerProvider, TraceError> {
46+
fn init_traces() -> Result<sdktrace::TracerProvider, TraceError> {
4747
let exporter = SpanExporter::builder()
4848
.with_http()
4949
.with_protocol(Protocol::HttpBinary) //can be changed to `Protocol::HttpJson` to export in JSON format
@@ -71,7 +71,7 @@ fn init_metrics() -> Result<opentelemetry_sdk::metrics::SdkMeterProvider, Metric
7171

7272
#[tokio::main]
7373
async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
74-
let tracer_provider = init_tracer_provider()?;
74+
let tracer_provider = init_traces()?;
7575
global::set_tracer_provider(tracer_provider.clone());
7676

7777
let meter_provider = init_metrics()?;

opentelemetry-otlp/examples/basic-otlp/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ The example employs a `BatchExporter` for logs and traces, which is the
1414
recommended approach when using OTLP exporters. While it can be modified to use
1515
a `SimpleExporter`, this requires the main method to be a `tokio::main` function
1616
since the `tonic` client requires a Tokio runtime. If you prefer not to use
17-
`tokio::main`, the `init_logs`, `init_traces`, and `init_metrics` functions
18-
should be executed within a Tokio runtime. Below is an example:
17+
`tokio::main`, then the `init_logs`, `init_traces`, and `init_metrics` functions
18+
must be executed within a Tokio runtime. Below is an example:
1919

2020
```rust
2121
fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {

opentelemetry-otlp/examples/basic-otlp/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static RESOURCE: Lazy<Resource> = Lazy::new(|| {
2121
)])
2222
});
2323

24-
fn init_tracer_provider() -> Result<sdktrace::TracerProvider, TraceError> {
24+
fn init_traces() -> Result<sdktrace::TracerProvider, TraceError> {
2525
let exporter = SpanExporter::builder()
2626
.with_tonic()
2727
.with_endpoint("http://localhost:4317")
@@ -57,7 +57,7 @@ fn init_logs() -> Result<opentelemetry_sdk::logs::LoggerProvider, LogError> {
5757

5858
#[tokio::main]
5959
async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
60-
let tracer_provider = init_tracer_provider()?;
60+
let tracer_provider = init_traces()?;
6161
global::set_tracer_provider(tracer_provider.clone());
6262

6363
let meter_provider = init_metrics()?;

0 commit comments

Comments
 (0)