Skip to content

Commit

Permalink
build error
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb committed Nov 5, 2024
1 parent fa9237b commit f2b0156
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
6 changes: 1 addition & 5 deletions examples/self-diagnostics/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use opentelemetry::global::{self, Error as OtelError};
use opentelemetry::global;
use opentelemetry::KeyValue;
use opentelemetry_appender_tracing::layer;
use opentelemetry_otlp::{LogExporter, MetricExporter, WithExportConfig};
Expand All @@ -7,10 +7,6 @@ use tracing_subscriber::prelude::*;

use std::error::Error;

use once_cell::sync::Lazy;
use std::collections::HashSet;
use std::sync::{Arc, Mutex};

use std::sync::mpsc::channel;

fn init_logger_provider() -> opentelemetry_sdk::logs::LoggerProvider {
Expand Down
5 changes: 2 additions & 3 deletions opentelemetry-otlp/examples/basic-otlp-http/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
use once_cell::sync::Lazy;
use opentelemetry::{
global,
metrics::MetricError,
trace::{TraceContextExt, TraceError, Tracer},
InstrumentationScope, KeyValue,
};
Expand All @@ -11,7 +10,7 @@ use opentelemetry_otlp::WithExportConfig;
use opentelemetry_otlp::{LogExporter, MetricExporter, Protocol, SpanExporter};
use opentelemetry_sdk::{
logs::LoggerProvider,
metrics::{PeriodicReader, SdkMeterProvider},
metrics::{MetricError, PeriodicReader, SdkMeterProvider},
runtime,
trace::{self as sdktrace, Config, TracerProvider},
};
Expand All @@ -31,7 +30,7 @@ static RESOURCE: Lazy<Resource> = Lazy::new(|| {
)])
});

fn init_logs() -> Result<sdklogs::LoggerProvider, opentelemetry::logs::LogError> {
fn init_logs() -> Result<sdklogs::LoggerProvider, opentelemetry_sdk::logs::LogError> {
let exporter = LogExporter::builder()
.with_http()
.with_endpoint("http://localhost:4318/v1/logs")
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-otlp/examples/basic-otlp/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use once_cell::sync::Lazy;
use opentelemetry::logs::LogError;
use opentelemetry::metrics::MetricError;
use opentelemetry::trace::{TraceContextExt, TraceError, Tracer};
use opentelemetry::KeyValue;
use opentelemetry::{global, InstrumentationScope};
use opentelemetry_appender_tracing::layer::OpenTelemetryTracingBridge;
use opentelemetry_otlp::{LogExporter, MetricExporter, SpanExporter, WithExportConfig};
use opentelemetry_sdk::logs::LogError;
use opentelemetry_sdk::logs::LoggerProvider;
use opentelemetry_sdk::metrics::MetricError;
use opentelemetry_sdk::metrics::{PeriodicReader, SdkMeterProvider};
use opentelemetry_sdk::trace::Config;
use opentelemetry_sdk::{runtime, trace as sdktrace, Resource};
Expand Down
6 changes: 6 additions & 0 deletions opentelemetry-otlp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,12 @@ impl ExportError for Error {
}
}

impl opentelemetry::trace::ExportError for Error {
fn exporter_name(&self) -> &'static str {
"otlp"
}
}

/// The communication protocol to use when exporting data.
#[cfg_attr(feature = "serialize", derive(Deserialize, Serialize))]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-otlp/tests/integration_test/tests/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

use integration_test_runner::logs_asserter::{read_logs_from_json, LogsAsserter};
use log::{info, Level};
use opentelemetry::logs::LogError;
use opentelemetry::KeyValue;
use opentelemetry_appender_log::OpenTelemetryLogBridge;
use opentelemetry_otlp::{LogExporter, WithExportConfig};
use opentelemetry_sdk::logs::LogError;
use opentelemetry_sdk::logs::LoggerProvider;
use opentelemetry_sdk::{logs as sdklogs, runtime, Resource};
use std::error::Error;
Expand Down
6 changes: 6 additions & 0 deletions opentelemetry-zipkin/src/exporter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,9 @@ impl ExportError for Error {
"zipkin"
}
}

impl opentelemetry::trace::ExportError for Error {
fn exporter_name(&self) -> &'static str {
"zipkin"
}
}

0 comments on commit f2b0156

Please sign in to comment.