Skip to content

Commit c205770

Browse files
authored
Standardize container, host, process, and service resource detectors (#199)
1 parent b68188b commit c205770

File tree

3 files changed

+38
-22
lines changed

3 files changed

+38
-22
lines changed

examples/kitchen-sink.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -839,18 +839,14 @@ resource:
839839
# Resource detector names are dependent on the SDK language ecosystem. Please consult documentation for each respective language.
840840
# If omitted or null, no resource detectors are enabled.
841841
detectors:
842-
- # Enable the container resource detector.
843-
# Note, the key "container" is an example and detector names may vary by SDK language ecosystem.
842+
- # Enable the container resource detector, which populates container.* attributes.
844843
container:
845-
- # Enable the host resource detector.
846-
# Note, the key "host" is an example and detector names may vary by SDK language ecosystem.
844+
- # Enable the host resource detector, which populates host.* and os.* attributes.
847845
host:
848-
- # Enable the os resource detector.
849-
# Note, the key "os" is an example and detector names may vary by SDK language ecosystem.
850-
os:
851-
- # Enable the process resource detector.
852-
# Note, the key "process" is an example and detector names may vary by SDK language ecosystem.
846+
- # Enable the process resource detector, which populates process.* attributes.
853847
process:
848+
- # Enable the service detector, which populates service.name based on the OTEL_SERVICE_NAME environment variable and service.instance.id.
849+
service:
854850
# Configure resource schema URL.
855851
# If omitted or null, no schema URL is used.
856852
schema_url: https://opentelemetry.io/schemas/1.16.0

schema/resource.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,38 @@
8282
"minProperties": 1,
8383
"maxProperties": 1,
8484
"patternProperties": {
85+
"container": {
86+
"$ref": "#/$defs/ExperimentalContainerResourceDetector"
87+
},
88+
"host": {
89+
"$ref": "#/$defs/ExperimentalHostResourceDetector"
90+
},
91+
"process": {
92+
"$ref": "#/$defs/ExperimentalProcessResourceDetector"
93+
},
94+
"service": {
95+
"$ref": "#/$defs/ExperimentalServiceResourceDetector"
96+
},
8597
".*": {
8698
"type": ["object", "null"]
8799
}
88100
}
101+
},
102+
"ExperimentalContainerResourceDetector": {
103+
"type": ["object", "null"],
104+
"additionalProperties": false
105+
},
106+
"ExperimentalHostResourceDetector": {
107+
"type": ["object", "null"],
108+
"additionalProperties": false
109+
},
110+
"ExperimentalProcessResourceDetector": {
111+
"type": ["object", "null"],
112+
"additionalProperties": false
113+
},
114+
"ExperimentalServiceResourceDetector": {
115+
"type": ["object", "null"],
116+
"additionalProperties": false
89117
}
90118
}
91119
}

schema/type_descriptions.yaml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,13 @@
9797
- type: Detector
9898
property_descriptions:
9999
container: >
100-
Enable the container resource detector.
101-
102-
Note, the key "container" is an example and detector names may vary by SDK language ecosystem.
100+
Enable the container resource detector, which populates container.* attributes.
103101
host: >
104-
Enable the host resource detector.
105-
106-
Note, the key "host" is an example and detector names may vary by SDK language ecosystem.
107-
os: >
108-
Enable the os resource detector.
109-
110-
Note, the key "os" is an example and detector names may vary by SDK language ecosystem.
102+
Enable the host resource detector, which populates host.* and os.* attributes.
111103
process: >
112-
Enable the process resource detector.
113-
114-
Note, the key "process" is an example and detector names may vary by SDK language ecosystem.
104+
Enable the process resource detector, which populates process.* attributes.
105+
service: >
106+
Enable the service detector, which populates service.name based on the OTEL_SERVICE_NAME environment variable and service.instance.id.
115107
path_patterns:
116108
- .resource.detection/development.detectors[]
117109

0 commit comments

Comments
 (0)