|
|
@ -40,7 +40,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "src/cpp/ext/filters/census/grpc_plugin.h" |
|
|
|
#include "src/cpp/ext/filters/census/grpc_plugin.h" |
|
|
|
#include "src/cpp/ext/filters/census/open_census_call_tracer.h" |
|
|
|
#include "src/cpp/ext/filters/census/open_census_call_tracer.h" |
|
|
|
|
|
|
|
#include "src/cpp/ext/filters/logging/logging_filter.h" |
|
|
|
#include "src/cpp/ext/gcp/observability_config.h" |
|
|
|
#include "src/cpp/ext/gcp/observability_config.h" |
|
|
|
|
|
|
|
#include "src/cpp/ext/gcp/observability_logging_sink.h" |
|
|
|
|
|
|
|
|
|
|
|
namespace grpc { |
|
|
|
namespace grpc { |
|
|
|
namespace experimental { |
|
|
|
namespace experimental { |
|
|
@ -80,7 +82,8 @@ absl::Status GcpObservabilityInit() { |
|
|
|
return config.status(); |
|
|
|
return config.status(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!config->cloud_trace.has_value() && |
|
|
|
if (!config->cloud_trace.has_value() && |
|
|
|
!config->cloud_monitoring.has_value()) { |
|
|
|
!config->cloud_monitoring.has_value() && |
|
|
|
|
|
|
|
!config->cloud_logging.has_value()) { |
|
|
|
return absl::OkStatus(); |
|
|
|
return absl::OkStatus(); |
|
|
|
} |
|
|
|
} |
|
|
|
grpc::RegisterOpenCensusPlugin(); |
|
|
|
grpc::RegisterOpenCensusPlugin(); |
|
|
@ -116,6 +119,11 @@ absl::Status GcpObservabilityInit() { |
|
|
|
// Disable OpenCensus stats
|
|
|
|
// Disable OpenCensus stats
|
|
|
|
EnableOpenCensusStats(false); |
|
|
|
EnableOpenCensusStats(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (config->cloud_logging.has_value()) { |
|
|
|
|
|
|
|
grpc::internal::RegisterLoggingFilter( |
|
|
|
|
|
|
|
new grpc::internal::ObservabilityLoggingSink( |
|
|
|
|
|
|
|
config->cloud_logging.value(), config->project_id)); |
|
|
|
|
|
|
|
} |
|
|
|
return absl::OkStatus(); |
|
|
|
return absl::OkStatus(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|