Skip to content

Commit

Permalink
Nit fixes to Resource docs (open-telemetry#1796)
Browse files Browse the repository at this point in the history
Co-authored-by: Zhongyang Wu <[email protected]>
  • Loading branch information
cijothomas and TommyCpp authored May 21, 2024
1 parent 21bc36c commit 5937065
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"reqwest",
"runtimes",
"rustc",
"shoppingcart",
"Tescher",
"tracerprovider",
"Zhongyang",
Expand Down
8 changes: 3 additions & 5 deletions opentelemetry-sdk/src/resource/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ use std::time::Duration;
const OTEL_RESOURCE_ATTRIBUTES: &str = "OTEL_RESOURCE_ATTRIBUTES";
const OTEL_SERVICE_NAME: &str = "OTEL_SERVICE_NAME";

/// Resource detector implements ResourceDetector and is used to extract
/// general SDK configuration from environment.
///
/// See
/// [semantic conventions](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#specifying-resource-information-via-an-environment-variable)
/// EnvResourceDetector extract resource from environment variable
/// `OTEL_RESOURCE_ATTRIBUTES`. See [OpenTelemetry Resource
/// Spec](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#specifying-resource-information-via-an-environment-variable)
/// for details.
#[derive(Debug)]
pub struct EnvResourceDetector {
Expand Down
5 changes: 3 additions & 2 deletions opentelemetry-sdk/src/resource/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
//! - [`EnvResourceDetector`] - detect resource from environmental variables.
//! - [`TelemetryResourceDetector`] - detect telemetry SDK's information.
//!
//! The OS and Process resource detectors are now packaged separately in the `opentelemetry-resource-detector` [crate](https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-resource-detectors).
//! The OS and Process resource detectors are packaged separately in the
//! [`opentelemetry-resource-detector` crate](https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-resource-detectors).
mod env;
mod telemetry;

Expand Down Expand Up @@ -208,7 +209,7 @@ impl Resource {
self.inner.attrs.is_empty()
}

/// Gets an iterator over the attributes of this resource, sorted by key.
/// Gets an iterator over the attributes of this resource.
pub fn iter(&self) -> Iter<'_> {
Iter(self.inner.attrs.iter())
}
Expand Down
3 changes: 1 addition & 2 deletions opentelemetry-sdk/src/resource/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ use std::time::Duration;
/// - The language of the telemetry SDK(`telemetry.sdk.language`). It will be `rust` for this SDK.
/// - The version of the telemetry SDK(`telemetry.sdk.version`). It will be current `opentelemetry_sdk` crate version.
///
/// Note that the `telemetry.auto.version` is not provided as of now.
///
/// See [semantic conventions](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#telemetry-sdk) for details.
/// See [semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/README.md#telemetry-sdk) for details.
#[derive(Debug)]
pub struct TelemetryResourceDetector;

Expand Down

0 comments on commit 5937065

Please sign in to comment.