This CL starts the work to export the new instrument domains system to OTEL.
Only counters are attempted at this point, the work is behind an experiment, and that experiment is disabled.
PiperOrigin-RevId: 825842970
gRPC is currently getting formatted with two different clang-format implementations, and due to some weirdness they have different include file orderings. This change introduces clang-format configuration to ensure that the two systems align - it's *highly* expected that this will need some maintenance going forward as the two systems evolve.
Closes#40905
PiperOrigin-RevId: 819606209
This change adds new concrete classes (`CallSpan`, `CallTracer`, `ClientCallTracer`, `CallAttemptTracer`, `ServerCallTracer`) that wrap the existing `*Interface` types. These concrete types mirror the inheritance hierarchy of the interfaces and forward all method calls to the underlying interface pointer. This is the first step in refactoring the telemetry system to use concrete types instead of interfaces directly in the context.
PiperOrigin-RevId: 800743798
PosixEngine now directly owns the poller, which will streamline change for poller enablement experiment.
Closes#40356
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/40356 from eugeneo:no-poller-manager d067930a572330d47c0c09282629e2aff089d525
PiperOrigin-RevId: 795119886
This change renames the existing interface types to have `Interface` in the name, and prepares the ground for concrete types for the call tracers.
PiperOrigin-RevId: 790173028
We use builders for a variety of tasks - sometimes for testing, sometimes for adapting gRPC to novel environments, sometimes for once off special tasks early in a process lifetime.
Treating these as the same thing has started leading to some problems, so here I introduce a reset-proof registration for a subset of these tasks.
I'll be using this to register chaotic-good into the EndpointTransport registry so that it doesn't need to join the usual core configuration chain (and accidentally pull in protobuf to core).
PiperOrigin-RevId: 750048742
This reverts commit a6eb776b48.
Looks like the TransparentRetries test is flaky
Closes#38821
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38821 from yashykt:RevertOTelTracing 74abeb889bbf2fa3d0a4782ada1d19e7255e37e1
PiperOrigin-RevId: 730800878
Maybe in some of these cases, `{}` would work instead of `std::pair`, but I'm just doing a simple find and replace here.
Closes#38636
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38636 from yashykt:NoMakePair d819f6a74be2fb2859083436297f79ed3139a1b7
PiperOrigin-RevId: 722772621
This is only ever set to C++, so removing it from bazel.
There are remnants left in cmakefile generation that I'm not planning on cleaning up (looked like some of the yaml/python pieces still use this)
Closes#38501
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38501 from ctiller:language c8aee06a01a449483b7585a367ff793fde47f68a
PiperOrigin-RevId: 718198572
Log error message instead of crashing for this API misuse.
<!--
If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.
If your pull request is for a specific language, please add the appropriate
lang label.
-->
Closes#37764
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37764 from yijiem:report-different-gauge-wont-crash 1b6e912bfc65c44b754e9fa143f8c22e15ba49ef
PiperOrigin-RevId: 677944595
The following files have been moved:
- src/core/lib/avl/*
- src/core/lib/backoff/*
- src/core/lib/debug/event_log*
- src/core/lib/iomgr/gethostname*
- src/core/lib/iomgr/grpc_if_nametoindex*
- src/core/lib/matchers/*
- src/core/lib/uri/* (renamed from uri_parser.* to uri.*)
- src/core/lib/gprpp/* (existing src/core/util/time.cc was renamed to gpr_time.cc to avoid conflict)
Closes#36792
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36792 from markdroth:reorg_util d4e8996f481c611ffbb06a8b04924ff81bc1bc2b
PiperOrigin-RevId: 676947640
Split off from https://github.com/grpc/grpc/pull/37425
We are adding and removing callbacks on the OpenTelemetry Async Instruments without synchronization. This opens us to races where we have an AddCallback and RemoveCallback operation happening at the same time. The correct result after these operations is to still have a callback registered with OpenTelemetry at the end, but the two operations could race and we could just decide to remove the OpenTelemetry callback.
The fix delays removing OpenTelemetry callbacks to plugin destruction time.
Closes#37485
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37485 from yashykt:FixRaceOTelGauge 016b0a41b54102c69e6828425c014ada2b066af2
PiperOrigin-RevId: 663492598
It is hard to reason about tests if multiple callbacks record values for the same metrics with the same label sets.
Closes#37486
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37486 from yashykt:SimplifyOTelPluginTest 3b4d7f90b3a988b1d837792fc5e3fabcdff45865
PiperOrigin-RevId: 663457107
Previously the registered callback's duration is set too low (10ms) that 2 different OTel callbacks get called from OTel consecutively would trigger the registered callback again, making the test flaky.
<!--
If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.
If your pull request is for a specific language, please add the appropriate
lang label.
-->
Closes#37243
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37243 from yijiem:otel-plugin-test-flake 70a1572cd2da95190a5757dcd0ec97945a87b919
PiperOrigin-RevId: 653717643
This allows CallTracers to be created with parameters dictated by
channel args.
For the moment, I've used the EventEngine `EndpointConfig` API to expose
the channel args here, so as to avoid directly exposing
`grpc_core::ChannelArgs`. We should determine a better API here before
we de-experimentalize the stats APIs.
Also add an experiment to be used in a subsequent PR.
PiperOrigin-RevId: 647730284
Preparation for switching away from `grpc_channel_filter*` to identify channel filters.
Closes#36907
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36907 from ctiller:type-name e7ad4c67a2ebe40f8bbf95198dd84562c47d99b9
PiperOrigin-RevId: 644483948
<!--
If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.
If your pull request is for a specific language, please add the appropriate
lang label.
-->
Closes#36729
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36729 from yijiem:per-channel-stats-plugin 4786bed42f11b0a164f21e040439c3145f5d1e3d
PiperOrigin-RevId: 642030366
This adds compile-time checking that the type of the value and the size of the labels and optional labels passed when recording a metric must match with the type and the size specified when the metric is registered.
The RegistrationBuilder API idea is credited to @ctiller.
<!--
If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.
If your pull request is for a specific language, please add the appropriate
lang label.
-->
Closes#36449
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36449 from yijiem:registration-builder-api a72781013699a985a8e06152594268d6c45a9589
PiperOrigin-RevId: 632271022
Before this change, on a trailers-only response, Metadata Exchange needed by CSM would just be dropped, and hence CSM labels would not be seen.
Changes -
* OTel call attempt tracer populates labels from trailers if it's a trailers-only response.
* HTTP2 layer propagates the Metadata Exchange field from headers to trailers for trailers-only responses.
* Add a test to make sure that retries continue to work when Metadata Exchange is enabled and a trailers-only response is sent. (This verifies that a trailers-only response remains a trailers-only response.)
Closes#36413
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36413 from yashykt:MetadataExchangeInTrailers e7d202685ee6f0f4c4ed3ad689e1b89eb36584ea
PiperOrigin-RevId: 630144618