Commit Graph

137 Commits

Author SHA1 Message Date
Craig Tiller 975184f04b
[channel-stack] Make ordering explicit (#32852)
Ditch the old priority scheme for ordering filters, instead explicitly
mark up before/after constraints.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-10-17 13:52:58 -07:00
Yash Tibrewal 5fd09c1aff
[CSM C++] Fix behavior when peer does not send metadata (#34692)
@stanley-cheung noticed a bug where CSM labels were not being added on
metrics if the peer was not also CSM Observability enabled.

This PR fixes the behavior to add in the local labels in this case, as
well as add the remote workload type label with the value of unknown.
2023-10-16 18:13:36 -07:00
Yash Tibrewal 7a97b35d9b
[CSM] Google Cloud C++ libraries now allow bazel layering checks (#34664)
With the latest cloud C++ release - 
1) The opentelemetry bazel target is no longer experimental.
2) layering checks now work with bazel
2023-10-11 17:14:59 -07:00
Yash Tibrewal a0e3794f4b
[OTel C++] Method attribute filtering (#34350)
Implements method attribute filtering as defined by the gRFC
https://github.com/grpc/proposal/pull/380
2023-09-22 23:48:01 +00:00
Yash Tibrewal 1091cc3211
[CSM] Update labels (#34412)
Changes - 
* Remove `csm.remote_workload_pod_name` and
`csm.remote_workload_container_name`.
* Add `csm.remote_workload_name`, the value for which is sent through
MetadataExchange, from the `CSM_WORKLOAD_NAME` env var. (Note that this
is not added in local labels.)
* Add a local `csm.canonical_service` (@markdroth, please verify the key
that we want here) that is read from `CSM_CANONICAL_SERVICE_NAME` env
var, and we continue to send it over via MetadataExchange
2023-09-21 16:02:03 -07:00
Yash Tibrewal 112fffcdb4
[OTel] Minor test cleanup (#34353)
<!--

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-09-21 09:23:47 -07:00
Yash Tibrewal d670ffa92c
[CSM] Create an experimental target (#34381) 2023-09-15 17:51:33 -07:00
Yash Tibrewal 037979c0d8
[CSM] Remaining cleanup from GSM to CSM renaming (#34352)
<!--

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-09-14 16:58:23 -07:00
Yash Tibrewal ee6ed6ab4f
[CSM] Add target selector for csm channels (#34311)
<!--

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-09-12 18:43:36 -07:00
Stanley Cheung e66cb7f2de
[GSM Observability] Update opentelemetry cpp bazel deps (#34290)
This is needed for the upcoming work for GSM Observability integration
testing.
2023-09-12 11:02:02 -07:00
Yash Tibrewal 03776a2f3e
[OTel and Csm] Cosmetic API changes (#34294)
Changes - 
* OTel API - Metrics enabling/disabling is updated to reflect design
changes.
* GSM is renamed to CSM
2023-09-11 12:23:45 -07:00
Yash Tibrewal 1d136fd05f
[OTel] Add API to allow filtering target attribute on client side call/attempt metrics (#34285)
Based on https://github.com/grpc/proposal/pull/380
2023-09-08 01:35:05 -07:00
Yash Tibrewal d4ca41d22d
[OTel C++] Add ability to select channels for stats based on the target (#34273)
@ctiller PTAL for core configuration changes. I converted the type from
std::function to absl::AnyInvocable. Do you think the functor in
RegisteredBuilder should be callable just once or multiple times?
<!--

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-09-07 17:41:26 -07:00
Yash Tibrewal 938d19f63e
[GSM Observability] Add mesh_id support in injected labels (#34247)
Changes - 
1) Change local mesh labels to not be reported on 'started' metrics at
all (even those that we know about) to be consistent. (Since xDS labels
atleast on the server side would not be available on started metric.)
2) Add mesh_id as a local label that is populated by reading the xDS
bootstrap. As part of this, also added a minimal xds bootstrap parsing
logic.

<!--

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-09-07 14:07:57 -07:00
Yash Tibrewal 0dd8a056b8
Revert "[GSM Observability] "Revert Metadata Exchange Implementation"" (#34234)
Reverts grpc/grpc#34233
2023-09-01 12:04:19 -07:00
Eugene Ostroukhov 9800546913
[GSM Observability] "Revert Metadata Exchange Implementation" (#34233)
Reverts grpc/grpc#34051 as it caused issues with import.
2023-09-01 09:06:45 -07:00
Yash Tibrewal 7c79712d13
[GSM Observability] Metadata Exchange Implementation (#34051)
A new metadata type `x-envoy-peer-metadata` is being introduced. We
don't have a better way to do this at the moment compared to just adding
it in `metadata_batch.h`.

The GSM Observability plugin uses this metadata to send topology
information to peers in the form of serialized and base64 encoded
`google::protobuf::Struct`. The individual keys being used inside the
struct are subject to change.

<!--

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-08-31 22:43:36 -07:00
Yash Tibrewal f5e02f6c62
[OTel] Remove global fallback for meter provider (#34190)
Based on updates at https://github.com/grpc/proposal/pull/380

<!--

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-08-31 13:20:24 -07:00
Yash Tibrewal 2da74beb96
[OTel] Remove authority attribute from server metrics (#34189)
Based on updates at https://github.com/grpc/proposal/pull/380
<!--

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-08-28 17:13:01 -07:00
Craig Tiller b478add7ec
[experiments] Remove unused experiment (#34090)
We added this as an exploratory measure for a customer that thought they
were using open census (this turned out to be emphatically false).
Remove it since it's probably not how we ultimately want to do this, and
wait for something better to come along.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-08-24 23:45:22 -07:00
Yash Tibrewal 6878609fc5
[GSM Observability] Add cloud c++ dependency.. this time for sure (#34071)
<!--

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-08-16 13:35:05 -07:00
Yash Tibrewal 462a2cae35
Revert "[GSM Observability] Add bazel dependency on Google Cloud C++ OTel library" (#34069)
Reverts grpc/grpc#34043

This caused bazel distribtest failures
2023-08-15 16:24:40 -07:00
Yash Tibrewal bd343fd51d
[GSM Observability] Add bazel dependency on Google Cloud C++ OTel library (#34043)
Not adding CMake support yet

<!--

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-08-11 12:54:18 -07:00
Yash Tibrewal 7e63a2f382
[GSM] Some initial structure (#33952)
<!--

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-08-02 16:23:01 -07:00
Yash Tibrewal 860167a7d0
[OTel] Add target on client-rpc metrics, and authority on server-rpc metrics (#33946) 2023-08-01 16:37:31 -07:00
Alisha Nanda f7fc3fbed4
[tracing] Add annotation with metadata sizes and limits (#33910)
Only create annotation when call is sampled for cost reasons.

---------

Co-authored-by: ananda1066 <ananda1066@users.noreply.github.com>
2023-08-01 11:06:14 -07:00
Yash Tibrewal 9ea30fa9fd
[OTel] Add an OpenTelemetryPluginBuilder (#33895)
<!--

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-07-27 14:05:19 -07:00
Craig Tiller 801f106992
[promises] Add logging_test to promise_based_server_call testing (#33774) 2023-07-20 12:54:26 -07:00
Yash Tibrewal d2f37b8b45
[OTel] Basic C++ OTel Stats Functionality (#33650)
Note that the plugin is still under `grpc::internal` namespace and not
under `experimental` intentionally.

<!--

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-07-17 09:30:47 -07:00
Yash Tibrewal 98417f3bd0
Revert "Revert "[otel] Add bazel dependency"" (#33560)
Reverts grpc/grpc#33559
2023-06-27 12:28:47 -07:00
Mark D. Roth 017153a0c5
Revert "[otel] Add bazel dependency" (#33559)
Reverts grpc/grpc#33548
2023-06-27 10:34:45 -07:00
Yash Tibrewal 875b7fdcff
[otel] Add bazel dependency (#33548)
Add bazel dependency on opentelemetry-cpp.
<!--

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-06-27 00:47:01 -07:00
Yash Tibrewal 441ff0e757
[logging] Add tests for cases where we don't send any metadata and improve debuggability (#33486)
<!--

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-06-21 14:48:23 -07:00
AJ Heller 252ebad341
[infra] Fix absl::Mutex check and remove all uses (#33144)
`tools/run_tests/sanity/check_absl_mutex.sh` was broken, a missing paren
crashed the script if run locally. It's unclear yet how our sanity
checks were not complaining about this, `run_tests.py` does not save the
log.
2023-05-16 12:50:52 -07:00
Yash Tibrewal 1b01336504
[Logging] Fix flakiness in test (#33077)
Change - just make sure that before we verify the logging entries, we'll
wait for the expected number of entries to show up.

Logging_test has been recently reported as flaky. Sample failure -
https://source.cloud.google.com/results/invocations/ba581ad8-b652-4b9d-af56-07593f5d2deb/targets/%2F%2Ftest%2Fcpp%2Fext%2Ffilters%2Flogging:logging_test@poller%3Depoll1/tests

Failed to reproduce, but i have a suspicion that what's happening is
that the logging for the half-close events on the server side can happen
after the call has ended.. It is currently being logged after the
server-trailer (which has the status).
2023-05-11 11:15:47 -07:00
Yash Tibrewal e49cfd494c
[GCP Observability C++] Add empty config test (#32790)
<!--

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-14 16:42:47 -07:00
Yash Tibrewal 4a1bf8778b
[OpenCensus Test] Don't depend on compression algorithm (#32863)
We shouldn't depend on how much the compression algorithm compresses the
bytes to. This is causing flakiness internally.

<!--

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-14 00:37:07 +00:00
AJ Heller c268ac2c25
[revert] Revert "Revert "[gprpp] Add ValidationErrors::message retrieval" (#32767)". (#32771)
This reverts commit 4f444aaabf, which
needed a cherrypick.
2023-04-10 13:11:53 -07:00
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