I have used this to set the host.name…
resourcedetection/system:
detectors: [system]
timeout: 5s
override: false
system:
hostname_sources: [os]
resource_attributes:
host.name:
enabled: true
host.id:
enabled: true
and I’m trying to set a new key called “HOSTNAME” using the value of host.name…
attributes/add:
actions:
– key: “PROJECT_ID”
action: insert
value: “Calypso”
– key: “HOSTNAME”
action: upsert
from_attribute: host.name
#value: “hostname-test”
– key: “SERVICE”
action: insert
value: “service-test”
– key: “COMPONENT”
action: insert
value: “component-test”
I’ve done the pipeline config as well.
I’m using a file exporter for debugging.
In the file I can see that host/name is set fine, but HOSTNAME doesn’t exist. From my reading it seems that it doesn’t set it if the value of the key being used is not defined.
What am I doing wrong?
I’ve tried using a static value and the new key does get set, but once I try to use an existing key then nothing happens.
Bill Holder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.