Description
We have been using this client to write stackdriver logs for a 2-3 years. Those logs have been written as a global
resource type.
We have Stackdriver logging sinks exporting those logs to a Pub/Sub topic, with sink filters for the resource.type (among other things). Another application is collecting those logs for analytics.
We redeployed the application with the latest client a few days ago, and the aforementioned Pub/Sub topic stopped receiving messages. I just tracked it down to a change in behavior in this client (we didn't notice it at first, and when we did tracking it down was difficult).
Logs from the current client are now logging stored with a resource.type of k8s_container
.
It looks like the change is in this PR #200
Steps to reproduce
- Run the code below using google-cloud-logging==2.2.0 in GKE
- Upgrade google-cloud-logging to 2.3.0
- Run the code in GKE again
- Notice the resource.type changes from
global
tok8s_container
Code example
import google.cloud.logging
client = google.cloud.logging.Client(project='test-project')
logger = client.logger('test-log')
logger.log_struct(dict(foo='bar'))
The resource.type is indexed in cloud logging, and used in possibly every example log filter in the google docs. I have to believe others will be affected by this breaking change.
See, for example: https://cloud.google.com/logging/docs/view/advanced-queries