Skip to content

Commit

Permalink
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
Browse files Browse the repository at this point in the history
…SERT (grpc#36816)

[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT
Replacing GPR_ASSERT with absl CHECK.
These changes have been made using string replacement and regex.
Will not be replacing all instances of CHECK with CHECK_EQ , CHECK_NE etc because there are too many callsites. Only ones which are doable using very simple regex with least chance of failure will be replaced.
Given that we have 5000+ instances of GPR_ASSERT to edit, Doing it manually is too much work for both the author and reviewer.

Closes grpc#36816

COPYBARA_INTEGRATE_REVIEW=grpc#36816 from tanvi-jagtap:gpr_assert_removal 9db548b
PiperOrigin-RevId: 640731171
  • Loading branch information
tanvi-jagtap authored and copybara-github committed Jun 6, 2024
1 parent 687b31d commit 8c6be41
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/cpp/ext/otel/otel_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,8 @@ OpenTelemetryPlugin::CallbackMetricReporter::CallbackMetricReporter(
for (const auto& handle : key->metrics()) {
const auto& descriptor =
grpc_core::GlobalInstrumentsRegistry::GetInstrumentDescriptor(handle);
GPR_ASSERT(
descriptor.instrument_type ==
grpc_core::GlobalInstrumentsRegistry::InstrumentType::kCallbackGauge);
CHECK(descriptor.instrument_type ==
grpc_core::GlobalInstrumentsRegistry::InstrumentType::kCallbackGauge);
switch (descriptor.value_type) {
case grpc_core::GlobalInstrumentsRegistry::ValueType::kInt64: {
auto& callback_gauge_state =
Expand Down Expand Up @@ -700,7 +699,7 @@ void OpenTelemetryPlugin::AddCallback(
for (const auto& handle : callback->metrics()) {
const auto& descriptor =
grpc_core::GlobalInstrumentsRegistry::GetInstrumentDescriptor(handle);
GPR_ASSERT(
CHECK(
descriptor.instrument_type ==
grpc_core::GlobalInstrumentsRegistry::InstrumentType::kCallbackGauge);
switch (descriptor.value_type) {
Expand Down Expand Up @@ -776,7 +775,7 @@ void OpenTelemetryPlugin::RemoveCallback(
for (const auto& handle : callback->metrics()) {
const auto& descriptor =
grpc_core::GlobalInstrumentsRegistry::GetInstrumentDescriptor(handle);
GPR_ASSERT(
CHECK(
descriptor.instrument_type ==
grpc_core::GlobalInstrumentsRegistry::InstrumentType::kCallbackGauge);
switch (descriptor.value_type) {
Expand Down

0 comments on commit 8c6be41

Please sign in to comment.