public class MonitoredResourceUtil extends Object
LoggingHandler
.Modifier and Type | Class and Description |
---|---|
protected static class |
MonitoredResourceUtil.Label |
Modifier and Type | Field and Description |
---|---|
protected static String |
PORJECTID_LABEL |
Modifier and Type | Method and Description |
---|---|
static com.google.cloud.MonitoredResource |
getResource(String projectId,
String resourceType)
Build
MonitoredResource based on detected resource type and populate it with labels
following Monitored Resource Types documentation. |
static List<LoggingEnhancer> |
getResourceEnhancers()
Returns custom log entry enhancers (if available) for resource type.
|
protected static void |
setEnvironmentGetter(ResourceTypeEnvironmentGetter getter)
Method is intended to assist in testing
MonitoredResourceUtil class only. |
protected static final String PORJECTID_LABEL
protected static void setEnvironmentGetter(ResourceTypeEnvironmentGetter getter)
MonitoredResourceUtil
class only.getter
- A mocked environment getter for simulated test environments.public static com.google.cloud.MonitoredResource getResource(String projectId, String resourceType)
MonitoredResource
based on detected resource type and populate it with labels
following Monitored Resource Types documentation.projectId
- A string defining the project idresourceType
- A custom resource typeMonitoredResource
public static List<LoggingEnhancer> getResourceEnhancers()
Copyright © 2023 Google LLC. All rights reserved.