Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
Stackdriver exporter: add workload.googleapis.com as a supported exte…
Browse files Browse the repository at this point in the history
…rnal domain (#2106)

This allows metric descriptors to be created for metrics in that domain
  • Loading branch information
dashpole committed Sep 15, 2022
1 parent f9c76ae commit a37129e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ final class CreateMetricDescriptorExporter extends MetricExporter {
private static final Logger logger =
Logger.getLogger(CreateMetricDescriptorExporter.class.getName());
private static final ImmutableSet<String> SUPPORTED_EXTERNAL_DOMAINS =
ImmutableSet.<String>of("custom.googleapis.com", "external.googleapis.com");
ImmutableSet.<String>of(
"custom.googleapis.com", "external.googleapis.com", "workload.googleapis.com");
private static final String GOOGLE_APIS_DOMAIN_SUFFIX = "googleapis.com";

private final String projectId;
Expand Down Expand Up @@ -166,8 +167,8 @@ private static boolean isBuiltInMetric(String metricName) {
if (!metricDomain.endsWith(GOOGLE_APIS_DOMAIN_SUFFIX)) {
return false; // domains like "my.org" are not Stackdriver built-in metrics.
}
// All googleapis.com domains except "custom.googleapis.com" or "external.googleapis.com"
// are built-in metrics.
// All googleapis.com domains except "custom.googleapis.com", "external.googleapis.com",
// or "workload.googleapis.com" are built-in metrics.
return !SUPPORTED_EXTERNAL_DOMAINS.contains(metricDomain);
}
}

0 comments on commit a37129e

Please sign in to comment.