Skip to content

Commit

Permalink
Fix semconv template files (#1312)
Browse files Browse the repository at this point in the history
* fix links

* fix

* fix template

* fix template further

* add generated resource file

* fix the doc comments
  • Loading branch information
lalitb committed Oct 22, 2023
1 parent 4db67d5 commit aa586cb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ docker run --rm \
--parameters conventions=resource

# Keep `SCHEMA_URL` key in sync with spec version
sed -i '' "s/\(opentelemetry.io\/schemas\/\)[^\"]*\"/\1$SPEC_VERSION\"/" src/lib.rs
sed -i "s/\(opentelemetry.io\/schemas\/\)[^\"]*\"/\1$SPEC_VERSION\"/" src/lib.rs

# handle doc generation failures
sed -i 's/\[2\]\.$//' src/resource.rs # remove trailing [2] from few of the doc comments

cargo fmt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
//! The [resource semantic conventions] define a set of standardized attributes
//! to be used in `Resource`s.
//!
//! [resource semantic conventions]: https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions
//! [resource semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/resource
//!
//! ## Usage
//!
//! ```
//! use opentelemetry::sdk;
//! use opentelemetry_sdk::{trace::{config, TracerProvider}, Resource};
//! use opentelemetry_semantic_conventions as semconv;
//!
//! let _tracer = sdk::trace::TracerProvider::builder()
//! .with_config(sdk::trace::config().with_resource(sdk::Resource::new(vec![
//! let _tracer = TracerProvider::builder()
//! .with_config(config().with_resource(Resource::new(vec![
//! semconv::resource::SERVICE_NAME.string("my-service"),
//! semconv::resource::SERVICE_NAMESPACE.string("my-namespace"),
//! ])))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! The [trace semantic conventions] define a set of standardized attributes to
//! be used in `Span`s.
//!
//! [trace semantic conventions]: https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/trace/semantic_conventions
//! [trace semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/trace
//!
//! ## Usage
//!
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-semantic-conventions/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! The [resource semantic conventions] define a set of standardized attributes
//! to be used in `Resource`s.
//!
//! [resource semantic conventions]: https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions
//! [resource semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/resource
//!
//! ## Usage
//!
Expand Down Expand Up @@ -99,7 +99,7 @@ pub const CLOUD_REGION: Key = Key::from_static_str("cloud.region");
/// * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
/// Take care not to use the "invoked ARN" directly but replace any
/// [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
/// with the resolved function version, as the same runtime instance may be invocable with
/// with the resolved function version, as the same runtime instance may be invokable with
/// multiple different aliases.
/// * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
/// * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) of the invoked function,
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-semantic-conventions/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! The [trace semantic conventions] define a set of standardized attributes to
//! be used in `Span`s.
//!
//! [trace semantic conventions]: https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/trace/semantic_conventions
//! [trace semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/trace
//!
//! ## Usage
//!
Expand Down

0 comments on commit aa586cb

Please sign in to comment.