Search in sources :

Example 1 with DefaultGcpProjectIdProvider

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));
}
Also used : DefaultGcpProjectIdProvider(com.google.cloud.spring.core.DefaultGcpProjectIdProvider) GcpProjectIdProvider(com.google.cloud.spring.core.GcpProjectIdProvider) DefaultGcpProjectIdProvider(com.google.cloud.spring.core.DefaultGcpProjectIdProvider)

Aggregations

DefaultGcpProjectIdProvider (com.google.cloud.spring.core.DefaultGcpProjectIdProvider)1 GcpProjectIdProvider (com.google.cloud.spring.core.GcpProjectIdProvider)1