public static void createAndRegisterWithProjectId ( String projectId ) throws IOException { StackdriverTraceExporter . createAndRegister ( StackdriverTraceConfiguration . builder ( ) . setCredentials ( GoogleCredentials . getApplicationDefault ( ) ) . setProjectId ( projectId ) . build ( ) ) ; }
Creates and registers the Stackdriver Trace exporter to the OpenCensus library for an explicit project ID . Only one Stackdriver exporter can be registered at any point .