This library makes a best efforts to attempt to find suitable Monitored Resource type via uk.dansiviter.gcp.MonitoredResourceProvider#monitoredResource()
. See the JavaDoc for that class for further information on how to override.
For GKE with Workload Identity enabled there are only two items that cannot be found: Container Name and Namespace. However, that can be over come with:
...
spec:
containers:
- name: &containerName my-app # using anchor to keep inline
...
env:
- name: CONTAINER_NAME
value: *containerName
- name: NAMESPACE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.namespace
...