FAQs on CloudWatch supported protocols
CloudWatch SDKs started using two additional protocols: Amazon JSON 1.0
What is the Amazon JSON protocol, and how does it differ from existing CloudWatch API requests and responses?
JSON is one of the most widely used and accepted data formats for communication between heterogeneous systems. CloudWatch uses JSON as a medium to communicate between an Amazon SDK client (for example, Java, Python, Golang, JavaScript) and CloudWatch server. An HTTP request of an CloudWatch API operation accepts input in the form of JSON. The CloudWatch operation is executed and the response of execution is shared back to the SDK client in the form of JSON. Compared to Amazon Query, JSON is more efficient at transporting data between client and server.
-
CloudWatch Amazon JSON protocol acts as a mediator between CloudWatch client and server.
-
The CloudWatch Amazon SDK handles the serialization (convert object to JSON format) and de-serialization (convert JSON format to object) between the CloudWatch client and server.
What is the Smithy RPC v2 CBOR protocol, and how does it differ from existing CloudWatch API requests and responses?
Smithy RPC v2 CBOR (Concise Binary Object Representation) is a protocol developed by Amazon for more efficient data transmission. It's a data format designed to keep message sizes compact, and allow the format to evolve without requiring version negotiation between systems. The key difference from JSON encoding is that JSON uses human-readable text (like "name": "John"), while CBOR uses a binary format (sequences of 1s and 0s). This binary approach creates smaller data packages that travel faster over the network and reduces serialization time since computers process binary data directly.
-
CloudWatch RPC v2 CBOR protocol acts as a mediator between CloudWatch client and server.
-
The CloudWatch SDK handles the serialization (convert object to CBOR format) and deserialization (convert CBOR format to object) between the CloudWatch client and server.
How do I get started with the newer protocols for CloudWatch?
To get started, use the latest Amazon SDK/CLI version to use the latest supported protocol for CloudWatch. Upgrade your Amazon SDK to the specified version or any subsequent version.
| Language | Protocol | SDK versions |
|---|---|---|
| C++ | RPC v2 CBOR | 1.11.708 |
| Golang 2.x | RPC v2 CBOR | 1.53.0 |
| Java 1.x | RPC v2 CBOR | 1.12.795 |
| Java 2.x | RPC v2 CBOR | 2.40.6 |
| JavaScript v3.x | Amazon JSON 1.0 | 3.949.0 |
| .NET v3 | Amazon JSON 1.0 | 3.7.1182.0 |
| .NET v4 | RPC v2 CBOR | 4.0.150.0 |
| PHP | Amazon JSON 1.0 | 3.367.0 |
| Python-boto3 | Amazon JSON 1.0 | 1.42.7 |
| Python-botocore | Amazon JSON 1.0 | 1.42.7 |
| Amazon CLI v1 | Amazon JSON 1.0 | 1.43.13 |
| Amazon CLI v2 | Amazon JSON 1.0 | 2.32.14 |
| Ruby | Amazon JSON 1.0 | 1.126.0 |
| Powershell | Amazon JSON 1.0 | 5.0.114 |
| Rust | RPC v2 CBOR | 1.100.0 |
| Swift | RPC v2 CBOR | 1.6.14 |
| Kotlin | RPC v2 CBOR | 1.5.100 |
What are the risks of enabling these new protocols for my CloudWatch workloads?
The migration into these new SDK versions is expected to be fully transparent and effortless for customers. There is one known behavioral change in between protocols related with how null values are treated within lists: CloudWatch API calls with list inputs that may contain null values will be handled differently in the Amazon JSON and Smithy RPC v2 CBOR protocols as compared to the previous Amazon Query protocol: In Amazon Query protocol, null values within lists are removed, while in JSON/CBOR protocols will be propagated through the API calls.
Additionally, if you are using a custom implementation of Amazon SDK or a combination of custom clients and Amazon SDK to interact with CloudWatch that generates Amazon Query based (aka XML-based) responses, it may be incompatible with Amazon JSON or CBOR protocol. If you encounter any issues, contact Amazon Support.
What if I am already on the latest Amazon SDK version, but my open sourced solution does not support JSON or CBOR?
You must change your SDK version to a previous version. See the How do I get started with the newer protocols for CloudWatch? section and select a version lower than listed. If you change your Amazon SDK to the previous version, your CloudWatch APIs will use the Amazon Query protocol.
What regions are supported for Amazon JSON and CBOR protocols used in CloudWatch APIs
CloudWatch supports Amazon JSON and CBOR protocol in all Amazon regions where CloudWatch is available.
What latency improvements can I expect when upgrading to the specified Amazon SDK versions for CloudWatch using the newer protocols?
Both JSON and CBOR provide up to 80% lower latency and CPU usage when compared to the Amazon Query. Both protocols are up to 20% more efficient in network bandwidth usage.
Will the Amazon Query protocol be deprecated?
Amazon Query protocol will continue to be supported. You can continue using the Amazon Query protocol as long as your Amazon SDK version is set any version before what is listed in How do I get started with the newer protocols for CloudWatch?.
Where can I find more information about Amazon JSON and Smithy RPC v2 CBOR protocols?
You can find more information about JSON protocol at Amazon JSON 1.0
For more about CloudWatch API requests, see Making API Requests in the CloudWatch API Reference Guide.