pub fn get_resource(service_name: &str, attributes: &[KeyValue]) -> ResourceExpand description
Creates a resource with the given service name and attributes.
This function builds an OpenTelemetry resource that identifies your service and includes any additional attributes you want to track.
§Arguments
service_name- The name of your serviceattributes- Additional key-value pairs to include in the resource
§Examples
use otel_init::get_resource;
use opentelemetry::KeyValue;
let resource = get_resource(
"my-service",
&[KeyValue::new("environment", "production")],
);