Resource Labels Pod ID and Namespace ID are using the Name not the ID properties #352
Labels
api: logging
Issues related to the googleapis/java-logging API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
The following values are incorrectly populated by
MonitoredResourceUtil
resoure.labels.pod_id
resoure.labels.namespace_id
The values being used are the name value of the respective entities, not the ID properties.
This is inconsistent with the Kubernetes API, and with other appenders used within GKE (e.g. the Fluentd appender), which properly populate the
pod_name
andnamespace_name
labels with themetadata.name
property.Expected Behavior
resoure.labels.pod_id
<-pod.metadata.uid
resoure.labels.namespace_id
<-namespace.metadata.uid
resoure.labels.pod_name
<-pod.metadata.name
resoure.labels.namespace_name
<-namespace.metadata.name
Impact
The present bug means that you must search in cloud logging with extra factually incorrect predicates like
and means certain Stackdriver log based metrics and filters are not possible due to this inaccuracy.
Since other GKE tools like the built in Fluentd appender properly set
resource.labels.pod_name
, example Fluentd output below:Environment details
Steps to reproduce
External references such as API reference guides
Any additional information below
While changing the
pod_id
value to the correctentity.metadata.uid
property would possibly impact library users, adding thepod_name
andnamespace_name
labels, with the correct values, would allow Cloud Logging users to properly search by the name labels across all logging sources.The text was updated successfully, but these errors were encountered: