14
14
* limitations under the License.
15
15
*/
16
16
17
- package io .grpc .observability ;
17
+ package io .grpc .gcp . observability ;
18
18
19
19
import static com .google .common .base .Preconditions .checkNotNull ;
20
20
21
21
import com .google .common .annotations .VisibleForTesting ;
22
22
import io .grpc .ExperimentalApi ;
23
23
import 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 ;
24
30
import 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 ;
31
31
import java .io .IOException ;
32
32
33
- /** The main class for gRPC Observability features. */
33
+ /** The main class for gRPC Google Cloud Platform Observability features. */
34
34
@ 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 ;
37
37
private final Sink sink ;
38
38
39
39
/**
40
40
* Initialize grpc-observability.
41
41
*
42
42
* @throws ProviderNotFoundException if no underlying channel/server provider is available.
43
43
*/
44
- public static synchronized Observability grpcInit () throws IOException {
44
+ public static synchronized GcpObservability grpcInit () throws IOException {
45
45
if (instance == null ) {
46
46
GlobalLoggingTags globalLoggingTags = new GlobalLoggingTags ();
47
47
ObservabilityConfigImpl observabilityConfig = ObservabilityConfigImpl .getInstance ();
@@ -56,21 +56,21 @@ public static synchronized Observability grpcInit() throws IOException {
56
56
return instance ;
57
57
}
58
58
59
- @ VisibleForTesting static Observability grpcInit (Sink sink ,
59
+ @ VisibleForTesting static GcpObservability grpcInit (Sink sink ,
60
60
InternalLoggingChannelInterceptor .Factory channelInterceptorFactory ,
61
61
InternalLoggingServerInterceptor .Factory serverInterceptorFactory ) {
62
62
if (instance == null ) {
63
- instance = new Observability (sink , channelInterceptorFactory , serverInterceptorFactory );
63
+ instance = new GcpObservability (sink , channelInterceptorFactory , serverInterceptorFactory );
64
64
}
65
65
return instance ;
66
66
}
67
67
68
68
/** Un-initialize/shutdown grpc-observability. */
69
69
@ Override
70
70
public void close () {
71
- synchronized (Observability .class ) {
71
+ synchronized (GcpObservability .class ) {
72
72
if (instance == null ) {
73
- throw new IllegalStateException ("Observability already closed!" );
73
+ throw new IllegalStateException ("GcpObservability already closed!" );
74
74
}
75
75
LoggingChannelProvider .shutdown ();
76
76
LoggingServerProvider .shutdown ();
@@ -79,7 +79,7 @@ public void close() {
79
79
}
80
80
}
81
81
82
- private Observability (Sink sink ,
82
+ private GcpObservability (Sink sink ,
83
83
InternalLoggingChannelInterceptor .Factory channelInterceptorFactory ,
84
84
InternalLoggingServerInterceptor .Factory serverInterceptorFactory ) {
85
85
this .sink = checkNotNull (sink );
0 commit comments