<?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>logs Archives | Clever Cloud</title>
	<atom:link href="https://www.clever.cloud/blog/tag/logs/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.clever.cloud/blog/tag/logs/</link>
	<description>From Code to Product</description>
	<lastBuildDate>Thu, 27 Nov 2025 15:28:15 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://cdn.clever-cloud.com/uploads/2023/03/cropped-cropped-favicon-32x32.png</url>
	<title>logs Archives | Clever Cloud</title>
	<link>https://www.clever.cloud/blog/tag/logs/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>GlitchTip on Clever Cloud, a Sentry alternative</title>
		<link>https://www.clever.cloud/blog/features/2022/06/21/glitchtip-on-clever-cloud-a-sentry-alternative/</link>
		
		<dc:creator><![CDATA[Aurélien Hebert]]></dc:creator>
		<pubDate>Tue, 21 Jun 2022 15:13:11 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[logs]]></category>
		<category><![CDATA[observability]]></category>
		<guid isPermaLink="false">https://www.clever-cloud.com/?p=6478</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2022/06/glitchtip.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="glitchtip" decoding="async" fetchpriority="high" srcset="https://cdn.clever-cloud.com/uploads/2022/06/glitchtip.png 1400w, https://cdn.clever-cloud.com/uploads/2022/06/glitchtip-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2022/06/glitchtip-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2022/06/glitchtip-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2022/06/glitchtip-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><!-- wp:paragraph -->
<p>At Clever Cloud, we like to have some context about our application status and logs. That's why we have a lot of tools deployed to gain some observability. A lot of them are freely available for our customers (a log view, a metrics view or Grafana). Still, there are some tools that we use internally that could be helpful to many. We discovered recently <a href="https://glitchtip.com/" target="_blank" rel="noreferrer noopener">glichtip</a>, which is an open source error tracking. Glichtip is a great alternative to Sentry and less complex to deploy. We will add that Glichtip is compatible with the <a href="https://docs.sentry.io/platforms/">Sentry's open source SDK</a>.  </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Context</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>We used Sentry to analyse the errors coming from our own application logs. We were still using the <code>9.1</code> version until we had too many trouble to keep it running. We then had to upgrade or find a new solution. All Sentry version post <code>9.1</code> require many more components to deploy (as Kafka, Snuba or Clickhouse). This is still possible to deploy it with a <a href="https://develop.sentry.dev/self-hosted/">self hosted script</a>. We wanted every component to be standalone outside of the main Sentry application, it meant that we had to provide authentication to all components. It was not a big issue, but it took us more time that what we first expected. And at the same time, we discovered a new project: Glitchtip. </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Glitchtip</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>All started by a French <a href="https://twitter.com/aeris22/status/1516411508225417228?t=EdjijoImwBdKwOjI63m5-A&amp;s=19">tweet</a>, about the discovery of a new tool: <a href="https://glitchtip.com/">Glitchtip</a>. This tweet said that Glitchtip is compatible to Sentry, free and easy to self host it, so it was evident that we were going to give it a try.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>What does Glitchtip provide? Inside your application, with the Sentry SDK, you will transfer some of your error logs. Then the tool help you to track those errors, to better understand when a new version tool creates new errors,  organize or search them... In a quick word, it's a very useful tool to debug your deployed software. </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Clever Cloud deploy </h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Setup</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>First, we will download Glitchtip <code>Docker</code> project and customize it a bit to match how docker applications are run in Clever Cloud.</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Get latest Glitchtip release
git clone https://gitlab.com/glitchtip/glitchtip.git

# Go to the folder
cd glitchtip
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Then open your favorite code IDE and open the <code>Dockerfile</code>: </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Remove
FROM glitchtip/glitchtip:latest

# And add instead:
FROM glitchtip/glitchtip:v1.12.2

COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Here we will set-up the last Glitchtip release. When we were writing this blog it was the <code>v1.12.2</code>. You can find them <a href="https://hub.docker.com/r/glitchtip/glitchtip/tags">here</a>. We set up a new script to use <code>docker-entrypoint.sh</code> which will enable us to start or the Glitchtip web application or the Glitchtip worker. The <code>docker-entrypoint.sh</code> should contain the following script:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># docker-entrypoint.sh script:
#!/bin/bash

if [ "${START_TARGET}" = "worker" ]; then
  mkdir /tmp/sandboxed
	cd /tmp/sandboxed &amp;&amp; nohup python -m http.server 8080 &amp;
	/code/bin/run-celery-with-beat.sh
else
  /code/bin/start.sh
fi

# Don't forget to make it executable:
chmod u+x docker-entrypoint.sh
</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Deploy</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Glitchtip comes with a <code>Dockerfile</code>, which means we will use a <a href="https://www.clever.cloud/developers/deploy/application/java/java-jar/">a docker runtime</a>. It also requires a <a href="https://www.postgresql.org/">PostgreSQL Database</a> and <a href="https://redis.io/">a Redis cache</a>, which means we will deploy a <a href="https://www.clever.cloud/developers/doc/addons/postgresql/">PostgreSQL</a><a href="https://www.clever.cloud/developers/deploy/addon/postgresql/postgresql/"> addon</a> and a <a href="https://www.clever.cloud/developers/doc/addons/redis/">Redis addon.</a> Adding a <code>-o</code> option in all <code>create</code> command line can be used to specify which organisation to use.</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Create the docker applications:
clever create --type docker glitchtip-web
clever create --type docker glitchtip-worker

# Create the PG addon
clever addon create postgresql-addon --plan s_sml --addon-version 14 glitchtip-postgres

# Link the addon
clever service link-addon glitchtip-postgres -a glitchtip-web
clever service link-addon glitchtip-postgres -a glitchtip-worker

# Create the Redis addon
clever addon create redis-addon --plan s_mono glitchtip-redis

# Link the addon
clever service link-addon glitchtip-redis -a glitchtip-web
clever service link-addon glitchtip-redis -a glitchtip-worker
</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Config</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>For now we will configure Glitchtip through environment variables. As we use several applications, let's deploy an addon configuration provider. </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Create a config addon:
clever addon create config-provider --plan std glitchtip-config

# Link the addon
clever service link-addon glitchtip-config -a glitchtip-web
clever service link-addon glitchtip-config -a glitchtip-worker

</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Now that we have deployed a config addon provider let's update its configuration. To do it go to the Clever Cloud console and then select the <code>glitchtip-config</code>. In the variable panel, select the <code>expert</code> mode and add the following required variable, (fill their value based on the provided commentary):</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># In the config addon provider add:
CC_DOCKER_EXPOSED_HTTP_PORT="8080"
# Copy paste here the POSTGRESQL_ADDON_URI environment variable of the glitchtip-postgres addon 
DATABASE_URL="postgresql://user:password@host:port/database"
# Provide a valid email server
EMAIL_URL="smtp://email:password@smtp_url:port"
# Copy paste here the application domain name of the glitchtip-web application instead (should look like: https://app-da7a7a7a-da7a-4242-7a7a-da7a42427a7a.cleverapps.io)
GLITCHTIP_DOMAIN="MY_APP_DOMAIN_NAME"
# Copy paste here the REDIS_ADDON's environment variable of the glitchtip-redis addon 
REDIS_HOST= &lt; REDIS_HOST &gt;
REDIS_PASSWORD= &lt; REDIS_PASSWORD &gt; 
REDIS_PORT= &lt; REDIS_PORT &gt;
# Generate your own custom secret key for Glitchtip
SECRET_KEY= &lt; choose a secret key &gt;
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Note that you can find more information about how to configure Glitchtip in its <a href="https://glitchtip.com/documentation/install#configuration">documentation</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Each docker application requires some custom configuration too:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">#glitchtip-web custom env
clever env set CC_RUN_SUCCEEDED_HOOK "./manage.py migrate" -a glitchtip-web
clever env set START_TARGET "web" -a glitchtip-web
#glitchtip-worker custom env
clever env set START_TARGET "worker" -a glitchtip-worker
</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Deploy and run</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Now that everything is set, it's time to deploy and run your Glitchtip application. </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Remove initial git
rm -r .git 

# Init a git repository
git init

# Add your files
git add .

# Commit the changes
git commit -m "clever init and deploy"

# Deploy the application
clever deploy -a glitchtip-web
clever deploy -a glitchtip-worker

# Open Glitchtip in your browser
clever open -a glitchtip-web
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Your glitchtip is now almost ready to use. One last action is required: you need to create a super user to administrate Glitchtip. </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Connect in SSH to your Clever application:
clever ssh -a glitchtip-web

# Run 
./manage.py createsuperuser
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Great job! You should now have an access to glitchtip admin page (available on your application /admin path). You can then create users or connect to your favorite social application to authenticate your users. You will find more information on the <a href="https://glitchtip.com/documentation/install#django-admin">documentation</a>. You can set your <a href="https://www.clever.cloud/blog/fonctionnalites/2022/05/11/how-to-deploy-keycloak-on-clever-cloud/">own keycloak on Clever Cloud</a> and use it to connect to Glitchtip! </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Connect Glitchtip to an application</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>We will reuse the akka application example we used for our <a href="https://www.clever.cloud/blog/fonctionnalites">scala exemple blogpost</a>. And we will then see how we can forward our own error logs to Glitchtip.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Create a Glitchtip project</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The first step will be to login with new root user (or any Glitchtip user you created or linked with a social application). Glitchtip will ask you to create your organisation. In our case let's set <code>clever-cloud</code>. As we want to monitore our application error's logs, we will need to create a new project directly in Glitchtip UI. Let's call it "myakka" and create it's associated "Scala-dev" team. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Once this project is create you will be able to get a <code>DSN</code>. We will load it later as environment variable for the akka application. </p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Create a Glitchtip Token </h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Go to <code>Profile/auth token</code> and craft a new glitchtip token with at least the following project rights: read, write and releases. Save it for later.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Setup the AKKA example application on Clever Cloud</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The first step will be to deploy AKKA example application on Clever Cloud as mentionned in the <a href="https://www.clever.cloud/blog/fonctionnalites">scala exemple blogpost</a>. <a href="https://github.com/CleverCloud/scala-akka-http-postgres-example" target="_blank" rel="noreferrer noopener">Clone</a> the project and instead of the main branch, use the <code>blogpost-sentry</code> one. </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Clone Clever Cloud akka example project:
git clone https://github.com/CleverCloud/scala-akka-http-postgres-example.git

# Checkout blogpost-sentry
git checkout blogpost-sentry
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>In this branch, we update a bit the application to connect it to Sentry. Then we send only the starting server HTTP logs with a custom status tag (success or failure). This is code we use in the <code>blogpost-sentry</code> branch:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Register Sentry
Sentry.init(sentryConfig.sentryDsn)

# Send a message to Sentry with a tag
Sentry.getContext().addTag("status", status)
Sentry.capture(message)
Sentry.getContext().clear()
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p><strong>In addition, you have to</strong> <strong>add</strong> a <code>.sentryclirc</code> file. This file should contain:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">[defaults]
url=GLITCHTIP_APP_DOMAIN_NAME
org=clever-cloud
project=myakka
</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Configure Glitchtip environment variables</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Use the <code>post_build.sh</code> script as <code>CC_POST_BUILD_HOOK</code>. This will run the  mandatory <code>sbt flywayMigrate</code> as well as create a new release on Sentry (based on the commit ID). </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Set CC_POST_BUILD_HOOK
clever env -a myakka set CC_POST_BUILD_HOOK "./post_build.sh"
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>You also need to set Glitchtip token and Glitchtip dsn as environnement variables:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Set Glitchip required env variables
clever env -a myakka set SENTRY_AUTH_TOKEN &lt; custom_glitchtip_token &gt;  
clever env -a myakka set SENTRY_DSN &lt; custom_glitchtip_dsn &gt;  
</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Deploy the application</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>You can now deploy myakka project:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Deploy myakka
clever deploy
</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Try it </h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>As soon as this done, you should see your first issue on Glitchip! That's all, you can now add all the application you want to Glitchtip and enjoy this tool to centralise your application logs and errors.  If you're used to this product or just try it feel free to share with us any feedback <a href="https://twitter.com/clever_cloud">on Twitter</a>.</p>
<!-- /wp:paragraph -->]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2022/06/glitchtip.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="glitchtip" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2022/06/glitchtip.png 1400w, https://cdn.clever-cloud.com/uploads/2022/06/glitchtip-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2022/06/glitchtip-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2022/06/glitchtip-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2022/06/glitchtip-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><!-- wp:paragraph -->
<p>At Clever Cloud, we like to have some context about our application status and logs. That's why we have a lot of tools deployed to gain some observability. A lot of them are freely available for our customers (a log view, a metrics view or Grafana). Still, there are some tools that we use internally that could be helpful to many. We discovered recently <a href="https://glitchtip.com/" target="_blank" rel="noreferrer noopener">glichtip</a>, which is an open source error tracking. Glichtip is a great alternative to Sentry and less complex to deploy. We will add that Glichtip is compatible with the <a href="https://docs.sentry.io/platforms/">Sentry's open source SDK</a>.  </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Context</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>We used Sentry to analyse the errors coming from our own application logs. We were still using the <code>9.1</code> version until we had too many trouble to keep it running. We then had to upgrade or find a new solution. All Sentry version post <code>9.1</code> require many more components to deploy (as Kafka, Snuba or Clickhouse). This is still possible to deploy it with a <a href="https://develop.sentry.dev/self-hosted/">self hosted script</a>. We wanted every component to be standalone outside of the main Sentry application, it meant that we had to provide authentication to all components. It was not a big issue, but it took us more time that what we first expected. And at the same time, we discovered a new project: Glitchtip. </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Glitchtip</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>All started by a French <a href="https://twitter.com/aeris22/status/1516411508225417228?t=EdjijoImwBdKwOjI63m5-A&amp;s=19">tweet</a>, about the discovery of a new tool: <a href="https://glitchtip.com/">Glitchtip</a>. This tweet said that Glitchtip is compatible to Sentry, free and easy to self host it, so it was evident that we were going to give it a try.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>What does Glitchtip provide? Inside your application, with the Sentry SDK, you will transfer some of your error logs. Then the tool help you to track those errors, to better understand when a new version tool creates new errors,  organize or search them... In a quick word, it's a very useful tool to debug your deployed software. </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Clever Cloud deploy </h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Setup</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>First, we will download Glitchtip <code>Docker</code> project and customize it a bit to match how docker applications are run in Clever Cloud.</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Get latest Glitchtip release
git clone https://gitlab.com/glitchtip/glitchtip.git

# Go to the folder
cd glitchtip
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Then open your favorite code IDE and open the <code>Dockerfile</code>: </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Remove
FROM glitchtip/glitchtip:latest

# And add instead:
FROM glitchtip/glitchtip:v1.12.2

COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Here we will set-up the last Glitchtip release. When we were writing this blog it was the <code>v1.12.2</code>. You can find them <a href="https://hub.docker.com/r/glitchtip/glitchtip/tags">here</a>. We set up a new script to use <code>docker-entrypoint.sh</code> which will enable us to start or the Glitchtip web application or the Glitchtip worker. The <code>docker-entrypoint.sh</code> should contain the following script:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># docker-entrypoint.sh script:
#!/bin/bash

if [ "${START_TARGET}" = "worker" ]; then
  mkdir /tmp/sandboxed
	cd /tmp/sandboxed &amp;&amp; nohup python -m http.server 8080 &amp;
	/code/bin/run-celery-with-beat.sh
else
  /code/bin/start.sh
fi

# Don't forget to make it executable:
chmod u+x docker-entrypoint.sh
</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Deploy</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Glitchtip comes with a <code>Dockerfile</code>, which means we will use a <a href="https://www.clever.cloud/developers/deploy/application/java/java-jar/">a docker runtime</a>. It also requires a <a href="https://www.postgresql.org/">PostgreSQL Database</a> and <a href="https://redis.io/">a Redis cache</a>, which means we will deploy a <a href="https://www.clever.cloud/developers/doc/addons/postgresql/">PostgreSQL</a><a href="https://www.clever.cloud/developers/deploy/addon/postgresql/postgresql/"> addon</a> and a <a href="https://www.clever.cloud/developers/doc/addons/redis/">Redis addon.</a> Adding a <code>-o</code> option in all <code>create</code> command line can be used to specify which organisation to use.</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Create the docker applications:
clever create --type docker glitchtip-web
clever create --type docker glitchtip-worker

# Create the PG addon
clever addon create postgresql-addon --plan s_sml --addon-version 14 glitchtip-postgres

# Link the addon
clever service link-addon glitchtip-postgres -a glitchtip-web
clever service link-addon glitchtip-postgres -a glitchtip-worker

# Create the Redis addon
clever addon create redis-addon --plan s_mono glitchtip-redis

# Link the addon
clever service link-addon glitchtip-redis -a glitchtip-web
clever service link-addon glitchtip-redis -a glitchtip-worker
</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Config</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>For now we will configure Glitchtip through environment variables. As we use several applications, let's deploy an addon configuration provider. </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Create a config addon:
clever addon create config-provider --plan std glitchtip-config

# Link the addon
clever service link-addon glitchtip-config -a glitchtip-web
clever service link-addon glitchtip-config -a glitchtip-worker

</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Now that we have deployed a config addon provider let's update its configuration. To do it go to the Clever Cloud console and then select the <code>glitchtip-config</code>. In the variable panel, select the <code>expert</code> mode and add the following required variable, (fill their value based on the provided commentary):</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># In the config addon provider add:
CC_DOCKER_EXPOSED_HTTP_PORT="8080"
# Copy paste here the POSTGRESQL_ADDON_URI environment variable of the glitchtip-postgres addon 
DATABASE_URL="postgresql://user:password@host:port/database"
# Provide a valid email server
EMAIL_URL="smtp://email:password@smtp_url:port"
# Copy paste here the application domain name of the glitchtip-web application instead (should look like: https://app-da7a7a7a-da7a-4242-7a7a-da7a42427a7a.cleverapps.io)
GLITCHTIP_DOMAIN="MY_APP_DOMAIN_NAME"
# Copy paste here the REDIS_ADDON's environment variable of the glitchtip-redis addon 
REDIS_HOST= &lt; REDIS_HOST &gt;
REDIS_PASSWORD= &lt; REDIS_PASSWORD &gt; 
REDIS_PORT= &lt; REDIS_PORT &gt;
# Generate your own custom secret key for Glitchtip
SECRET_KEY= &lt; choose a secret key &gt;
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Note that you can find more information about how to configure Glitchtip in its <a href="https://glitchtip.com/documentation/install#configuration">documentation</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Each docker application requires some custom configuration too:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">#glitchtip-web custom env
clever env set CC_RUN_SUCCEEDED_HOOK "./manage.py migrate" -a glitchtip-web
clever env set START_TARGET "web" -a glitchtip-web
#glitchtip-worker custom env
clever env set START_TARGET "worker" -a glitchtip-worker
</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Deploy and run</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Now that everything is set, it's time to deploy and run your Glitchtip application. </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Remove initial git
rm -r .git 

# Init a git repository
git init

# Add your files
git add .

# Commit the changes
git commit -m "clever init and deploy"

# Deploy the application
clever deploy -a glitchtip-web
clever deploy -a glitchtip-worker

# Open Glitchtip in your browser
clever open -a glitchtip-web
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Your glitchtip is now almost ready to use. One last action is required: you need to create a super user to administrate Glitchtip. </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Connect in SSH to your Clever application:
clever ssh -a glitchtip-web

# Run 
./manage.py createsuperuser
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Great job! You should now have an access to glitchtip admin page (available on your application /admin path). You can then create users or connect to your favorite social application to authenticate your users. You will find more information on the <a href="https://glitchtip.com/documentation/install#django-admin">documentation</a>. You can set your <a href="https://www.clever.cloud/blog/fonctionnalites/2022/05/11/how-to-deploy-keycloak-on-clever-cloud/">own keycloak on Clever Cloud</a> and use it to connect to Glitchtip! </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Connect Glitchtip to an application</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>We will reuse the akka application example we used for our <a href="https://www.clever.cloud/blog/fonctionnalites">scala exemple blogpost</a>. And we will then see how we can forward our own error logs to Glitchtip.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Create a Glitchtip project</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The first step will be to login with new root user (or any Glitchtip user you created or linked with a social application). Glitchtip will ask you to create your organisation. In our case let's set <code>clever-cloud</code>. As we want to monitore our application error's logs, we will need to create a new project directly in Glitchtip UI. Let's call it "myakka" and create it's associated "Scala-dev" team. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Once this project is create you will be able to get a <code>DSN</code>. We will load it later as environment variable for the akka application. </p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Create a Glitchtip Token </h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Go to <code>Profile/auth token</code> and craft a new glitchtip token with at least the following project rights: read, write and releases. Save it for later.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Setup the AKKA example application on Clever Cloud</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The first step will be to deploy AKKA example application on Clever Cloud as mentionned in the <a href="https://www.clever.cloud/blog/fonctionnalites">scala exemple blogpost</a>. <a href="https://github.com/CleverCloud/scala-akka-http-postgres-example" target="_blank" rel="noreferrer noopener">Clone</a> the project and instead of the main branch, use the <code>blogpost-sentry</code> one. </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Clone Clever Cloud akka example project:
git clone https://github.com/CleverCloud/scala-akka-http-postgres-example.git

# Checkout blogpost-sentry
git checkout blogpost-sentry
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>In this branch, we update a bit the application to connect it to Sentry. Then we send only the starting server HTTP logs with a custom status tag (success or failure). This is code we use in the <code>blogpost-sentry</code> branch:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Register Sentry
Sentry.init(sentryConfig.sentryDsn)

# Send a message to Sentry with a tag
Sentry.getContext().addTag("status", status)
Sentry.capture(message)
Sentry.getContext().clear()
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p><strong>In addition, you have to</strong> <strong>add</strong> a <code>.sentryclirc</code> file. This file should contain:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">[defaults]
url=GLITCHTIP_APP_DOMAIN_NAME
org=clever-cloud
project=myakka
</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Configure Glitchtip environment variables</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Use the <code>post_build.sh</code> script as <code>CC_POST_BUILD_HOOK</code>. This will run the  mandatory <code>sbt flywayMigrate</code> as well as create a new release on Sentry (based on the commit ID). </p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Set CC_POST_BUILD_HOOK
clever env -a myakka set CC_POST_BUILD_HOOK "./post_build.sh"
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>You also need to set Glitchtip token and Glitchtip dsn as environnement variables:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Set Glitchip required env variables
clever env -a myakka set SENTRY_AUTH_TOKEN &lt; custom_glitchtip_token &gt;  
clever env -a myakka set SENTRY_DSN &lt; custom_glitchtip_dsn &gt;  
</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Deploy the application</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>You can now deploy myakka project:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash"># Deploy myakka
clever deploy
</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Try it </h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>As soon as this done, you should see your first issue on Glitchip! That's all, you can now add all the application you want to Glitchtip and enjoy this tool to centralise your application logs and errors.  If you're used to this product or just try it feel free to share with us any feedback <a href="https://twitter.com/clever_cloud">on Twitter</a>.</p>
<!-- /wp:paragraph -->]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Access Logs are now available from Clever Tools</title>
		<link>https://www.clever.cloud/blog/features/2020/04/09/access-logs-clever-tools/</link>
		
		<dc:creator><![CDATA[Laurent Doguin]]></dc:creator>
		<pubDate>Thu, 09 Apr 2020 11:35:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[accesslogs]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[logs]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2020/04/09/access-logs-clever-tools/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/access-logs-clever-tools-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="access logs clever tools 1" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2021/08/access-logs-clever-tools-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/access-logs-clever-tools-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/access-logs-clever-tools-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/access-logs-clever-tools-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/access-logs-clever-tools-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p>Yes you read it right, you can now access your access logs. How you ask? With the latest release of Clever Tools. But before we see how it works, let me explain what access logs are.

<span id="more-2973"></span>

Access logs contain all incoming requests to a web server. They are available in different formats. One of the most common being CLF which stands for <a href="https://en.wikipedia.org/wiki/Common_Log_Format">Common Log Format</a>. Here's an example where you can find the IP of the client, date, HTTP verb, URL target, status code and size of the answer: <code>255.255.255.255 - - [06/Feb/2020:07:59:22 +0100] "GET /aget/to/your/beautiful/website -" 200 1453</code>
<h2 id="how-to-get-your-access-logs">How to get your access logs</h2>
To get your access logs you need to use <a href="https://github.com/CleverCloud/clever-tools/">clever-tools</a> and run this in a linked application:

<code>clever accesslogs</code>

You will get all the requests that came to this app in the last hour. This also work for most dedicated add-ons using <code>--addon</code> followed by the add-on id:

<code>clever accesslogs --addon addon_41c5a60f-11c6-442a-9803-f4604fe8638b</code>

You can also choose a date span using <code>--after</code> and <code>--before</code> like so:

<code>clever accesslogs --after 2020-03-27 --before 2020-03-29</code>

Any date you give must follow ISO 8601. You could for instance have a microsecond precision like this:

<code>clever accesslogs --after 2020-03-29T11:01:02.120000Z --before 2020-03-29T11:01:02.123456Z</code>

You can also change the format of the logs with <code>-F</code> (or <code>--format</code>):

<code>clever accesslogs --after 2020-03-28 --before 2020-03-29 -F json</code>

Here's an example of JSON entry, it contains all of the information currently available for each request:
<pre><code class="language-json">{
  "t": "2020-03-10T11:24:34.220324Z",
  "a": "app_87d748d4-3c7b-4baa-8f52-c748e1123ab3",
  "adc": "par-cleverapps-adc-n6",
  "o": "user_51f7098f-604e-4d9e-8fb6-4026fd1767bb",
  "i": "0805330e-cff6-4fd5-87c0-26974d8bcb4e",
  "ipS": "255.255.255.255",
  "pS": 38566,
  "s": {
    "lt": 48.6719,
    "lg": 1.3002,
    "ct": "Aunay-sous-Crecy",
    "co": "FR"
  },
  "ipD": "255.258.258.258",
  "pD": 11810,
  "d": {
    "lt": 48.7967,
    "lg": 2.3338,
    "ct": "Cachan",
    "co": "FR"
  },
  "vb": "GET",
  "path": "/status-codes/500",
  "bIn": 411,
  "bOut": 443,
  "h": "app-87d748d4-3c7b-4baa-8f52-c748e1123ab3.cleverapps.io",
  "rTime": "3ms",
  "sTime": "115μs",
  "scheme": "HTTPS",
  "sC": 500,
  "sT": "Internal Server Error",
  "w": "WRK-01",
  "r": "b6bcab8a-c6d0-4546-9000-57b43d009a49",
  "tlsV": "TLS1.3"
}
</code></pre>
You will find the details for every field in our <a href="https://www.clever.cloud/developers/administrate/metrics/overview/#access-logs-metrics">access logs documentation</a>.
<h2 id="what-you-can-do-with-your-logs">What you can do with your logs</h2>
Now let's say you want to know what are the most returned status codes from a log file, here's how you can do it:
<pre><code class="language-bash">clever accesslogs --after 2020-03-10 --before 2020-03-20 -F json | jq .sC | sort | uniq -c | sort -nr
</code></pre>
Here we use the JSON format and <code>jq</code> to select the field we want, then <code>sort</code> and <code>uniq</code> to get a proper output, which would yield something like:
<pre><code class="language-text">  99999 200
     56 500
     33 404
      2 400
      1 403
      1 301
      1 202
</code></pre>
The first column being the number of hits and the second being the status code.

Now for something a bit more practical, here's a script that allows you to split access logs for each day between two dates:
<pre><code class="language-bash">#!/bin/bash

input_start=2020-01-01
input_end=2020-03-27

startdate=$(date -I -d "$input_start") || exit -1
enddate=$(date -I -d "$input_end")     || exit -1

d="$startdate"
while [ "$d" != "$enddate" ]; do 
  clever accesslogs --alias prod --after $d --before $(date -I -d "$bv d + 1 day") -F clf &gt; access-$d.out
  d=$(date -I -d "$d + 1 day")
done
</code></pre>
It's hard to visualize so much data if you don't have the proper tools. So I really invite you to try <a href="https://goaccess.io/">GoAccess</a>. Combine the script above and this command <code>goaccess access* -o report.html --log-format=COMMON --anonymize-ip</code>. You will get this neat, anonymized HTML report:
<figure><img src="https://cdn.clever-cloud.com/uploads/2021/08/goaccess.png" alt="Demonstrating the filter" />
<figcaption>Viusalize CLF logs with GoAccess</figcaption></figure>
There are of course lots of other tools you can use to visualize logs, like our latest <a href="https://www.clever.cloud/developers/addons/elastic/">Elastic add-on</a> for instance :) Or you can go straight into the metrics tab of your application or add-on and start playing with Warp10. This is actually what we use when you see the live map under the Overview tab of your application.

We hope you'll find this new feature practical and as always welcome your input to make this better. Happy coding!]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/access-logs-clever-tools-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="access logs clever tools 1" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/08/access-logs-clever-tools-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/access-logs-clever-tools-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/access-logs-clever-tools-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/access-logs-clever-tools-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/access-logs-clever-tools-1-1368x528.png 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p>Yes you read it right, you can now access your access logs. How you ask? With the latest release of Clever Tools. But before we see how it works, let me explain what access logs are.

<span id="more-2973"></span>

Access logs contain all incoming requests to a web server. They are available in different formats. One of the most common being CLF which stands for <a href="https://en.wikipedia.org/wiki/Common_Log_Format">Common Log Format</a>. Here's an example where you can find the IP of the client, date, HTTP verb, URL target, status code and size of the answer: <code>255.255.255.255 - - [06/Feb/2020:07:59:22 +0100] "GET /aget/to/your/beautiful/website -" 200 1453</code>
<h2 id="how-to-get-your-access-logs">How to get your access logs</h2>
To get your access logs you need to use <a href="https://github.com/CleverCloud/clever-tools/">clever-tools</a> and run this in a linked application:

<code>clever accesslogs</code>

You will get all the requests that came to this app in the last hour. This also work for most dedicated add-ons using <code>--addon</code> followed by the add-on id:

<code>clever accesslogs --addon addon_41c5a60f-11c6-442a-9803-f4604fe8638b</code>

You can also choose a date span using <code>--after</code> and <code>--before</code> like so:

<code>clever accesslogs --after 2020-03-27 --before 2020-03-29</code>

Any date you give must follow ISO 8601. You could for instance have a microsecond precision like this:

<code>clever accesslogs --after 2020-03-29T11:01:02.120000Z --before 2020-03-29T11:01:02.123456Z</code>

You can also change the format of the logs with <code>-F</code> (or <code>--format</code>):

<code>clever accesslogs --after 2020-03-28 --before 2020-03-29 -F json</code>

Here's an example of JSON entry, it contains all of the information currently available for each request:
<pre><code class="language-json">{
  "t": "2020-03-10T11:24:34.220324Z",
  "a": "app_87d748d4-3c7b-4baa-8f52-c748e1123ab3",
  "adc": "par-cleverapps-adc-n6",
  "o": "user_51f7098f-604e-4d9e-8fb6-4026fd1767bb",
  "i": "0805330e-cff6-4fd5-87c0-26974d8bcb4e",
  "ipS": "255.255.255.255",
  "pS": 38566,
  "s": {
    "lt": 48.6719,
    "lg": 1.3002,
    "ct": "Aunay-sous-Crecy",
    "co": "FR"
  },
  "ipD": "255.258.258.258",
  "pD": 11810,
  "d": {
    "lt": 48.7967,
    "lg": 2.3338,
    "ct": "Cachan",
    "co": "FR"
  },
  "vb": "GET",
  "path": "/status-codes/500",
  "bIn": 411,
  "bOut": 443,
  "h": "app-87d748d4-3c7b-4baa-8f52-c748e1123ab3.cleverapps.io",
  "rTime": "3ms",
  "sTime": "115μs",
  "scheme": "HTTPS",
  "sC": 500,
  "sT": "Internal Server Error",
  "w": "WRK-01",
  "r": "b6bcab8a-c6d0-4546-9000-57b43d009a49",
  "tlsV": "TLS1.3"
}
</code></pre>
You will find the details for every field in our <a href="https://www.clever.cloud/developers/administrate/metrics/overview/#access-logs-metrics">access logs documentation</a>.
<h2 id="what-you-can-do-with-your-logs">What you can do with your logs</h2>
Now let's say you want to know what are the most returned status codes from a log file, here's how you can do it:
<pre><code class="language-bash">clever accesslogs --after 2020-03-10 --before 2020-03-20 -F json | jq .sC | sort | uniq -c | sort -nr
</code></pre>
Here we use the JSON format and <code>jq</code> to select the field we want, then <code>sort</code> and <code>uniq</code> to get a proper output, which would yield something like:
<pre><code class="language-text">  99999 200
     56 500
     33 404
      2 400
      1 403
      1 301
      1 202
</code></pre>
The first column being the number of hits and the second being the status code.

Now for something a bit more practical, here's a script that allows you to split access logs for each day between two dates:
<pre><code class="language-bash">#!/bin/bash

input_start=2020-01-01
input_end=2020-03-27

startdate=$(date -I -d "$input_start") || exit -1
enddate=$(date -I -d "$input_end")     || exit -1

d="$startdate"
while [ "$d" != "$enddate" ]; do 
  clever accesslogs --alias prod --after $d --before $(date -I -d "$bv d + 1 day") -F clf &gt; access-$d.out
  d=$(date -I -d "$d + 1 day")
done
</code></pre>
It's hard to visualize so much data if you don't have the proper tools. So I really invite you to try <a href="https://goaccess.io/">GoAccess</a>. Combine the script above and this command <code>goaccess access* -o report.html --log-format=COMMON --anonymize-ip</code>. You will get this neat, anonymized HTML report:
<figure><img src="https://cdn.clever-cloud.com/uploads/2021/08/goaccess.png" alt="Demonstrating the filter" />
<figcaption>Viusalize CLF logs with GoAccess</figcaption></figure>
There are of course lots of other tools you can use to visualize logs, like our latest <a href="https://www.clever.cloud/developers/addons/elastic/">Elastic add-on</a> for instance :) Or you can go straight into the metrics tab of your application or add-on and start playing with Warp10. This is actually what we use when you see the live map under the Overview tab of your application.

We hope you'll find this new feature practical and as always welcome your input to make this better. Happy coding!]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Introducing Traffic Overview in Real-Time</title>
		<link>https://www.clever.cloud/blog/engineering/2019/12/19/access-logs-and-requests-geolocation/</link>
		
		<dc:creator><![CDATA[Clément Nivolle]]></dc:creator>
		<pubDate>Thu, 19 Dec 2019 17:32:00 +0000</pubDate>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[geololocation]]></category>
		<category><![CDATA[logs]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2019/12/19/access-logs-and-requests-geolocation/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/newtiles-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="newtiles 1" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/08/newtiles-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/newtiles-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/newtiles-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/newtiles-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/newtiles-1-1368x528.png 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p><p>Time for some exciting new features! We&#39;ve been working for a while now on giving more insights to your application&#39;s activity. Is your application used? Where? Which IPs are accessing it? Even the response time is here! In this post, I am presenting to you what&#39;s new and how to use it at best.</p>
<span id="more-2823"></span>

<h2 id="console-new-tiles-and-improvements">Console: new tiles and improvements</h2>
<p>We&#39;ve been building new tiles for both organizations and overview pages. These new tiles rely on web components which are open-source. You can embed each of these components easily in your product to show to your customers. You can find each of our components here: <a href="https://www.clever.cloud/developers/clever-components/">https://www.clever.cloud/developers/clever-components/</a>.</p>
<figure>
  <img style=" width: 70%;margin:0 auto;display: block;max-width:100%" alt="Rails no controller error page" src="https://cdn.clever-cloud.com/uploads/2021/08/new-inputs.png">
  <figcaption>Here's an example of our new inputs, with copy-to-clipboard button.</figcaption>
</figure>

<p>Please note that these are in beta, so bear with us as we fix possible hiccups over time!</p>
<p>We are also developing a new type of ACLs, built on top of our next-gen auth product, allowing you to make integrations easier. Stay tuned!</p>
<figure>
  <img style=" width: 100%;margin:0 auto;display: block;max-width:100%" alt="Rails no controller error page" src="https://cdn.clever-cloud.com/uploads/2021/08/new-tiles.png">
  <figcaption>The new "overview".</figcaption>
</figure>

<h3 id="geolocation-of-requests">Geolocation of requests</h3>
<p>This one may be the most obvious change: there is a near-real-time map that shows dots for requests and their location around the world. In the organization&#39;s overview, you can see requests of all your apps combined.</p>
<video width="70%" autoplay loop style="margin:0 auto;display: block;">
  <source src="//assets.clever-cloud.com/website/blog/new-map-live.mp4" type="video/mp4" />
  <source src="//assets.clever-cloud.com/website/blog/new-map-live.ogv" type="video/ogv" />
</video>

<p>There is also a heatmap that shows the density of the traffic location over 24 hours. Real-time is nice, but having a track of what&#39;s happened can be pretty handy.</p>
<figure>
  <img style=" width: 70%;margin:0 auto;display: block;max-width:100%" alt="Rails no controller error page" src="https://cdn.clever-cloud.com/uploads/2021/08/new-heatmap.png">
  <figcaption>The heatmap view</figcaption>
</figure>

<h3 id="http-response-codes">HTTP Response codes</h3>
<p>Here we show you the distribution of HTTP status codes in the responses of your apps. It is displayed over 24h. If you click on a status code in the legend, it will hide it from the chart. Pro tip: If your shift+click on a HTTP code in the legend, it will unselect all the other codes.</p>
<figure>
  <img style=" width: 30%;margin:0 auto;display: block;max-width:100%" alt="Rails no controller error page" src="https://cdn.clever-cloud.com/uploads/2021/08/http-response-code.png">
</figure>

<h3 id="http-requests">HTTP Requests</h3>
<p>This graph represents the variation of HTTP requests on your app over 24h, with a time window of a 2, 3 or 4 hours for each graph, (depending on your windows size, responsive ftw).</p>
<figure>
  <img style=" width: 30%;margin:0 auto;display: block;max-width:100%" alt="Rails no controller error page" src="https://cdn.clever-cloud.com/uploads/2021/08/http-requests.png">
</figure>

<h2 id="access-logs--tools">Access logs &amp; tools</h2>
<h3 id="what-is-an-access-log">What is an access log?</h3>
<p>An access log records all requests that people or bots have requested from an application. When you are using Clever Cloud, your application&#39;s requests transit via our load-balancers. They receive the incoming network traffic and route it to each application. For legal reasons, we have to keep track of each request for at least a year.</p>
<h3 id="retrieving-access-logs-before">Retrieving access logs, before</h3>
<p>When a customer needed the access logs, the original process was to dive into a vast logfile and find it ourselves. But now, each Clever Cloud user can retrieve its access logs, and much more.</p>
<h2 id="retrieving-access-logs-today">Retrieving access logs, today</h2>
<p>We introduced Metrics a few years ago, a tool built into the web console to give monitoring data to our users. <em>Metrics</em> relies on Warp10, a time-series database built for this kind of usage. The access logs are now stored into Warp10, as it&#39;s a part of Metrics.</p>
<p>On the Metrics page, you&#39;ll find your metrics token and URL, allowing you to request the warp10 database with Quantum (it&#39;s a (WarpScript™ IDE).</p>
<p>You can open Quantum within Metrics, and click on &quot;access logs&quot; located in the &quot;Explore your data&quot; section. Here&#39;s an example:</p>
<pre><code class="language-text">[
  &#39;&lt;TOKEN&gt;&#39;
  &#39;accessLogs&#39;
  { &#39;app_id&#39; &#39;&lt;APP_ID&gt;&#39; }
  NOW 5 s
] FETCH
</code></pre>
<p>As access logs are still quite complex to retrieve that way, we are still working on a better way to make it accessible to you. Stay tuned for the next iterations!</p>
]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/newtiles-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="newtiles 1" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/08/newtiles-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/newtiles-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/newtiles-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/newtiles-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/newtiles-1-1368x528.png 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p><p>Time for some exciting new features! We&#39;ve been working for a while now on giving more insights to your application&#39;s activity. Is your application used? Where? Which IPs are accessing it? Even the response time is here! In this post, I am presenting to you what&#39;s new and how to use it at best.</p>
<span id="more-2823"></span>

<h2 id="console-new-tiles-and-improvements">Console: new tiles and improvements</h2>
<p>We&#39;ve been building new tiles for both organizations and overview pages. These new tiles rely on web components which are open-source. You can embed each of these components easily in your product to show to your customers. You can find each of our components here: <a href="https://www.clever.cloud/developers/clever-components/">https://www.clever.cloud/developers/clever-components/</a>.</p>
<figure>
  <img style=" width: 70%;margin:0 auto;display: block;max-width:100%" alt="Rails no controller error page" src="https://cdn.clever-cloud.com/uploads/2021/08/new-inputs.png">
  <figcaption>Here's an example of our new inputs, with copy-to-clipboard button.</figcaption>
</figure>

<p>Please note that these are in beta, so bear with us as we fix possible hiccups over time!</p>
<p>We are also developing a new type of ACLs, built on top of our next-gen auth product, allowing you to make integrations easier. Stay tuned!</p>
<figure>
  <img style=" width: 100%;margin:0 auto;display: block;max-width:100%" alt="Rails no controller error page" src="https://cdn.clever-cloud.com/uploads/2021/08/new-tiles.png">
  <figcaption>The new "overview".</figcaption>
</figure>

<h3 id="geolocation-of-requests">Geolocation of requests</h3>
<p>This one may be the most obvious change: there is a near-real-time map that shows dots for requests and their location around the world. In the organization&#39;s overview, you can see requests of all your apps combined.</p>
<video width="70%" autoplay loop style="margin:0 auto;display: block;">
  <source src="//assets.clever-cloud.com/website/blog/new-map-live.mp4" type="video/mp4" />
  <source src="//assets.clever-cloud.com/website/blog/new-map-live.ogv" type="video/ogv" />
</video>

<p>There is also a heatmap that shows the density of the traffic location over 24 hours. Real-time is nice, but having a track of what&#39;s happened can be pretty handy.</p>
<figure>
  <img style=" width: 70%;margin:0 auto;display: block;max-width:100%" alt="Rails no controller error page" src="https://cdn.clever-cloud.com/uploads/2021/08/new-heatmap.png">
  <figcaption>The heatmap view</figcaption>
</figure>

<h3 id="http-response-codes">HTTP Response codes</h3>
<p>Here we show you the distribution of HTTP status codes in the responses of your apps. It is displayed over 24h. If you click on a status code in the legend, it will hide it from the chart. Pro tip: If your shift+click on a HTTP code in the legend, it will unselect all the other codes.</p>
<figure>
  <img style=" width: 30%;margin:0 auto;display: block;max-width:100%" alt="Rails no controller error page" src="https://cdn.clever-cloud.com/uploads/2021/08/http-response-code.png">
</figure>

<h3 id="http-requests">HTTP Requests</h3>
<p>This graph represents the variation of HTTP requests on your app over 24h, with a time window of a 2, 3 or 4 hours for each graph, (depending on your windows size, responsive ftw).</p>
<figure>
  <img style=" width: 30%;margin:0 auto;display: block;max-width:100%" alt="Rails no controller error page" src="https://cdn.clever-cloud.com/uploads/2021/08/http-requests.png">
</figure>

<h2 id="access-logs--tools">Access logs &amp; tools</h2>
<h3 id="what-is-an-access-log">What is an access log?</h3>
<p>An access log records all requests that people or bots have requested from an application. When you are using Clever Cloud, your application&#39;s requests transit via our load-balancers. They receive the incoming network traffic and route it to each application. For legal reasons, we have to keep track of each request for at least a year.</p>
<h3 id="retrieving-access-logs-before">Retrieving access logs, before</h3>
<p>When a customer needed the access logs, the original process was to dive into a vast logfile and find it ourselves. But now, each Clever Cloud user can retrieve its access logs, and much more.</p>
<h2 id="retrieving-access-logs-today">Retrieving access logs, today</h2>
<p>We introduced Metrics a few years ago, a tool built into the web console to give monitoring data to our users. <em>Metrics</em> relies on Warp10, a time-series database built for this kind of usage. The access logs are now stored into Warp10, as it&#39;s a part of Metrics.</p>
<p>On the Metrics page, you&#39;ll find your metrics token and URL, allowing you to request the warp10 database with Quantum (it&#39;s a (WarpScript™ IDE).</p>
<p>You can open Quantum within Metrics, and click on &quot;access logs&quot; located in the &quot;Explore your data&quot; section. Here&#39;s an example:</p>
<pre><code class="language-text">[
  &#39;&lt;TOKEN&gt;&#39;
  &#39;accessLogs&#39;
  { &#39;app_id&#39; &#39;&lt;APP_ID&gt;&#39; }
  NOW 5 s
] FETCH
</code></pre>
<p>As access logs are still quite complex to retrieve that way, we are still working on a better way to make it accessible to you. Stay tuned for the next iterations!</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
