Fix AWS detectors to initialize singleton after statics (#3008)
This commit is contained in:
parent
8678b16b29
commit
9d4b123174
|
|
@ -25,14 +25,14 @@ public final class BeanstalkResource {
|
|||
|
||||
private static final Logger logger = Logger.getLogger(BeanstalkResource.class.getName());
|
||||
|
||||
private static final Resource INSTANCE = buildResource();
|
||||
|
||||
private static final String DEVELOPMENT_ID = "deployment_id";
|
||||
private static final String VERSION_LABEL = "version_label";
|
||||
private static final String ENVIRONMENT_NAME = "environment_name";
|
||||
private static final String BEANSTALK_CONF_PATH = "/var/elasticbeanstalk/xray/environment.conf";
|
||||
private static final JsonFactory JSON_FACTORY = new JsonFactory();
|
||||
|
||||
private static final Resource INSTANCE = buildResource();
|
||||
|
||||
/**
|
||||
* Returns a factory of a {@link Resource} which provides information about the current EC2
|
||||
* instance if running on AWS Elastic Beanstalk.
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ public final class Ec2Resource {
|
|||
|
||||
private static final Logger logger = Logger.getLogger(Ec2Resource.class.getName());
|
||||
|
||||
private static final Resource INSTANCE = buildResource();
|
||||
|
||||
private static final JsonFactory JSON_FACTORY = new JsonFactory();
|
||||
|
||||
private static final String DEFAULT_IMDS_ENDPOINT = "169.254.169.254";
|
||||
|
||||
private static final Resource INSTANCE = buildResource();
|
||||
|
||||
/**
|
||||
* Returns a @link Resource} which provides information about the current EC2 instance if running
|
||||
* on AWS EC2.
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ import java.util.logging.Logger;
|
|||
public final class EcsResource {
|
||||
private static final Logger logger = Logger.getLogger(EcsResource.class.getName());
|
||||
|
||||
private static final Resource INSTANCE = buildResource();
|
||||
|
||||
private static final String ECS_METADATA_KEY_V4 = "ECS_CONTAINER_METADATA_URI_V4";
|
||||
private static final String ECS_METADATA_KEY_V3 = "ECS_CONTAINER_METADATA_URI";
|
||||
|
||||
private static final Resource INSTANCE = buildResource();
|
||||
|
||||
/**
|
||||
* Returns a factory of a {@link Resource} which provides information about the current ECS
|
||||
* container if running on AWS ECS.
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@ import java.util.logging.Logger;
|
|||
public final class EksResource {
|
||||
private static final Logger logger = Logger.getLogger(EksResource.class.getName());
|
||||
|
||||
private static final Resource INSTANCE = buildResource();
|
||||
|
||||
static final String K8S_SVC_URL = "https://kubernetes.default.svc";
|
||||
static final String AUTH_CONFIGMAP_PATH = "/api/v1/namespaces/kube-system/configmaps/aws-auth";
|
||||
static final String CW_CONFIGMAP_PATH =
|
||||
|
|
@ -39,6 +37,8 @@ public final class EksResource {
|
|||
private static final String K8S_CERT_PATH =
|
||||
"/var/run/secrets/kubernetes.io/serviceaccount/ca.crt";
|
||||
|
||||
private static final Resource INSTANCE = buildResource();
|
||||
|
||||
/**
|
||||
* Returns a factory of a {@link Resource} which provides information about the current ECS
|
||||
* container if running on AWS EKS.
|
||||
|
|
|
|||
Loading…
Reference in New Issue