Skip to content

Commit

Permalink
Bump major versions and fix breakjing changes to unstable components. F…
Browse files Browse the repository at this point in the history
…ixes #101 (#102)
  • Loading branch information
jsuereth authored Apr 9, 2021
1 parent d9dee13 commit 6e7d20a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ subprojects {
autoServiceVersion = '1.0-rc7'
autoValueVersion = '1.7.4'
slf4jVersion = '1.7.30'
googleCloudVersion = '1.0.2'
cloudMonitoringVersion = '2.0.1'
openTelemetryVersion = '1.0.1'
googleCloudVersion = '1.3.0'
cloudMonitoringVersion = '2.1.0'
openTelemetryVersion = '1.1.0'
openTelemetryInstrumentationVersion = '1.0.1'
junitVersion = '4.13'
mockitoVersion = '3.5.10'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Attributes getAttributes() {
// Example zone: australia-southeast1-a
String zone = metadata.getZone();
if (zone != null) {
attrBuilders.put(ResourceAttributes.CLOUD_ZONE, zone);
attrBuilders.put(ResourceAttributes.CLOUD_AVAILABILITY_ZONE, zone);

// Parsing required to scope up to a region
String[] splitArr = zone.split("-");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void testGCEResourceWithGCEAttributesSucceeds() {
new Object[][] {
{ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP},
{ResourceAttributes.CLOUD_ACCOUNT_ID, "GCE-pid"},
{ResourceAttributes.CLOUD_ZONE, "country-region-zone"},
{ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"},
{ResourceAttributes.CLOUD_REGION, "country-region"},
{ResourceAttributes.HOST_ID, "GCE-instance-id"},
{ResourceAttributes.HOST_NAME, "GCE-instance-name"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void testGKEResourceWithGKEAttributesSucceeds() {
new Object[][] {
{ResourceAttributes.CLOUD_PROVIDER, "gcp"},
{ResourceAttributes.CLOUD_ACCOUNT_ID, "GCE-pid"},
{ResourceAttributes.CLOUD_ZONE, "country-region-zone"},
{ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"},
{ResourceAttributes.CLOUD_REGION, "country-region"},
{ResourceAttributes.HOST_ID, "GCE-instance-id"},
{ResourceAttributes.HOST_NAME, "GCE-instance-name"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class MetricTranslator {
new Object[][] {
{"project_id", ResourceAttributes.CLOUD_ACCOUNT_ID},
{"instance_id", ResourceAttributes.HOST_ID},
{"zone", ResourceAttributes.CLOUD_ZONE}
{"zone", ResourceAttributes.CLOUD_AVAILABILITY_ZONE}
})
.collect(
Collectors.toMap(data -> (String) data[0], data -> (AttributeKey<String>) data[1]));
Expand All @@ -82,7 +82,7 @@ public class MetricTranslator {
{"instance_id", ResourceAttributes.HOST_ID},
{"pod_id", ResourceAttributes.K8S_POD_NAME},
{"container_name", ResourceAttributes.K8S_CONTAINER_NAME},
{"zone", ResourceAttributes.CLOUD_ZONE}
{"zone", ResourceAttributes.CLOUD_AVAILABILITY_ZONE}
})
.collect(
Collectors.toMap(data -> (String) data[0], data -> (AttributeKey<String>) data[1]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;
import java.util.Collections;
import java.util.Date;

Expand All @@ -48,10 +49,10 @@ public class FakeData {

static final Attributes someGceAttributes =
Attributes.builder()
.put("cloud.account.id", aProjectId)
.put("host.id", aHostId)
.put("cloud.zone", aCloudZone)
.put("cloud.provider", "gcp")
.put(ResourceAttributes.CLOUD_ACCOUNT_ID, aProjectId)
.put(ResourceAttributes.HOST_ID, aHostId)
.put(ResourceAttributes.CLOUD_AVAILABILITY_ZONE, aCloudZone)
.put(ResourceAttributes.CLOUD_PROVIDER, "gcp")
.put("extra_info", "extra")
.put("not_gcp_resource", "value")
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void testMapResourcesWithGCEResource() {
new Object[][] {
{ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP},
{ResourceAttributes.CLOUD_ACCOUNT_ID, "GCE-pid"},
{ResourceAttributes.CLOUD_ZONE, "country-region-zone"},
{ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"},
{ResourceAttributes.CLOUD_REGION, "country-region"},
{ResourceAttributes.HOST_ID, "GCE-instance-id"},
{ResourceAttributes.HOST_NAME, "GCE-instance-name"},
Expand Down Expand Up @@ -176,7 +176,7 @@ public void testMapResourcesWithGKEResource() {
new Object[][] {
{ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP},
{ResourceAttributes.CLOUD_ACCOUNT_ID, "GCE-pid"},
{ResourceAttributes.CLOUD_ZONE, "country-region-zone"},
{ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"},
{ResourceAttributes.CLOUD_REGION, "country-region"},
{ResourceAttributes.HOST_ID, "GCE-instance-id"},
{ResourceAttributes.HOST_NAME, "GCE-instance-name"},
Expand Down

0 comments on commit 6e7d20a

Please sign in to comment.