Commit Graph

99 Commits

Author SHA1 Message Date
Yash Tibrewal bdd1ac4d1d
[GcpObservability C++] De-experimentalize API (#32715)
This PR aims to de-experimentalize the APIs for GCP Observability. 

We would have ideally wanted public feedback before declaring the APIs
stable, but we need stable APIs for GA.

Changes made after API review with @markdroth @veblush, @ctiller and the
entire Core/C++ team -
* The old experimental APIs `grpc::experimental::GcpObservabilityInit`
and `grpc::experimental::GcpObservabilityClose` are now deprecated and
will be deleted after v.1.55 release.
* The new API gets rid of the Close method and follows the RAII idiom
with a single `grpc::GcpObservability::Init()` call that returns an
`GcpObservability` object, the lifetime of which controls when
observability data is flushed.
* The `GcpObservability` class could in the future add more methods. For
example, a debug method that shows the current configuration.
* Document that GcpObservability initialization and flushing (on
`GcpObservability` destruction) are blocking calls.
* Document that gRPC is still usable if GcpObservability initialization
failed. (Added a test to prove the same).
* Since we don't have a good way to flush stats and tracing with
OpenCensus, the examples required users to sleep for 25 seconds. This
sleep is now part of `GcpObservability` destruction.

Additional Implementation details -
* `GcpObservability::Init` is now marked with `GRPC_MUST_USE_RESULT` to
make sure that the results are used. We ideally want users to store it,
but this is better than nothing.
* Added a note on GCP Observability lifetime guarantees.

<!--

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.

-->
2023-04-05 21:45:21 +00:00
Craig Tiller 4f444aaabf
Revert "[gprpp] Add ValidationErrors::message retrieval" (#32767)
Reverts grpc/grpc#32761
2023-03-31 21:42:58 -07:00
AJ Heller b94d55bd20
[gprpp] Add ValidationErrors::message retrieval (#32761)
For cases where an absl::Status is unnecessary.
2023-03-31 11:56:06 -07:00
Mark D. Roth 36d2716d52
[JSON] move Parse() and Dump() methods out of JSON object (#32742)
More prep for making this a public API.
2023-03-30 13:30:54 -07:00
Yash Tibrewal fcff4bd1d0
Gcp Observability Logging: The Call ID should use a UUIDv4 format (#32699)
Earlier, we were simply using a 64 bit random number, but the spec
actually calls for UUIDv4.

<!--

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.

-->
2023-03-23 19:07:13 -07:00
Yash Tibrewal 3eae5bc5a1
GcpObservability: Plumb tracing information to logs (#32643)
<!--

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.

-->
2023-03-22 18:45:01 -07:00
Yash Tibrewal bf1a26cde8
GcpObservability: Add client api latency (#32645)
This PR adds the view `grpc.io/client/api_latency` for GCP Observability
which aims to collect the end-to-end time taken by a call.

Changes made to support this -
1) A global interceptor factory registration is created for stats
plugins.
2) OpenCensus plugin now provides a new interceptor that's responsible
for collecting the new latency.
3) Gcp Observability registers this plugin.
4) A new OpenCensus measurement and view is created for api latency.
Note that this is internal as of now, since it's not clear if it should
be exposed as public experimental API. Leaving that decision for the
future.

<!--

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.

-->
2023-03-22 15:31:47 -07:00
Yash Tibrewal f04e1a9589
OpenCensus: Add annotations for messages (#32646)
This PR adds annotations to client attempt spans and server spans on
messages of the form -
* `Send message: 1026 bytes`
* `Send compressed message: 31 bytes` (if message was compressed)
* `Received message: 31 bytes`
* `Received decompressed message: 1026 bytes` (if message needed to be
decompressed)

Note that the compressed and decompressed annotations are not present if
compression/decompression was not performed.

<!--

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.

-->
2023-03-22 13:41:05 -07:00
Yash Tibrewal 6f960be41b
Gcp Observability: Make GcpObservabilityInit blocking (#32612)
<!--

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.

-->
2023-03-13 15:08:45 -07:00
Yash Tibrewal 7af4bc7f1a
Logging: Move filter to Core (#32467)
This filter was originally written only for the C++ wrapped layer, but
we have plans to use this for Python (and maybe other wrapped languages
too in the future.)

<!--

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.

-->
2023-02-24 16:41:39 -08:00
Yash Tibrewal 7b79173991
Logging: Fill status code, status message and status details (#32464)
<!--

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.

-->
2023-02-23 17:03:58 -08:00
Yash Tibrewal 184d4826d4
Gcp Observability: Fix resource labels for stats and tracing (#32460)
For stats, the StackDriver/OpenCensus API allows setting the
MonitoredResource directly, so use that.

For tracing, there is no explicit MonitoredResource to use, so just
insert it into the attributes for a span.
2023-02-22 23:35:20 -08:00
Yash Tibrewal d93d0022cd
GCP Observability: Fix constant labels support for stats when tracing is disabled (#32451)
<!--

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.

-->
2023-02-22 14:49:55 -08:00
Yash Tibrewal 4b05dc88b7
GCP Observability: Plumb environment autodetection for OpenCensus stats and tracing (#32431) 2023-02-19 22:25:23 -08:00
Yash Tibrewal 04e3a8e73d
GCP Observability : Framework for detecting the environment (#32294)
This code is not plumbed through yet, but it provides the core
infrastructure needed to detect the proper GCP environment resources
needed to set up the labels/attributes/resources for stats, tracing and
logging.

Details on how the various environment resources are setup has been
derived by looking at java's cloud logging library and OpenTelemetry's
future plans. (Could be better explained in an offline review since some
links are internal).

Requesting @veblush for a full review and @markdroth for a structural
review.

<!--

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.

-->
2023-02-16 16:20:20 -08:00
Craig Tiller 0893fca089
[promises] Roll forward server promise calls with fixes (#32261)
* stuff

* spam-cleanup

* Revert "Revert "[promises] Server call (#31448)" (#32260)"

This reverts commit dbfb888e1f.

* spam-cleanup

* Automated change: Fix sanity tests

* asserts-for-sanity

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-02-01 16:07:46 -08:00
Craig Tiller dbfb888e1f
Revert "[promises] Server call (#31448)" (#32260)
* Revert "[promises] Server call (#31448)"

This reverts commit bbeb15006a.

* clang-fmt
2023-02-01 09:18:04 -08:00
Craig Tiller bbeb15006a
[promises] Server call (#31448)
* add experiment

* allow instantiation

* scratchings

* scratchings

* sniffly

* Automated change: Fix sanity tests

* fix

* fix

* fix

* Automated change: Fix sanity tests

* progress

* change pipe labels to enable server code to be written

* better api

* Automated change: Fix sanity tests

* progress

* [promises] Implementation of deadline for server-based-calls

* compression filter compiles again

* Automated change: Fix sanity tests

* fix

* server tracing fixes

* get client initial metadata

* progress

* progress

* server call surface progress

* Automated change: Fix sanity tests

* move payload

* server-progress

* recv-message-server-connchan

* logging

* fix context-gate

* recv fix@top

* Automated change: Fix sanity tests

* recv close on server

* top termination start

* [promises] Move Empty to be first class

* fixes

* fix

* flow control fix

* got to orphan!

* orphan

* call orphan

* spam cleanup

* fix

* new cancelation semantics

* progress

* large metadata fixes

* fix

* fix

* log

* better logs

* fix-chanz

* logging, necessaryness

* fix typo

* fixes

* fix

* fix

* fix-pipe

* cleanup logging

* fix

* build-fix

* fix

* Automated change: Fix sanity tests

* logging

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* better primitive

* Revert "better primitive"

This reverts commit 119b5ee244.

* fix

* fix

* trrracing

* Automated change: Fix sanity tests

* get-trailing-metadata

* cancellation

* Automated change: Fix sanity tests

* add transform pipeline to pipe

* add transform pipeline to pipe

* interceptor lists

* new server initial md api into filters

* convert connected_channel

* convert call

* initial promise based filter conversion

* convert promise based filter

* build fixes

* compile fix

* fixes

* fix ordering

* fixes

* check-metadata

* revert later: debug code

* better debug

* fix metadata ordering with messages in promise based filter

* fix ordering problem between batch completion and promise completion

* properly handle failure on receive message path on client

* more debug, fix a repoll bug in pbf

* Automated change: Fix sanity tests

* fixes

* Automated change: Fix sanity tests

* cleanup logging

* fixes

* missing file

* fixes

* logging

* Automated change: Fix sanity tests

* fixes

* convert logging filter

* fix

* Automated change: Fix sanity tests

* fix bad server response test

* Revert "Disable logging test (#32049)"

This reverts commit 5fc92eaeae.

* fix

* Automated change: Fix sanity tests

* fix memory leaks, logging

* Automated change: Fix sanity tests

* slice refcount debugging

* asan-canaries

* leak-fix

* leak-fix

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* fix

* Automated change: Fix sanity tests

* fix

* remove mistaken line

* add-comment

* fix refcounting bug

* Automated change: Fix sanity tests

* rename variable

* renames

* bleh

* carry pipe close status from bottom of pipe to top to appease
recv-close-on-server

* backport cancellation

* Revert "carry pipe close status from bottom of pipe to top to appease"

This reverts commit fa33301dcd.

* fix

* Automated change: Fix sanity tests

* review-feedback

* comment-ordering

* monostate

* renames

* undo-review-feedback

* fix

* review-feedback

* review-feedback

* fix

* review-feedback

* drop debugloc constructor

* interceptor-list-rev-feedback

* interceptor-list-rev-feedback

* pipe test

* review-feedback

* undo-mistaken-change

* Automated change: Fix sanity tests

* pipe error state

* detect send/recv failures and report

* iwyu, build

* fix submodules

* fix

* warning

* cleanup

* Automated change: Fix sanity tests

* fix

* fix for windows

* fix

* null pointer fix

* iwyu

* gen projex

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-01-30 21:39:11 -08:00
Craig Tiller 7b02b7c253
[stats] Add experiment to use transport reported request latency whenever available (#32168)
* [stats] Add experiment to use transport reported request latency whenever available

* redux: add a new metric

* review-feedback

* Automated change: Fix sanity tests

* fix

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-01-24 08:09:59 -08:00
Yash Tibrewal beffe313e5
GCP Observability Logging: Base64 Encode metadata, message and status-details (#32184)
* GCP Observability Logging: Base64 Encode metadata, message and status-details

* Use padding for message and status-details
2023-01-23 18:57:09 -08:00
Yash Tibrewal 7f7a352ccc
Fix flakiness in test/cpp/ext/filters/census/... (#32174) 2023-01-23 12:13:45 -08:00
Yash Tibrewal aa11978541
Fix include guards for src/ and test/ directories (#32167)
* Fix include guards for src/ and test/ directories

* Sanity

* Update new files
2023-01-20 16:27:27 -08:00
Yash Tibrewal 21618f3aef
GCP Observability: Add labels support for logging (#32130)
* GCP Observability: Add labels support for logging

* clang format

* Reviewer comments
2023-01-18 16:08:30 -08:00
Yash Tibrewal 05491fb2f6
Gcp Observabiliy : Add constant labels support for stats and tracing (#32128)
* Gcp Observabiliy : Add constant labels support for stats and tracing

* Register GCP Observability labels

* sanity

* Fix build for CI

* TEST_TAG_KEY fix

* Remove duplicitous constant label setting
2023-01-18 14:32:36 -08:00
Yash Tibrewal 25465100fd
LoggingTest: s/GUARDED_BY/ABSL_GUARDED_BY (#32144) 2023-01-18 14:24:11 -08:00
Yash Tibrewal 33be15bdb6
Gcp Observability: Lazily initialize channels post-init (#32091)
* Gcp Observability: Lazily initialize channels post-init

* IWYU and fix build deps

* Run RegistryPostInit for client census filters too

* Remove unused function
2023-01-13 11:13:20 -08:00
Yash Tibrewal d5c1dc1667
GCP Observability: Fix env var names (#32066) 2023-01-10 14:02:07 -08:00
Yash Tibrewal 5fc92eaeae
Disable logging test (#32049) 2023-01-10 10:50:56 -08:00
Yash Tibrewal ad6f6c49e0
Logging filter (#31755)
* initial

* Intermediate

* Another try

* Try multiple necesary pulls

* Filter works other than client half close

* Fixes

* Add a cancelled RPC test

* Handle trailer only responses

* Tests for disabled logging and truncated payloads

* Fix authority and peer

* Add TODOs and asserts for half-close

* Fix tests for half-close and cancel

* 2d748fcb1cf45cac62729b8346ad15e6abc79e97

* Fix sanity checks

* Strict bazel build

* Fix package

* IWYU

* Fix cmake

* Explicit cast to string

* Size casts

* Fix Arena leak and disable macos build for now

* Reviewer comments
2023-01-06 13:52:15 -08:00
Yash Tibrewal d3d4dd7325
StatsPluginEnd2EndTest: Add QueueOnceLoadBalancingPolicy to remove flakiness from test (#32019)
* StatsPluginEnd2EndTest: Add QueueOnceLoadBalancingPolicy to remove flakiness from test

* Unused arg

* Remove unnecessary DelegatingPicker

* Reviewer comments

* explicit constructor

* Remove unnecessary dependency

* Reviewer comments

* Sanity

* clang tidy
2023-01-05 12:45:52 -08:00
Yijie Ma f99b8b5bc4
Convert c-style comments to C++-style comments (#31923)
* baseline

* fix clang-tidy

* manually revert these files

* manually fixup at eof

* revert 2 more files

* change check_deprecated_grpc++.py

* change end2end_defs.include template

* fix check_include_guards.py

* untrack tools/distrib/python/convert_cstyle_comments_to_cpp.py

not yet ready to be submitted

* fix

yapf check_include_guards.py
remove a space...

* fix version.cc.template

* fix version_info.h.template
2022-12-22 23:01:53 -08:00
Yash Tibrewal 9e7c8bff55
Tracing: Add annotations for when call is removed from resolver result queue and lb pick queue (#31913)
* Tracing: Add annotations for when call is removed from resolver result queue and lb pick queue

* Add test for pending resolver result queue as well

* Update annotation messages
2022-12-16 10:31:48 -08:00
Yash Tibrewal 15c4a98bc7
Gcp Observability Logging: Add handling for adding entry as a json payload (#31723) 2022-11-21 14:32:04 -08:00
Yash Tibrewal 0389940093
GcpObservability: Add config support for constant labels (#31710) 2022-11-18 17:26:20 -08:00
Esun Kim 0ba0c4bf74
Added googletest clang-tidy checks (#31610)
* Added google-googletest

* Autofix

* Fix test names

* Fix
2022-11-18 13:02:20 -08:00
Yash Tibrewal 7372e55ba9
Revert "Revert "Observability Logging: Interfaces and structure"" (#31681)
* Revert "Revert "Observability Logging: Interfaces and structure (#31651)" (#31669)"

This reverts commit 3be177223e.

* Generate projects
2022-11-17 11:12:36 -08:00
Craig Tiller 3be177223e
Revert "Observability Logging: Interfaces and structure (#31651)" (#31669)
This reverts commit 2146107e25.
2022-11-15 18:24:00 -08:00
Yash Tibrewal 2146107e25
Observability Logging: Interfaces and structure (#31651)
* Observability Logging: Interfaces and structure

* Revert unrelated changes

* Fix test build

* Add dependency on Google Apis Logging V2 service and add a dummy logging call

* Add authority
2022-11-15 18:02:22 -08:00
Yash Tibrewal 829f41b733
ObservabilityLogging: Add interface for logging and config parsing implementation for GCP observability (#31571)
* ObservabilityLogging: Add interface for logging and config parsing implementation for GCP observability

* Trailing new lines

* Fix naked include

* clang-tidy

* Reviewer comments

* Reviewer comments
2022-11-09 14:13:20 -08:00
Yash Tibrewal 5dfd384655
ObservabilityConfig: Add missing test (#31572) 2022-11-09 12:30:09 -08:00
Yash Tibrewal a99a65b6e2
GcpObservability: Add parsing for logging config (#31502)
* GcpObservability: Add parsing for logging config

* Unused parameters

* Reviewer comments
2022-10-31 17:02:20 -07:00
Yash Tibrewal 3b6675c2de
OpenCensus: Move measures, views and CensusContext to include file (#31341)
* OpenCensus: Move measure and view declarations to include file

* Move CensusContext class too

* Fix IWYU

* Guard with experimental

* Formatting

* clang tidy fixes

* cleanup

* Reviewer comments
2022-10-20 17:42:08 -07:00
Yash Tibrewal 727ae8c885
GcpObservability: Add experimental public target (#31339)
* GcpObservability: Add experimental public target

* Yapf and IWYU
2022-10-17 12:43:45 -07:00
Yash Tibrewal 2ffff621a4
OpenCensusTest: Fix flakiness (#31349) 2022-10-13 16:06:51 -07:00
Yash Tibrewal 8cffd1044e
OpenCensus: Ability to globally disable stats and tracing (#31252)
* OpenCensus: Ability to globally disable stats and tracing

* Fix docs
2022-10-05 14:38:15 -07:00
Yash Tibrewal 6d249c0af2
Observability: Experimental arg to disable client side tracing (#31093)
* Observability: Experimental arg to disable client side tracing

* Fix IWYU

* Reviewer comments

* Reviewer comments

* Reviewer comment: Move experimental/internal arg to different file

* Fix build

* Fix IWYU
2022-09-27 14:34:07 -07:00
Yash Tibrewal 9cff4d2d28
OpenCensus Plugin: Add missing measure and views for started RPCs (#31034) 2022-09-20 17:26:16 -07:00
Mark D. Roth 07df5ff9c7
json_object_loader: refactor ErrorList into its own library (#31049)
* json_object_loader: refactor ErrorList into its own library

* fix observability_config_test

* generate_projects

* iwyu
2022-09-20 11:58:27 -07:00
Yash Tibrewal 5cd8ee25f8
GcpObservabilityConfig: New changes (#31038)
* GcpObservabilityConfig: New changes

* Fix IWYU
2022-09-19 15:29:46 -07:00
Yash Tibrewal 27e5b4e187
GcpObservabilityConfig: Fall-back to GCP environment variables (#31022) 2022-09-19 11:48:35 -07:00