-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
confgenerator: add resource_name label using modify fields. #544
confgenerator: add resource_name label using modify fields. #544
Conversation
@@ -209,7 +209,7 @@ func (l *Logging) generateFluentbitComponents(userAgent string, hostInfo *host.I | |||
} | |||
components = append(components, processor.Components(tag, strconv.Itoa(i))...) | |||
} | |||
components = append(components, setLogNameComponents(tag, rID, receiver.Type())...) | |||
components = append(components, setLogNameComponents(tag, rID, receiver.Type(), hostInfo.Hostname)...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hostname isn't necessarily the same as the instance name - the resource name has to come from the GCE metadata server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went back to explore the initial discussion (b/169784211#comment18) with @igorpeshansky and @qingling128 about this task and realized why it was ok to use hostInfo.Hostname
.
The value that is used in google-fluentd
(which this feature wants to mirror) is actually the Socket.gethostname
which is equivalent of getting os.Hostname
in go with gopsutil
.
What do you think @quentinmit ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking! Yeah, having the same behavior as Fluentd is sufficient for now.
fabefab
to
341bf44
Compare
e0e2825
to
260735b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
149aac2
to
485c65f
Compare
Set label name to `compute.googleapis.com/resource_name` and set label using `DefaultValue` for `modify_fields`.
f9c44ed
to
93021a6
Compare
b/169784211