Class CloudResource

java.lang.Object
io.opencensus.contrib.resource.util.CloudResource

public final class CloudResource extends Object
Helper class for Cloud Resource environment.
Since:
0.20
  • Field Details

    • TYPE

      public static final String TYPE
      The type of this Resource.
      Since:
      0.20
      See Also:
    • PROVIDER_KEY

      public static final String PROVIDER_KEY
      Key for the name of the cloud provider. Example values are aws, azure, gcp.
      Since:
      0.20
      See Also:
    • PROVIDER_AWS

      public static final String PROVIDER_AWS
      The value of the provider when running in AWS.
      Since:
      0.20
      See Also:
    • PROVIDER_AZURE

      public static final String PROVIDER_AZURE
      The value of the provider when running in AZURE.
      Since:
      0.20
      See Also:
    • PROVIDER_GCP

      public static final String PROVIDER_GCP
      The value of the provider when running in GCP.
      Since:
      0.20
      See Also:
    • ACCOUNT_ID_KEY

      public static final String ACCOUNT_ID_KEY
      Key for the cloud account id used to identify different entities.
      Since:
      0.20
      See Also:
    • REGION_KEY

      public static final String REGION_KEY
      Key for the region in which entities are running.
      Since:
      0.20
      See Also:
    • ZONE_KEY

      public static final String ZONE_KEY
      Key for the zone in which entities are running.
      Since:
      0.20
      See Also:
  • Constructor Details

    • CloudResource

      private CloudResource()
  • Method Details

    • create

      public static Resource create(String provider, String accountId, String region, String zone)
      Returns a Resource 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()