Module resource

Source
Expand description

§Resource Semantic Conventions

The resource semantic conventions define a set of standardized attributes to be used in Resources.

§Usage

use opentelemetry::KeyValue;
use opentelemetry_sdk::{trace::{config, TracerProvider}, Resource};
use opentelemetry_semantic_conventions as semconv;

let _tracer = TracerProvider::builder()
    .with_config(config().with_resource(Resource::builder_empty().with_service_name("my-service").build()))
    .build();

Re-exports§

pub use crate::attribute::OTEL_SCOPE_NAME;
pub use crate::attribute::OTEL_SCOPE_VERSION;
pub use crate::attribute::SERVICE_NAME;
pub use crate::attribute::SERVICE_VERSION;
pub use crate::attribute::TELEMETRY_SDK_LANGUAGE;
pub use crate::attribute::TELEMETRY_SDK_NAME;
pub use crate::attribute::TELEMETRY_SDK_VERSION;
pub use crate::attribute::USER_AGENT_ORIGINAL;