-
Take a look at the config.yaml configuration file and run
otelcolwith this config locallyotelcol-contrib --config config.yaml
Notice there is no information about current host. At this point, if we have sent those metrics to external backend we would not be able to tell where they originated from.
-
Using the Resource Detection Processor add the
systemdetector -
Run otelcol - you should see the following resources added with
host.nameandos.typematching your machine:$ otelcol-contrib --config config.yaml ... Resource labels: -> host.name: STRING(lolcathost) -> os.type: STRING(linux)
-
Change the
hostname_sourcestoos, observe if it's different from thednsone -
Change the configuration to read the resource information from the
OTEL_RESOURCE_ATTRIBUTEenvironment variable -
Run the otelcol and observe how your resource information is added to data:
$ export OTEL_RESOURCE_ATTRIBUTES=somelabel=somevalue,otherlabel=othervalue $ otelcol-contrib --config.config.yaml ... Resource labels: -> somelabel: STRING(somevalue) -> otherlabel: STRING(othervalue) -> host.name: STRING(lolcathost) -> os.type: STRING(linux)
resourcedetection
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||