Skip to content

Commit

Permalink
Merge branch 'main' into exporter-vector
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Aug 27, 2024
2 parents 4a28fdc + 7ad7ab3 commit e300506
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ pub mod logs_service_client {
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Expand All @@ -115,7 +115,7 @@ pub mod logs_service_client {
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
LogsServiceClient::new(InterceptedService::new(inner, interceptor))
}
Expand Down Expand Up @@ -191,7 +191,7 @@ pub mod logs_service_server {
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with LogsServiceServer.
#[async_trait]
pub trait LogsService: Send + Sync + 'static {
pub trait LogsService: std::marker::Send + std::marker::Sync + 'static {
/// For performance reasons, it is recommended to keep this RPC
/// alive for the entire life of the application.
async fn export(
Expand All @@ -206,14 +206,14 @@ pub mod logs_service_server {
/// OpenTelemetry and an collector, or between an collector and a central collector (in this
/// case logs are sent/received to/from multiple Applications).
#[derive(Debug)]
pub struct LogsServiceServer<T: LogsService> {
pub struct LogsServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T: LogsService> LogsServiceServer<T> {
impl<T> LogsServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
Expand Down Expand Up @@ -267,8 +267,8 @@ pub mod logs_service_server {
impl<T, B> tonic::codegen::Service<http::Request<B>> for LogsServiceServer<T>
where
T: LogsService,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
Expand Down Expand Up @@ -344,7 +344,7 @@ pub mod logs_service_server {
}
}
}
impl<T: LogsService> Clone for LogsServiceServer<T> {
impl<T> Clone for LogsServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
Expand All @@ -356,7 +356,9 @@ pub mod logs_service_server {
}
}
}
impl<T: LogsService> tonic::server::NamedService for LogsServiceServer<T> {
const NAME: &'static str = "opentelemetry.proto.collector.logs.v1.LogsService";
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "opentelemetry.proto.collector.logs.v1.LogsService";
impl<T> tonic::server::NamedService for LogsServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ pub mod metrics_service_client {
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Expand All @@ -115,7 +115,7 @@ pub mod metrics_service_client {
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
MetricsServiceClient::new(InterceptedService::new(inner, interceptor))
}
Expand Down Expand Up @@ -191,7 +191,7 @@ pub mod metrics_service_server {
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with MetricsServiceServer.
#[async_trait]
pub trait MetricsService: Send + Sync + 'static {
pub trait MetricsService: std::marker::Send + std::marker::Sync + 'static {
/// For performance reasons, it is recommended to keep this RPC
/// alive for the entire life of the application.
async fn export(
Expand All @@ -206,14 +206,14 @@ pub mod metrics_service_server {
/// instrumented with OpenTelemetry and a collector, or between a collector and a
/// central collector.
#[derive(Debug)]
pub struct MetricsServiceServer<T: MetricsService> {
pub struct MetricsServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T: MetricsService> MetricsServiceServer<T> {
impl<T> MetricsServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
Expand Down Expand Up @@ -267,8 +267,8 @@ pub mod metrics_service_server {
impl<T, B> tonic::codegen::Service<http::Request<B>> for MetricsServiceServer<T>
where
T: MetricsService,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
Expand Down Expand Up @@ -344,7 +344,7 @@ pub mod metrics_service_server {
}
}
}
impl<T: MetricsService> Clone for MetricsServiceServer<T> {
impl<T> Clone for MetricsServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
Expand All @@ -356,7 +356,9 @@ pub mod metrics_service_server {
}
}
}
impl<T: MetricsService> tonic::server::NamedService for MetricsServiceServer<T> {
const NAME: &'static str = "opentelemetry.proto.collector.metrics.v1.MetricsService";
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "opentelemetry.proto.collector.metrics.v1.MetricsService";
impl<T> tonic::server::NamedService for MetricsServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ pub mod trace_service_client {
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Expand All @@ -115,7 +115,7 @@ pub mod trace_service_client {
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
TraceServiceClient::new(InterceptedService::new(inner, interceptor))
}
Expand Down Expand Up @@ -191,7 +191,7 @@ pub mod trace_service_server {
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with TraceServiceServer.
#[async_trait]
pub trait TraceService: Send + Sync + 'static {
pub trait TraceService: std::marker::Send + std::marker::Sync + 'static {
/// For performance reasons, it is recommended to keep this RPC
/// alive for the entire life of the application.
async fn export(
Expand All @@ -206,14 +206,14 @@ pub mod trace_service_server {
/// OpenTelemetry and a collector, or between a collector and a central collector (in this
/// case spans are sent/received to/from multiple Applications).
#[derive(Debug)]
pub struct TraceServiceServer<T: TraceService> {
pub struct TraceServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T: TraceService> TraceServiceServer<T> {
impl<T> TraceServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
Expand Down Expand Up @@ -267,8 +267,8 @@ pub mod trace_service_server {
impl<T, B> tonic::codegen::Service<http::Request<B>> for TraceServiceServer<T>
where
T: TraceService,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
Expand Down Expand Up @@ -344,7 +344,7 @@ pub mod trace_service_server {
}
}
}
impl<T: TraceService> Clone for TraceServiceServer<T> {
impl<T> Clone for TraceServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
Expand All @@ -356,7 +356,9 @@ pub mod trace_service_server {
}
}
}
impl<T: TraceService> tonic::server::NamedService for TraceServiceServer<T> {
const NAME: &'static str = "opentelemetry.proto.collector.trace.v1.TraceService";
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "opentelemetry.proto.collector.trace.v1.TraceService";
impl<T> tonic::server::NamedService for TraceServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
4 changes: 4 additions & 0 deletions opentelemetry-stdout/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ license = "Apache-2.0"
edition = "2021"
rust-version = "1.65"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["trace", "metrics", "logs"]
trace = ["opentelemetry/trace", "opentelemetry_sdk/trace", "futures-util"]
Expand Down
5 changes: 5 additions & 0 deletions opentelemetry-stdout/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
//! # }
//! ```
#![warn(missing_debug_implementations, missing_docs)]
#![cfg_attr(
docsrs,
feature(doc_cfg, doc_auto_cfg),
deny(rustdoc::broken_intra_doc_links)
)]

pub(crate) mod common;

Expand Down

0 comments on commit e300506

Please sign in to comment.