Skip to content

Commit ee00eb5

Browse files
committed
feat: remove with_service_name for further discussion
1 parent 155f875 commit ee00eb5

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

opentelemetry-sdk/src/resource/builder.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::time::Duration;
22

3-
use opentelemetry::{KeyValue, Value};
3+
use opentelemetry::KeyValue;
44

5-
use super::{Resource, ResourceDetector, SERVICE_NAME};
5+
use super::{Resource, ResourceDetector};
66

77
/// Builder to allow easy composition of a Resource
88
#[derive(Debug)]
@@ -45,14 +45,6 @@ impl ResourceBuilder {
4545
self.with_key_values(vec![kv])
4646
}
4747

48-
/// Add an [Attribute] to your resource for "service.name"
49-
pub fn with_service_name<V>(self, service_name: V) -> Self
50-
where
51-
V: Into<Value>,
52-
{
53-
self.with_key_value(KeyValue::new(SERVICE_NAME, service_name))
54-
}
55-
5648
/// Add multiple [KeyValue]s to the resource.
5749
pub fn with_key_values<T: IntoIterator<Item = KeyValue>>(mut self, kvs: T) -> Self {
5850
self.resource = self.resource.merge(&Resource::new(kvs));
@@ -86,7 +78,6 @@ mod tests {
8678
|| {
8779
let resource = Resource::builder()
8880
.with_detector(Box::new(EnvResourceDetector::new()))
89-
.with_service_name("my_test_service_name")
9081
.with_key_value(KeyValue::new("test1", "test_value"))
9182
.with_key_values(vec![
9283
KeyValue::new("test1", "test_value1"),
@@ -98,7 +89,6 @@ mod tests {
9889
resource,
9990
Resource::new(vec![
10091
KeyValue::new("key", "value"),
101-
KeyValue::new(SERVICE_NAME, "my_test_service_name"),
10292
KeyValue::new("test1", "test_value1"),
10393
KeyValue::new("test2", "test_value2"),
10494
KeyValue::new("k", "v"),

0 commit comments

Comments
 (0)