1414 * limitations under the License.
1515 */
1616
17- package io .grpc .observability ;
17+ package io .grpc .gcp . observability ;
1818
1919import static com .google .common .base .Preconditions .checkNotNull ;
2020
2121import com .google .common .annotations .VisibleForTesting ;
2222import io .grpc .ExperimentalApi ;
2323import io .grpc .ManagedChannelProvider .ProviderNotFoundException ;
24+ import io .grpc .gcp .observability .interceptors .ConfigFilterHelper ;
25+ import io .grpc .gcp .observability .interceptors .InternalLoggingChannelInterceptor ;
26+ import io .grpc .gcp .observability .interceptors .InternalLoggingServerInterceptor ;
27+ import io .grpc .gcp .observability .interceptors .LogHelper ;
28+ import io .grpc .gcp .observability .logging .GcpLogSink ;
29+ import io .grpc .gcp .observability .logging .Sink ;
2430import io .grpc .internal .TimeProvider ;
25- import io .grpc .observability .interceptors .ConfigFilterHelper ;
26- import io .grpc .observability .interceptors .InternalLoggingChannelInterceptor ;
27- import io .grpc .observability .interceptors .InternalLoggingServerInterceptor ;
28- import io .grpc .observability .interceptors .LogHelper ;
29- import io .grpc .observability .logging .GcpLogSink ;
30- import io .grpc .observability .logging .Sink ;
3131import java .io .IOException ;
3232
33- /** The main class for gRPC Observability features. */
33+ /** The main class for gRPC Google Cloud Platform Observability features. */
3434@ ExperimentalApi ("https://github.com/grpc/grpc-java/issues/8869" )
35- public final class Observability implements AutoCloseable {
36- private static Observability instance = null ;
35+ public final class GcpObservability implements AutoCloseable {
36+ private static GcpObservability instance = null ;
3737 private final Sink sink ;
3838
3939 /**
4040 * Initialize grpc-observability.
4141 *
4242 * @throws ProviderNotFoundException if no underlying channel/server provider is available.
4343 */
44- public static synchronized Observability grpcInit () throws IOException {
44+ public static synchronized GcpObservability grpcInit () throws IOException {
4545 if (instance == null ) {
4646 GlobalLoggingTags globalLoggingTags = new GlobalLoggingTags ();
4747 ObservabilityConfigImpl observabilityConfig = ObservabilityConfigImpl .getInstance ();
@@ -56,21 +56,21 @@ public static synchronized Observability grpcInit() throws IOException {
5656 return instance ;
5757 }
5858
59- @ VisibleForTesting static Observability grpcInit (Sink sink ,
59+ @ VisibleForTesting static GcpObservability grpcInit (Sink sink ,
6060 InternalLoggingChannelInterceptor .Factory channelInterceptorFactory ,
6161 InternalLoggingServerInterceptor .Factory serverInterceptorFactory ) {
6262 if (instance == null ) {
63- instance = new Observability (sink , channelInterceptorFactory , serverInterceptorFactory );
63+ instance = new GcpObservability (sink , channelInterceptorFactory , serverInterceptorFactory );
6464 }
6565 return instance ;
6666 }
6767
6868 /** Un-initialize/shutdown grpc-observability. */
6969 @ Override
7070 public void close () {
71- synchronized (Observability .class ) {
71+ synchronized (GcpObservability .class ) {
7272 if (instance == null ) {
73- throw new IllegalStateException ("Observability already closed!" );
73+ throw new IllegalStateException ("GcpObservability already closed!" );
7474 }
7575 LoggingChannelProvider .shutdown ();
7676 LoggingServerProvider .shutdown ();
@@ -79,7 +79,7 @@ public void close() {
7979 }
8080 }
8181
82- private Observability (Sink sink ,
82+ private GcpObservability (Sink sink ,
8383 InternalLoggingChannelInterceptor .Factory channelInterceptorFactory ,
8484 InternalLoggingServerInterceptor .Factory serverInterceptorFactory ) {
8585 this .sink = checkNotNull (sink );
0 commit comments