<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Florentin Dubois, Author at Clever Cloud</title>
	<atom:link href="https://stagingv6.cleverapps.io/blog/author/florentin-duboisclever-cloud-com/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>From Code to Product</description>
	<lastBuildDate>Fri, 22 Sep 2023 13:09:53 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2023/03/cropped-cropped-favicon-32x32.png</url>
	<title>Florentin Dubois, Author at Clever Cloud</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Removal of TLS 1.0 and 1.1 from our load balancers on June 30</title>
		<link>https://stagingv6.cleverapps.io/blog/engineering/2022/05/03/removal-of-tls-1-0-and-1-1-from-our-load-balancers-on-june-30/</link>
		
		<dc:creator><![CDATA[Florentin Dubois]]></dc:creator>
		<pubDate>Tue, 03 May 2022 08:23:46 +0000</pubDate>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">https://stagingv6.cleverapps.io/?p=6280</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/05/banniere-tls.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="tls" decoding="async" fetchpriority="high" srcset="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/05/banniere-tls.png 1400w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/05/banniere-tls-300x116.png 300w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/05/banniere-tls-1024x395.png 1024w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/05/banniere-tls-768x296.png 768w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/05/banniere-tls-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><!-- wp:paragraph -->
<p>When you access a website or an online application, you most often do so in a "secure" way. This is for example the well-known green padlock that symbolizes HTTPS connections in your browser, which has become a standard these years thanks to initiatives like <a href="https://stagingv6.cleverapps.io/blog/features/2019/01/15/automatic-lets-encrypt-certificates/" target="_blank" rel="noreferrer noopener">Let's Encrypt</a>.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This means that the data transferred to the server is encrypted, and that even if they are intercepted, they cannot be read by a third party. This protection has been provided by the TLS (<a href="https://en.wikipedia.org/wiki/Transport_Layer_Security" target="_blank" rel="noreferrer noopener">Transport Layer Security</a>) protocol for almost 20 years, whether it’s a personal site, an online shop or an access to your bank's services.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Over time, this critical technical brick on the Internet has evolved to strengthen the level of security it offers. In August 2018, <a href="https://www.ietf.org/blog/tls13/" target="_blank" rel="noreferrer noopener">its version 1.3</a> (the latest) was released. Meanwhile, versions 1.0 and 1.1 were considered to no longer offer a sufficient level of protection. They <a href="https://datatracker.ietf.org/doc/html/rfc8996" target="_blank" rel="noreferrer noopener">have been deprecated</a> by the IETF (Internet Engineering Task Force) since March 2021 and have therefore been gradually removed from recent browsers such as Firefox, Chrome and its derivatives or Safari.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":6281,"sizeSlug":"full","linkDestination":"none"} -->
<div class="wp-block-image"><figure class="aligncenter size-full"><img src="https://cdn.clever-cloud.com/uploads/2022/05/sans-titre.webp" alt="Clever Cloud Sōzu TLS Version" class="wp-image-6281"/><figcaption>More than 90% of our traffic is TLS 1.3 </figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>At Clever Cloud, we have seen our customers adopt TLS 1.2 and 1.3 gradually. On our load balancers, based on our in-house and open source reverse proxy <a href="https://www.sozu.io/" target="_blank" rel="noreferrer noopener">Sōzu</a>, the latest version accounts for over 90% of the requests processed each day. TLS 1.2 for just under 9%. TLS 1.0 and 1.1 for only a few tens of thousands of requests per day, less than 0.1% of our traffic.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>While we have maintained these versions for compatibility reasons, this will no longer be the case as of June 30. We will of course inform the customers affected by this choice, and encourage them to switch to more recent versions, which will have advantages for them in terms of security, performance and SEO. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Several reminders will be sent between now and the final shutdown of TLS 1.0 and 1.1. If you have any questions on this subject, please contact our support team through <a href="https://console.clever-cloud.com/" target="_blank" rel="noreferrer noopener">the Console</a>.</p>
<!-- /wp:paragraph -->]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/05/banniere-tls.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="tls" decoding="async" srcset="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/05/banniere-tls.png 1400w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/05/banniere-tls-300x116.png 300w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/05/banniere-tls-1024x395.png 1024w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/05/banniere-tls-768x296.png 768w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/05/banniere-tls-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><!-- wp:paragraph -->
<p>When you access a website or an online application, you most often do so in a "secure" way. This is for example the well-known green padlock that symbolizes HTTPS connections in your browser, which has become a standard these years thanks to initiatives like <a href="https://stagingv6.cleverapps.io/blog/features/2019/01/15/automatic-lets-encrypt-certificates/" target="_blank" rel="noreferrer noopener">Let's Encrypt</a>.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This means that the data transferred to the server is encrypted, and that even if they are intercepted, they cannot be read by a third party. This protection has been provided by the TLS (<a href="https://en.wikipedia.org/wiki/Transport_Layer_Security" target="_blank" rel="noreferrer noopener">Transport Layer Security</a>) protocol for almost 20 years, whether it’s a personal site, an online shop or an access to your bank's services.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Over time, this critical technical brick on the Internet has evolved to strengthen the level of security it offers. In August 2018, <a href="https://www.ietf.org/blog/tls13/" target="_blank" rel="noreferrer noopener">its version 1.3</a> (the latest) was released. Meanwhile, versions 1.0 and 1.1 were considered to no longer offer a sufficient level of protection. They <a href="https://datatracker.ietf.org/doc/html/rfc8996" target="_blank" rel="noreferrer noopener">have been deprecated</a> by the IETF (Internet Engineering Task Force) since March 2021 and have therefore been gradually removed from recent browsers such as Firefox, Chrome and its derivatives or Safari.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":6281,"sizeSlug":"full","linkDestination":"none"} -->
<div class="wp-block-image"><figure class="aligncenter size-full"><img src="https://cdn.clever-cloud.com/uploads/2022/05/sans-titre.webp" alt="Clever Cloud Sōzu TLS Version" class="wp-image-6281"/><figcaption>More than 90% of our traffic is TLS 1.3 </figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>At Clever Cloud, we have seen our customers adopt TLS 1.2 and 1.3 gradually. On our load balancers, based on our in-house and open source reverse proxy <a href="https://www.sozu.io/" target="_blank" rel="noreferrer noopener">Sōzu</a>, the latest version accounts for over 90% of the requests processed each day. TLS 1.2 for just under 9%. TLS 1.0 and 1.1 for only a few tens of thousands of requests per day, less than 0.1% of our traffic.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>While we have maintained these versions for compatibility reasons, this will no longer be the case as of June 30. We will of course inform the customers affected by this choice, and encourage them to switch to more recent versions, which will have advantages for them in terms of security, performance and SEO. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Several reminders will be sent between now and the final shutdown of TLS 1.0 and 1.1. If you have any questions on this subject, please contact our support team through <a href="https://console.clever-cloud.com/" target="_blank" rel="noreferrer noopener">the Console</a>.</p>
<!-- /wp:paragraph -->]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Introducing the Clever Cloud Rust SDK</title>
		<link>https://stagingv6.cleverapps.io/blog/engineering/2022/04/28/introducing-the-clever-cloud-rust-sdk/</link>
		
		<dc:creator><![CDATA[Florentin Dubois]]></dc:creator>
		<pubDate>Thu, 28 Apr 2022 08:44:32 +0000</pubDate>
				<category><![CDATA[Engineering]]></category>
		<guid isPermaLink="false">https://stagingv6.cleverapps.io/?p=6125</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/04/banniere-sdk-rust.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="sdk Rust" decoding="async" loading="lazy" srcset="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/04/banniere-sdk-rust.png 1400w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/04/banniere-sdk-rust-300x116.png 300w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/04/banniere-sdk-rust-1024x395.png 1024w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/04/banniere-sdk-rust-768x296.png 768w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/04/banniere-sdk-rust-1368x528.png 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p><!-- wp:paragraph {"dropCap":true} -->
<p class="has-drop-cap">Hello 🖖, fellow humans and robots! Our engineering team is proud to announce a brand new Rust software development kit (sdk), also known as "<a href="https://crates.io/crates/clevercloud-sdk">clevercloud-sdk</a>" on <a href="https://crates.io">crates.io</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Some of you may have noticed that there are new repositories on our GitHub organization. Those repositories are named "<a href="https://github.com/CleverCloud/clevercloud-sdk-rust">clevercloud-sdk-rust</a>" and "<a href="https://github.com/CleverCloud/oauth10a-rust">oauth10a-rust</a>".  Their goal is to provide a convenient way to interact with the Clever Cloud's API with interesting features that we will highlights in this blog post.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Built to be asynchronous</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The software development kit and the oauth 1.0a client are mainly built on top of two crates that are well-known in the community. Those are <a href="https://github.com/hyperium/hyper">hyper</a>, and the asynchronous runtime that power it, named <a href="https://tokio.rs/">tokio</a>. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The main idea behind using the hyper crate and by extension the tokio asynchronous runtime is to leverage the current ecosystem that gravitates around these crates and efforts to integrate a new kernel API called <a href="https://kernel.dk/io_uring.pdf">io_uring</a>. Once this new kernel API will be integrated into the tokio runtime, this will lead to significant performance, enhancement according to the tokio's <a href="https://tokio.rs/blog/2021-07-tokio-uring">announcement blog post</a>. We can’t wait for this enhancement that will give us a way to iterate faster! 🚀</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Observability in mind</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>These crates are developed with the idea to be fully observable. It has been achieved through others well-known crates as <a href="https://crates.io/crates/log">log</a> and <a href="https://crates.io/crates/tracing">tracing</a>, or using community initiatives like the <a href="https://crates.io/crates/prometheus">prometheus</a> crate. Integrations of those crates are taking part of the compiler <a href="https://doc.rust-lang.org/cargo/reference/features.html">feature flags system</a> provided by the <a href="https://doc.rust-lang.org/book/ch01-03-hello-cargo.html">cargo project</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Standard logging facade</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>First, you need to know that the standard logging facade is enabled by default. It will output useful information of internals behaviors of above crates, using the standard logger if it is defined. It will help you to understand how calls to the Clever Cloud's API are achieved with some debug information, if you need so.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>if you want to disable it, you have to disable the default sets of enabled features. This could be achieved using the following syntax for the <code>clevercloud-sdk</code> crate in your <code>Cargo.toml</code> file.</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-toml">clevercloud-sdk = { version = "^0.10.0", default-features = false }</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3>Metrics-oriented</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"laguage-toml"} -->
<p class="laguage-toml">At Clever Cloud, we think that metrics are important. They help to understand systems by correlating things that doesn't seem to be related in the first place. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"laguage-toml"} -->
<p class="laguage-toml">This is why we have launched <a href="https://stagingv6.cleverapps.io/blog/features/2018/01/16/realtime-metrics/">Clever Cloud Metrics</a> rather soon, some years ago. We recently added more features to it by providing more ways to query Clever Cloud Metrics, thanks to <a href="https://github.com/ovh/erlenmeyer">Erlenmeyer</a> which is a time series query language proxy. You can find more details of how you could use it through this <a href="https://stagingv6.cleverapps.io/blog/engineering/2021/10/12/enabling-promql-queries-with-erlenmeyer/">blog post</a>. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"laguage-toml"} -->
<p class="laguage-toml">Lastly, we have announced the <a href="https://stagingv6.cleverapps.io/blog/features/2021/10/19/announcing-time-series-on-clever-cloud-with-tardis/">Tardis</a> product which empowers you to send us your metrics and we take care of the rest as we always do and more recently we have integrated pre-built Grafana's dashboards to help you to visualize your applications and add-ons state, you can learn more about it <a href="https://stagingv6.cleverapps.io/blog/features/2021/10/28/a-grafana-to-plot-applications-metrics/">here</a>. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Coming back to our crates. You can enable metrics collection using the prometheus crate, by enabling the <em>metrics</em> flags at crate-level in your <code>Cargo.toml</code> file. It could be achieved using the following syntax.</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-toml">clevercloud-sdk = { version = "^0.10.0", features = ["metrics"] }</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Once this feature is enabled, there isn't much more to do. You will need to expose metrics through an HTTP server or send them using the prometheus push gateway. This part is described in the prometheus crate's <a href="https://docs.rs/prometheus">documentation</a> or in its <a href="https://github.com/tikv/rust-prometheus/tree/master/examples">examples</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Tracing capabilities</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Last but not least, a pillar of observability is tracing. According to the OpenTelemetry <a href="https://opentelemetry.io/">initiative</a> and <a href="https://opentelemetry.io/docs/concepts/data-sources/#traces">documentation</a>, tracing is explained as such:</p>
<!-- /wp:paragraph -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><p>Traces track the progression of a single request, called a <strong>trace</strong>, as it is handled by services that make up an application. The request may be initiated by a user or an application. Distributed tracing is a form of tracing that traverses process, network and security boundaries. Each unit of work in a trace is called a <strong>span</strong>; a trace is a tree of spans. Spans are objects that represent the work being done by individual services or components involved in a request as it flows through a system. A span contains a <em>span context</em>, which is a set of globally unique identifiers that represent the unique request that each span is a part of. A span provides Request, Error and Duration (RED) metrics that can be used to debug availability as well as performance issues...</p><cite>OpenTelemetry documentation</cite></blockquote>
<!-- /wp:quote -->

<!-- wp:paragraph -->
<p>If you want to take a closer look to tracing, even if it is not in Rust, you can take a look at the <a href="https://github.com/open-telemetry/">OpenTelemetry GitHub organization</a>. There are plenty of libraries, SDKs and documentation to help you to build your tracing solution or integrate with an already existing one. Besides, if you are using the rust language and maybe the tokio runtime, you can have a look at those blog posts which explain <a href="https://tokio.rs/blog/2019-08-tracing">how tracing works</a> in the above asynchronous runtime and how to visualize them using the <a href="https://tokio.rs/blog/2021-09-console-dev-diary-1">console</a> or using the <a href="https://github.com/tokio-rs/tracing/tree/master/tracing-opentelemetry">OpenTelemetry connector</a> which allow to send traces to more sinks, the list is available on the rust OpenTelemetry GitHub <a href="https://github.com/open-telemetry/opentelemetry-rust">repository</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>So how do we concretely enable the tracing feature using the clevercloud-sdk ? As mentioned above all features are driven using a feature flag, so to get tracing capabilities, you need to enable the <em>trace</em> flag.</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-toml">clevercloud-sdk = { version = "^0.10.0", features = ["trace"] }</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Once the feature flag has been enabled, you will need to collect and send traces using the above connector and sinks. </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>How does it look?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Let us look at a concrete example to illustrate what the clevercloud-sdk looks like. But before going through the usage of the clevercloud-sdk, I will introduce you to the dependencies and requirements you will need. The first thing you need to achieve is to declare crates in the <code>Cargo.toml</code> file. </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-toml">[dependencies]
tokio = { version = "^1.17.0", features = ["full"] }
clevercloud-sdk = { version = "^0.10.0", features = ["metrics", "tokio", "trace", "jsonschemas"] }</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>We are now able to write a proper piece of software using the clevercloud-sdk. Here is an example of how to use the SDK:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-rust">...
use clevercloud_sdk::{
    oauth10a::{
        proxy::{self, ProxyConnectorBuilder},
        Credentials,
    },
    v2::myself,
    Client,
};
...

// See the full code at:
// - https://github.com/CleverCloud/clevercloud-sdk-rust/blob/main/examples/cleverctl
// - https://github.com/CleverCloud/clevercloud-sdk-rust/blob/main/examples/cleverctl/src/cmd/myself.rs
pub async fn get(config: Arc&lt;Configuration&gt;, output: &amp;Output) -&gt; Result&lt;(), Error&gt; {
    let credentials: Credentials = config.credentials.to_owned().into();
    let connector = ProxyConnectorBuilder::try_from_env().map_err(Error::ProxyConnector)?;
    let client = Client::builder()
        .with_credentials(credentials)
        .build(connector);

    let user = myself::get(&amp;client).await.map_err(Error::Get)?;

    println!(
        "{}",
        output
            .format(&amp;user)
            .map_err(|err| Error::FormatOutput(Box::new(err)))?
    );

    Ok(())
}</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Another example of the sdk which interact with add-ons:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-rust">...
use clevercloud_sdk::{
    oauth10a::{
        proxy::{self, ProxyConnectorBuilder},
        Credentials,
    },
    v2::addon,
    Client,
};
...

// See the full code at:
// - https://github.com/CleverCloud/clevercloud-sdk-rust/blob/main/examples/cleverctl
// - https://github.com/CleverCloud/clevercloud-sdk-rust/blob/main/examples/cleverctl/src/cmd/addon/mod.rs 
pub async fn list(
    config: Arc&lt;Configuration&gt;,
    output: &amp;Output,
    organisation_id: &amp;str,
) -&gt; Result&lt;(), Error&gt; {
    let credentials: Credentials = config.credentials.to_owned().into();
    let connector = ProxyConnectorBuilder::try_from_env().map_err(Error::ProxyConnector)?;
    let client = Client::builder()
        .with_credentials(credentials)
        .build(connector);

    let addons = addon::list(&amp;client, organisation_id)
        .await
        .map_err(|err| Error::List(organisation_id.to_owned(), err))?;

    println!(
        "{}",
        output
            .format(&amp;addons)
            .map_err(|err| Error::FormatOutput(Box::new(err)))?
    );
    Ok(())
}</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>You can find the entire source code of the command line interface example in the clevercloud-sdk project into the examples repository or you can follow this <a href="https://github.com/CleverCloud/clevercloud-sdk-rust/blob/main/examples/cli">link</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>What's next?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Let's have a look at the incoming features that are to be integrated into these crates.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Biscuit and oauth2 bearer token</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>At Clever Cloud, we are working on a new authentication and authorization token called Biscuit. More details about it in the <a href="https://stagingv6.cleverapps.io/blog/engineering/2021/04/12/introduction-to-biscuit/">introduction blog post</a>. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This new authentication and authorization token will work with the OAuth 2.0 standard. One job of the SDK and the client under the hood is to ease the transition from OAuth 1.0a to OAuth 2.0 using Biscuit. </p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>New features!</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The Software Development Kit will grow to support the entire API. The next feature is the integration of the event bus in order to subscribe to events that happen on Clever Cloud's platform. You will be able to get notifications about a deployment of an application and so on... </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Besides, those crates are used to build another software that you have discovered in another <a href="https://stagingv6.cleverapps.io/blog/features/2022/03/16/clever-operator/">blog post</a>. It introduce a <a href="https://kubernetes.io/">Kubernetes</a> operator that you may use on <a href="https://www.redhat.com/en/technologies/cloud-computing/openshift">OpenShift</a>, that exposes Clever Cloud's add-ons as <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/">Custom Resources</a>. </p>
<!-- /wp:paragraph -->]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/04/banniere-sdk-rust.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="sdk Rust" decoding="async" loading="lazy" srcset="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/04/banniere-sdk-rust.png 1400w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/04/banniere-sdk-rust-300x116.png 300w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/04/banniere-sdk-rust-1024x395.png 1024w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/04/banniere-sdk-rust-768x296.png 768w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2022/04/banniere-sdk-rust-1368x528.png 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p><!-- wp:paragraph {"dropCap":true} -->
<p class="has-drop-cap">Hello 🖖, fellow humans and robots! Our engineering team is proud to announce a brand new Rust software development kit (sdk), also known as "<a href="https://crates.io/crates/clevercloud-sdk">clevercloud-sdk</a>" on <a href="https://crates.io">crates.io</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Some of you may have noticed that there are new repositories on our GitHub organization. Those repositories are named "<a href="https://github.com/CleverCloud/clevercloud-sdk-rust">clevercloud-sdk-rust</a>" and "<a href="https://github.com/CleverCloud/oauth10a-rust">oauth10a-rust</a>".  Their goal is to provide a convenient way to interact with the Clever Cloud's API with interesting features that we will highlights in this blog post.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Built to be asynchronous</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The software development kit and the oauth 1.0a client are mainly built on top of two crates that are well-known in the community. Those are <a href="https://github.com/hyperium/hyper">hyper</a>, and the asynchronous runtime that power it, named <a href="https://tokio.rs/">tokio</a>. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The main idea behind using the hyper crate and by extension the tokio asynchronous runtime is to leverage the current ecosystem that gravitates around these crates and efforts to integrate a new kernel API called <a href="https://kernel.dk/io_uring.pdf">io_uring</a>. Once this new kernel API will be integrated into the tokio runtime, this will lead to significant performance, enhancement according to the tokio's <a href="https://tokio.rs/blog/2021-07-tokio-uring">announcement blog post</a>. We can’t wait for this enhancement that will give us a way to iterate faster! 🚀</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Observability in mind</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>These crates are developed with the idea to be fully observable. It has been achieved through others well-known crates as <a href="https://crates.io/crates/log">log</a> and <a href="https://crates.io/crates/tracing">tracing</a>, or using community initiatives like the <a href="https://crates.io/crates/prometheus">prometheus</a> crate. Integrations of those crates are taking part of the compiler <a href="https://doc.rust-lang.org/cargo/reference/features.html">feature flags system</a> provided by the <a href="https://doc.rust-lang.org/book/ch01-03-hello-cargo.html">cargo project</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Standard logging facade</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>First, you need to know that the standard logging facade is enabled by default. It will output useful information of internals behaviors of above crates, using the standard logger if it is defined. It will help you to understand how calls to the Clever Cloud's API are achieved with some debug information, if you need so.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>if you want to disable it, you have to disable the default sets of enabled features. This could be achieved using the following syntax for the <code>clevercloud-sdk</code> crate in your <code>Cargo.toml</code> file.</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-toml">clevercloud-sdk = { version = "^0.10.0", default-features = false }</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3>Metrics-oriented</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"laguage-toml"} -->
<p class="laguage-toml">At Clever Cloud, we think that metrics are important. They help to understand systems by correlating things that doesn't seem to be related in the first place. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"laguage-toml"} -->
<p class="laguage-toml">This is why we have launched <a href="https://stagingv6.cleverapps.io/blog/features/2018/01/16/realtime-metrics/">Clever Cloud Metrics</a> rather soon, some years ago. We recently added more features to it by providing more ways to query Clever Cloud Metrics, thanks to <a href="https://github.com/ovh/erlenmeyer">Erlenmeyer</a> which is a time series query language proxy. You can find more details of how you could use it through this <a href="https://stagingv6.cleverapps.io/blog/engineering/2021/10/12/enabling-promql-queries-with-erlenmeyer/">blog post</a>. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"laguage-toml"} -->
<p class="laguage-toml">Lastly, we have announced the <a href="https://stagingv6.cleverapps.io/blog/features/2021/10/19/announcing-time-series-on-clever-cloud-with-tardis/">Tardis</a> product which empowers you to send us your metrics and we take care of the rest as we always do and more recently we have integrated pre-built Grafana's dashboards to help you to visualize your applications and add-ons state, you can learn more about it <a href="https://stagingv6.cleverapps.io/blog/features/2021/10/28/a-grafana-to-plot-applications-metrics/">here</a>. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Coming back to our crates. You can enable metrics collection using the prometheus crate, by enabling the <em>metrics</em> flags at crate-level in your <code>Cargo.toml</code> file. It could be achieved using the following syntax.</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-toml">clevercloud-sdk = { version = "^0.10.0", features = ["metrics"] }</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Once this feature is enabled, there isn't much more to do. You will need to expose metrics through an HTTP server or send them using the prometheus push gateway. This part is described in the prometheus crate's <a href="https://docs.rs/prometheus">documentation</a> or in its <a href="https://github.com/tikv/rust-prometheus/tree/master/examples">examples</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Tracing capabilities</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Last but not least, a pillar of observability is tracing. According to the OpenTelemetry <a href="https://opentelemetry.io/">initiative</a> and <a href="https://opentelemetry.io/docs/concepts/data-sources/#traces">documentation</a>, tracing is explained as such:</p>
<!-- /wp:paragraph -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><p>Traces track the progression of a single request, called a <strong>trace</strong>, as it is handled by services that make up an application. The request may be initiated by a user or an application. Distributed tracing is a form of tracing that traverses process, network and security boundaries. Each unit of work in a trace is called a <strong>span</strong>; a trace is a tree of spans. Spans are objects that represent the work being done by individual services or components involved in a request as it flows through a system. A span contains a <em>span context</em>, which is a set of globally unique identifiers that represent the unique request that each span is a part of. A span provides Request, Error and Duration (RED) metrics that can be used to debug availability as well as performance issues...</p><cite>OpenTelemetry documentation</cite></blockquote>
<!-- /wp:quote -->

<!-- wp:paragraph -->
<p>If you want to take a closer look to tracing, even if it is not in Rust, you can take a look at the <a href="https://github.com/open-telemetry/">OpenTelemetry GitHub organization</a>. There are plenty of libraries, SDKs and documentation to help you to build your tracing solution or integrate with an already existing one. Besides, if you are using the rust language and maybe the tokio runtime, you can have a look at those blog posts which explain <a href="https://tokio.rs/blog/2019-08-tracing">how tracing works</a> in the above asynchronous runtime and how to visualize them using the <a href="https://tokio.rs/blog/2021-09-console-dev-diary-1">console</a> or using the <a href="https://github.com/tokio-rs/tracing/tree/master/tracing-opentelemetry">OpenTelemetry connector</a> which allow to send traces to more sinks, the list is available on the rust OpenTelemetry GitHub <a href="https://github.com/open-telemetry/opentelemetry-rust">repository</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>So how do we concretely enable the tracing feature using the clevercloud-sdk ? As mentioned above all features are driven using a feature flag, so to get tracing capabilities, you need to enable the <em>trace</em> flag.</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-toml">clevercloud-sdk = { version = "^0.10.0", features = ["trace"] }</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Once the feature flag has been enabled, you will need to collect and send traces using the above connector and sinks. </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>How does it look?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Let us look at a concrete example to illustrate what the clevercloud-sdk looks like. But before going through the usage of the clevercloud-sdk, I will introduce you to the dependencies and requirements you will need. The first thing you need to achieve is to declare crates in the <code>Cargo.toml</code> file. </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-toml">[dependencies]
tokio = { version = "^1.17.0", features = ["full"] }
clevercloud-sdk = { version = "^0.10.0", features = ["metrics", "tokio", "trace", "jsonschemas"] }</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>We are now able to write a proper piece of software using the clevercloud-sdk. Here is an example of how to use the SDK:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-rust">...
use clevercloud_sdk::{
    oauth10a::{
        proxy::{self, ProxyConnectorBuilder},
        Credentials,
    },
    v2::myself,
    Client,
};
...

// See the full code at:
// - https://github.com/CleverCloud/clevercloud-sdk-rust/blob/main/examples/cleverctl
// - https://github.com/CleverCloud/clevercloud-sdk-rust/blob/main/examples/cleverctl/src/cmd/myself.rs
pub async fn get(config: Arc&lt;Configuration&gt;, output: &amp;Output) -&gt; Result&lt;(), Error&gt; {
    let credentials: Credentials = config.credentials.to_owned().into();
    let connector = ProxyConnectorBuilder::try_from_env().map_err(Error::ProxyConnector)?;
    let client = Client::builder()
        .with_credentials(credentials)
        .build(connector);

    let user = myself::get(&amp;client).await.map_err(Error::Get)?;

    println!(
        "{}",
        output
            .format(&amp;user)
            .map_err(|err| Error::FormatOutput(Box::new(err)))?
    );

    Ok(())
}</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Another example of the sdk which interact with add-ons:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-rust">...
use clevercloud_sdk::{
    oauth10a::{
        proxy::{self, ProxyConnectorBuilder},
        Credentials,
    },
    v2::addon,
    Client,
};
...

// See the full code at:
// - https://github.com/CleverCloud/clevercloud-sdk-rust/blob/main/examples/cleverctl
// - https://github.com/CleverCloud/clevercloud-sdk-rust/blob/main/examples/cleverctl/src/cmd/addon/mod.rs 
pub async fn list(
    config: Arc&lt;Configuration&gt;,
    output: &amp;Output,
    organisation_id: &amp;str,
) -&gt; Result&lt;(), Error&gt; {
    let credentials: Credentials = config.credentials.to_owned().into();
    let connector = ProxyConnectorBuilder::try_from_env().map_err(Error::ProxyConnector)?;
    let client = Client::builder()
        .with_credentials(credentials)
        .build(connector);

    let addons = addon::list(&amp;client, organisation_id)
        .await
        .map_err(|err| Error::List(organisation_id.to_owned(), err))?;

    println!(
        "{}",
        output
            .format(&amp;addons)
            .map_err(|err| Error::FormatOutput(Box::new(err)))?
    );
    Ok(())
}</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>You can find the entire source code of the command line interface example in the clevercloud-sdk project into the examples repository or you can follow this <a href="https://github.com/CleverCloud/clevercloud-sdk-rust/blob/main/examples/cli">link</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>What's next?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Let's have a look at the incoming features that are to be integrated into these crates.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Biscuit and oauth2 bearer token</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>At Clever Cloud, we are working on a new authentication and authorization token called Biscuit. More details about it in the <a href="https://stagingv6.cleverapps.io/blog/engineering/2021/04/12/introduction-to-biscuit/">introduction blog post</a>. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This new authentication and authorization token will work with the OAuth 2.0 standard. One job of the SDK and the client under the hood is to ease the transition from OAuth 1.0a to OAuth 2.0 using Biscuit. </p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>New features!</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The Software Development Kit will grow to support the entire API. The next feature is the integration of the event bus in order to subscribe to events that happen on Clever Cloud's platform. You will be able to get notifications about a deployment of an application and so on... </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Besides, those crates are used to build another software that you have discovered in another <a href="https://stagingv6.cleverapps.io/blog/features/2022/03/16/clever-operator/">blog post</a>. It introduce a <a href="https://kubernetes.io/">Kubernetes</a> operator that you may use on <a href="https://www.redhat.com/en/technologies/cloud-computing/openshift">OpenShift</a>, that exposes Clever Cloud's add-ons as <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/">Custom Resources</a>. </p>
<!-- /wp:paragraph -->]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
