Class CloudResource
- java.lang.Object
-
- io.opencensus.contrib.resource.util.CloudResource
-
public final class CloudResource extends java.lang.Object
Helper class for CloudResource
environment.- Since:
- 0.20
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACCOUNT_ID_KEY
Key for the cloud account id used to identify different entities.static java.lang.String
PROVIDER_AWS
The value of the provider when running in AWS.static java.lang.String
PROVIDER_AZURE
The value of the provider when running in AZURE.static java.lang.String
PROVIDER_GCP
The value of the provider when running in GCP.static java.lang.String
PROVIDER_KEY
Key for the name of the cloud provider.static java.lang.String
REGION_KEY
Key for the region in which entities are running.static java.lang.String
TYPE
The type of thisResource
.static java.lang.String
ZONE_KEY
Key for the zone in which entities are running.
-
Constructor Summary
Constructors Modifier Constructor Description private
CloudResource()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Resource
create(java.lang.String provider, java.lang.String accountId, java.lang.String region, java.lang.String zone)
Returns aResource
that describes a cloud environment.(package private) static Resource
detect()
-
-
-
Field Detail
-
TYPE
public static final java.lang.String TYPE
The type of thisResource
.- Since:
- 0.20
- See Also:
- Constant Field Values
-
PROVIDER_KEY
public static final java.lang.String PROVIDER_KEY
Key for the name of the cloud provider. Example values are aws, azure, gcp.- Since:
- 0.20
- See Also:
- Constant Field Values
-
PROVIDER_AWS
public static final java.lang.String PROVIDER_AWS
The value of the provider when running in AWS.- Since:
- 0.20
- See Also:
- Constant Field Values
-
PROVIDER_AZURE
public static final java.lang.String PROVIDER_AZURE
The value of the provider when running in AZURE.- Since:
- 0.20
- See Also:
- Constant Field Values
-
PROVIDER_GCP
public static final java.lang.String PROVIDER_GCP
The value of the provider when running in GCP.- Since:
- 0.20
- See Also:
- Constant Field Values
-
ACCOUNT_ID_KEY
public static final java.lang.String ACCOUNT_ID_KEY
Key for the cloud account id used to identify different entities.- Since:
- 0.20
- See Also:
- Constant Field Values
-
REGION_KEY
public static final java.lang.String REGION_KEY
Key for the region in which entities are running.- Since:
- 0.20
- See Also:
- Constant Field Values
-
ZONE_KEY
public static final java.lang.String ZONE_KEY
Key for the zone in which entities are running.- Since:
- 0.20
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static Resource create(java.lang.String provider, java.lang.String accountId, java.lang.String region, java.lang.String zone)
Returns aResource
that describes a cloud environment.- Parameters:
provider
- the name of the cloud provider.accountId
- the cloud account id used to identify different entities.region
- the region in which entities are running.zone
- the zone in which entities are running.- Returns:
- a
Resource
that describes a aws ec2 instance. - Since:
- 0.20
-
detect
static Resource detect()
-
-