Skip to content

Commit 710b2b2

Browse files
Merge branch 'main' into re-export-tonic
2 parents 36fbc57 + 9dc727e commit 710b2b2

File tree

17 files changed

+98
-31
lines changed

17 files changed

+98
-31
lines changed

.cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@
2626
// workspace dictionary.
2727
"words": [
2828
"actix",
29+
"Antonsson",
2930
"anyvalue",
3031
"appender",
3132
"appenders",
3233
"autobenches",
3334
"Bhasin",
35+
"Björn",
3436
"BLRP",
3537
"Cijo",
3638
"clippy",

.github/workflows/ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,27 @@ jobs:
137137
egress-policy: audit
138138

139139
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
140-
- uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
140+
141+
- name: Check advisories
142+
uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
141143
with:
142144
command: check advisories
145+
146+
- name: Check licenses
147+
uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
148+
with:
149+
command: check licenses
150+
151+
- name: Check bans
152+
uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
153+
with:
154+
command: check bans
155+
156+
- name: Check sources
157+
uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
158+
with:
159+
command: check sources
160+
143161
docs:
144162
continue-on-error: true
145163
runs-on: ubuntu-latest

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ you're more than welcome to participate!
189189
### Approvers
190190

191191
* [Anton Grübel](https://github.com/gruebel), Baz
192+
* [Björn Antonsson](https://github.com/bantonsson), Datadog
192193
* [Shaun Cox](https://github.com/shaun-cox), Microsoft
193194
* [Scott Gerring](https://github.com/scottgerring), Datadog
194195

deny.toml

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,30 @@ allow = [
77
"Apache-2.0",
88
"ISC",
99
"BSD-3-Clause",
10-
"OpenSSL"
10+
]
11+
12+
exceptions = [
13+
{ allow = ["MPL-2.0"], crate = "webpki-roots" }, # This crate is a dependency of `reqwest`.
14+
{ allow = ["Unicode-3.0"], crate = "icu_collections" }, # This crate gets used transitively by `reqwest`.
15+
{ allow = ["Unicode-3.0"], crate = "icu_locid" }, # This crate gets used transitively by `reqwest`.
16+
{ allow = ["Unicode-3.0"], crate = "icu_locid_transform" }, # This crate gets used transitively by `reqwest`.
17+
{ allow = ["Unicode-3.0"], crate = "icu_locid_transform_data" }, # This crate gets used transitively by `reqwest`.
18+
{ allow = ["Unicode-3.0"], crate = "icu_normalizer" }, # This crate gets used transitively by `reqwest`.
19+
{ allow = ["Unicode-3.0"], crate = "icu_normalizer_data" }, # This crate gets used transitively by `reqwest`.
20+
{ allow = ["Unicode-3.0"], crate = "icu_properties" }, # This crate gets used transitively by `reqwest`.
21+
{ allow = ["Unicode-3.0"], crate = "icu_properties_data" }, # This crate gets used transitively by `reqwest`.
22+
{ allow = ["Unicode-3.0"], crate = "icu_provider" }, # This crate gets used transitively by `reqwest`.
23+
{ allow = ["Unicode-3.0"], crate = "icu_provider_macros" }, # This crate gets used transitively by `reqwest`.
24+
{ allow = ["Unicode-3.0"], crate = "litemap" }, # This crate gets used transitively by `reqwest`.
25+
{ allow = ["Unicode-3.0"], crate = "tinystr" }, # This crate gets used transitively by `reqwest`.
26+
{ allow = ["Unicode-3.0"], crate = "writeable" }, # This crate gets used transitively by `reqwest`.
27+
{ allow = ["Unicode-3.0"], crate = "unicode-ident" }, # This crate gets used transitively by `reqwest` and other crates.
28+
{ allow = ["Unicode-3.0"], crate = "yoke" }, # This crate gets used transitively by `reqwest`.
29+
{ allow = ["Unicode-3.0"], crate = "yoke-derive" }, # This crate gets used transitively by `reqwest`.
30+
{ allow = ["Unicode-3.0"], crate = "zerovec" }, # This crate gets used transitively by `reqwest`.
31+
{ allow = ["Unicode-3.0"], crate = "zerovec-derive" }, # This crate gets used transitively by `reqwest`.
32+
{ allow = ["Unicode-3.0"], crate = "zerofrom" }, # This crate gets used transitively by `reqwest`.
33+
{ allow = ["Unicode-3.0"], crate = "zerofrom-derive" }, # This crate gets used transitively by `reqwest`.
1134
]
1235

1336
[licenses.private]
@@ -21,6 +44,31 @@ license-files = [
2144
{ path = "LICENSE", hash = 0xbd0eed23 }
2245
]
2346

47+
# This section is considered when running `cargo deny check advisories`
48+
# More documentation for the advisories section can be found here:
49+
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
2450
[advisories]
2551
unmaintained = "none"
26-
yanked = "allow"
52+
yanked = "deny"
53+
54+
# This section is considered when running `cargo deny check bans`.
55+
# More documentation about the 'bans' section can be found here:
56+
# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html
57+
[bans]
58+
# Lint level for when multiple versions of the same crate are detected
59+
multiple-versions = "warn"
60+
# Lint level for when a crate version requirement is `*`
61+
wildcards = "warn"
62+
# The graph highlighting used when creating dotgraphs for crates
63+
# with multiple versions
64+
# * lowest-version - The path to the lowest versioned duplicate is highlighted
65+
# * simplest-path - The path to the version with the fewest edges is highlighted
66+
# * all - Both lowest-version and simplest-path are used
67+
highlight = "all"
68+
69+
# This section is considered when running `cargo deny check sources`.
70+
# More documentation about the 'sources' section can be found here:
71+
# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html
72+
[sources]
73+
unknown-registry = "deny"
74+
unknown-git = "deny"

opentelemetry-otlp/src/exporter/http/logs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use http::{header::CONTENT_TYPE, Method};
33
use opentelemetry::otel_debug;
44
use opentelemetry_sdk::error::{OTelSdkError, OTelSdkResult};
55
use opentelemetry_sdk::logs::{LogBatch, LogExporter};
6+
use std::time;
67

78
impl LogExporter for OtlpHttpClient {
89
async fn export(&self, batch: LogBatch<'_>) -> OTelSdkResult {
@@ -46,7 +47,7 @@ impl LogExporter for OtlpHttpClient {
4647
Ok(())
4748
}
4849

49-
fn shutdown(&self) -> OTelSdkResult {
50+
fn shutdown_with_timeout(&self, _timeout: time::Duration) -> OTelSdkResult {
5051
let mut client_guard = self.client.lock().map_err(|e| {
5152
OTelSdkError::InternalFailure(format!("Failed to acquire client lock: {}", e))
5253
})?;

opentelemetry-otlp/src/exporter/tonic/logs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use opentelemetry_proto::tonic::collector::logs::v1::{
55
};
66
use opentelemetry_sdk::error::{OTelSdkError, OTelSdkResult};
77
use opentelemetry_sdk::logs::{LogBatch, LogExporter};
8+
use std::time;
89
use tokio::sync::Mutex;
910
use tonic::{codegen::CompressionEncoding, service::Interceptor, transport::Channel, Request};
1011

@@ -84,7 +85,7 @@ impl LogExporter for TonicLogsClient {
8485
Ok(())
8586
}
8687

87-
fn shutdown(&self) -> OTelSdkResult {
88+
fn shutdown_with_timeout(&self, _timeout: time::Duration) -> OTelSdkResult {
8889
// TODO: Implement actual shutdown
8990
// Due to the use of tokio::sync::Mutex to guard
9091
// the inner client, we need to await the call to lock the mutex

opentelemetry-otlp/src/logs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
55
#[cfg(feature = "grpc-tonic")]
66
use opentelemetry::otel_debug;
7-
use std::fmt::Debug;
8-
97
use opentelemetry_sdk::{error::OTelSdkResult, logs::LogBatch};
8+
use std::fmt::Debug;
9+
use std::time;
1010

1111
use crate::{ExporterBuildError, HasExportConfig, NoExporterBuilderSet};
1212

@@ -157,7 +157,7 @@ impl opentelemetry_sdk::logs::LogExporter for LogExporter {
157157
}
158158
}
159159

160-
fn shutdown(&self) -> OTelSdkResult {
160+
fn shutdown_with_timeout(&self, _timeout: time::Duration) -> OTelSdkResult {
161161
match &self.client {
162162
#[cfg(feature = "grpc-tonic")]
163163
SupportedTransportClient::Tonic(client) => client.shutdown(),

opentelemetry-sdk/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ also modified to suppress telemetry before invoking exporters.
2525
- Fixed the overflow attribute to correctly use the boolean value `true`
2626
instead of the string `"true"`.
2727
[#2878](https://github.com/open-telemetry/opentelemetry-rust/issues/2878)
28+
- The `shutdown_with_timeout` method is added to LogExporter trait.
2829
- *Breaking* `MetricError`, `MetricResult` no longer public (except when
2930
`spec_unstable_metrics_views` feature flag is enabled). `OTelSdkResult` should
3031
be used instead, wherever applicable. [#2906](https://github.com/open-telemetry/opentelemetry-rust/pull/2906)

opentelemetry-sdk/benches/log_enabled.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ impl LogExporter for NoopExporter {
2929
Ok(())
3030
}
3131

32-
fn shutdown(&self) -> OTelSdkResult {
33-
Ok(())
34-
}
35-
3632
#[inline]
3733
fn event_enabled(
3834
&self,

opentelemetry-sdk/src/logs/export.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::Resource;
66
use opentelemetry::logs::Severity;
77
use opentelemetry::InstrumentationScope;
88
use std::fmt::Debug;
9+
use std::time;
910

1011
/// A batch of log records to be exported by a `LogExporter`.
1112
///
@@ -134,11 +135,14 @@ pub trait LogExporter: Send + Sync + Debug {
134135
&self,
135136
batch: LogBatch<'_>,
136137
) -> impl std::future::Future<Output = OTelSdkResult> + Send;
137-
138138
/// Shuts down the exporter.
139-
fn shutdown(&self) -> OTelSdkResult {
139+
fn shutdown_with_timeout(&self, _timeout: time::Duration) -> OTelSdkResult {
140140
Ok(())
141141
}
142+
/// Shuts down the exporter with a default timeout.
143+
fn shutdown(&self) -> OTelSdkResult {
144+
self.shutdown_with_timeout(time::Duration::from_secs(5))
145+
}
142146
#[cfg(feature = "spec_unstable_logs_enabled")]
143147
/// Check if logs are enabled.
144148
fn event_enabled(&self, _level: Severity, _target: &str, _name: Option<&str>) -> bool {

0 commit comments

Comments
 (0)