public class MonitoredResourceUtil
Monitored resource construction utilities to detect resource type and add labels. Used by logging framework adapters to configure default resource. See usage in LoggingHandler.
Methods
getResource(String projectId, String resourceType)
public static MonitoredResource getResource(String projectId, String resourceType)
Build MonitoredResource based on detected resource type and populate it with labels following Monitored Resource Types documentation.
Name | Description |
projectId | String A string defining the project id |
resourceType | String A custom resource type |
Type | Description |
com.google.cloud.MonitoredResource | the created MonitoredResource |
getResourceEnhancers()
public static List<LoggingEnhancer> getResourceEnhancers()
Returns custom log entry enhancers (if available) for resource type.
Type | Description |
List<LoggingEnhancer> | custom log entry enhancers |
setEnvironmentGetter(ResourceTypeEnvironmentGetter getter)
protected static void setEnvironmentGetter(ResourceTypeEnvironmentGetter getter)
Method is intended to assist in testing MonitoredResourceUtil
class only.
Name | Description |
getter | ResourceTypeEnvironmentGetter A mocked environment getter for simulated test environments. |