forked from open-telemetry/opentelemetry-rust
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathresource.rs.j2
36 lines (33 loc) · 1.18 KB
/
resource.rs.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{%- import 'macros.j2' as attr_macros -%}
// DO NOT EDIT, this is an auto-generated file
//
// If you want to update the file:
// - Edit the template at scripts/templates/registry/rust/resource.rs.j2
// - Run the script at scripts/generate-consts-from-spec.sh
//! # Resource Semantic Conventions
//!
//! The [resource semantic conventions] define a set of standardized attributes
//! to be used in `Resource`s.
//!
//! [resource semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/resource
//!
//! ## Usage
//!
//! ```rust
//! use opentelemetry::KeyValue;
//! use opentelemetry_sdk::{trace::SdkTracerProvider, Resource};
//! use opentelemetry_semantic_conventions as semconv;
//!
//! let _tracer = SdkTracerProvider::builder()
//! .with_resource(Resource::builder_empty().with_service_name("my-service").build())
//! .build();
//! ```
{% for attr in ctx | rejectattr("name", "in", params.excluded_attributes) %}
{% if attr is experimental %}
#[cfg(feature = "semconv_experimental")]
{% endif %}
{% if attr is deprecated %}
#[allow(deprecated)]
{% endif %}
pub use crate::attribute::{{ attr.name | screaming_snake_case }};
{% endfor %}