use of com.google.cloud.spring.core.DefaultGcpProjectIdProvider in project spring-cloud-gcp by GoogleCloudPlatform.
the class StackdriverJsonLayout method start.
@Override
public void start() {
super.start();
// If no Project ID set, then attempt to resolve it with the default project ID provider
if (!StringUtils.hasText(this.projectId) || this.projectId.endsWith("_IS_UNDEFINED")) {
GcpProjectIdProvider projectIdProvider = new DefaultGcpProjectIdProvider();
this.projectId = projectIdProvider.getProjectId();
}
this.filteredMdcFields = new HashSet<>(Arrays.asList(traceIdMdcField, spanIdMdcField, StackdriverTraceConstants.MDC_FIELD_SPAN_EXPORT));
}
Aggregations