Skip to content

Commit aa586cb

Browse files
authored
Fix semconv template files (#1312)
* fix links * fix * fix template * fix template further * add generated resource file * fix the doc comments
1 parent 4db67d5 commit aa586cb

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

opentelemetry-semantic-conventions/scripts/generate-consts-from-spec.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ docker run --rm \
4343
--parameters conventions=resource
4444

4545
# Keep `SCHEMA_URL` key in sync with spec version
46-
sed -i '' "s/\(opentelemetry.io\/schemas\/\)[^\"]*\"/\1$SPEC_VERSION\"/" src/lib.rs
46+
sed -i "s/\(opentelemetry.io\/schemas\/\)[^\"]*\"/\1$SPEC_VERSION\"/" src/lib.rs
47+
48+
# handle doc generation failures
49+
sed -i 's/\[2\]\.$//' src/resource.rs # remove trailing [2] from few of the doc comments
4750

4851
cargo fmt

opentelemetry-semantic-conventions/scripts/templates/header_resource.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
//! The [resource semantic conventions] define a set of standardized attributes
44
//! to be used in `Resource`s.
55
//!
6-
//! [resource semantic conventions]: https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions
6+
//! [resource semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/resource
77
//!
88
//! ## Usage
99
//!
1010
//! ```
11-
//! use opentelemetry::sdk;
11+
//! use opentelemetry_sdk::{trace::{config, TracerProvider}, Resource};
1212
//! use opentelemetry_semantic_conventions as semconv;
1313
//!
14-
//! let _tracer = sdk::trace::TracerProvider::builder()
15-
//! .with_config(sdk::trace::config().with_resource(sdk::Resource::new(vec![
14+
//! let _tracer = TracerProvider::builder()
15+
//! .with_config(config().with_resource(Resource::new(vec![
1616
//! semconv::resource::SERVICE_NAME.string("my-service"),
1717
//! semconv::resource::SERVICE_NAMESPACE.string("my-namespace"),
1818
//! ])))

opentelemetry-semantic-conventions/scripts/templates/header_trace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! The [trace semantic conventions] define a set of standardized attributes to
44
//! be used in `Span`s.
55
//!
6-
//! [trace semantic conventions]: https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/trace/semantic_conventions
6+
//! [trace semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/trace
77
//!
88
//! ## Usage
99
//!

opentelemetry-semantic-conventions/src/resource.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//! The [resource semantic conventions] define a set of standardized attributes
1010
//! to be used in `Resource`s.
1111
//!
12-
//! [resource semantic conventions]: https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions
12+
//! [resource semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/resource
1313
//!
1414
//! ## Usage
1515
//!
@@ -99,7 +99,7 @@ pub const CLOUD_REGION: Key = Key::from_static_str("cloud.region");
9999
/// * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
100100
/// Take care not to use the "invoked ARN" directly but replace any
101101
/// [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
102-
/// with the resolved function version, as the same runtime instance may be invocable with
102+
/// with the resolved function version, as the same runtime instance may be invokable with
103103
/// multiple different aliases.
104104
/// * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
105105
/// * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) of the invoked function,

opentelemetry-semantic-conventions/src/trace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//! The [trace semantic conventions] define a set of standardized attributes to
1010
//! be used in `Span`s.
1111
//!
12-
//! [trace semantic conventions]: https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/trace/semantic_conventions
12+
//! [trace semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/trace
1313
//!
1414
//! ## Usage
1515
//!

0 commit comments

Comments
 (0)