<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prachi Jain on Medium]]></title>
        <description><![CDATA[Stories by Prachi Jain on Medium]]></description>
        <link>https://medium.com/@prachi1997jain?source=rss-788483d68200------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*R-znaGkeNJ8SZNpM.jpg</url>
            <title>Stories by Prachi Jain on Medium</title>
            <link>https://medium.com/@prachi1997jain?source=rss-788483d68200------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 05:52:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prachi1997jain/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[An Introduction to CircleCI]]></title>
            <link>https://medium.com/xebia-engineering/an-introduction-to-circleci-aa9464a86673?source=rss-788483d68200------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa9464a86673</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[circleci]]></category>
            <dc:creator><![CDATA[Prachi Jain]]></dc:creator>
            <pubDate>Wed, 13 May 2020 09:23:02 GMT</pubDate>
            <atom:updated>2020-05-13T09:23:02.161Z</atom:updated>
            <content:encoded><![CDATA[<p>Continuous integration is a practice that encourages developers to integrate their code into a master branch of a shared repository. Instead of building out features in isolation and integrating them at the end of a development cycle, code is integrated with the shared repository by each developer multiple times.</p><p>CircleCI is the continuous integration &amp; delivery platform that helps the development teams to release code rapidly and automate the build, test, and deploy. CircleCI can be configured to run very complex pipelines efficiently with caching, docker layer caching, resource classes and many more. After repositories on GitHub or Bitbucket are authorized and added as a project to circleci.com, every code triggers CircleCI runs jobs. CircleCI also sends an email notification of success or failure after the tests complete.</p><p><strong>How to configure a job in CircleCI</strong></p><p>Step 1: CREATE A SAMPLE PROJECT IN GITHUB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/0*HUY57yneSMZZw9C-" /></figure><p>Step 2: LOGIN USING GITHUB/BITBUCKET</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/0*OKzMyQXLNl3lUzGf" /></figure><p>Step 3: SET UP PROJECT ON CIRCLECI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/0*rIt-tm-fBH43G3IO" /></figure><p>Step 4: IN GITHUB .CIRCLECI/CONFIG.YML FILE SHOULD BE MADE WHICH WILL RUN THE WORKFLOW</p><p>CircleCI finds and runs config.yml and interacts with the code to build to orchestrate your build, tests, security scans, approval steps, and deployment. CircleCI believes in the configuration as code hence it is orchestrated through a single file.</p><pre>version: 2.1<br>jobs:<br>  build:<br>    docker: <br>      - image: circleci/node:4.8.2 # the primary container, where your job&#39;s commands are run<br>    steps:<br>      - checkout # check out the code in the project directory<br>      - run: echo &quot;hello world&quot; # run the `echo` command<br>workflows:<br>  version: 2<br>  build:<br>    jobs:<br>      - welcome/run <br>      - build</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/0*sHjHd1pnGtUCLUTi" /></figure><p>CircleCI’s build servers have already pre-installed languages and build tools such as Java, Gradle, Maven that you need for standard development. With a custom config.yml, one can prepare an environment for your application code dependency.</p><p>Primary process that is used in CircleCI to build the code</p><ol><li>executor: adjusting the VM to the preferences and requirements it can be machine, docker or and many more related to the OS</li><li>checkout: git repo checking out and cloning feature</li><li>dependencies: setting up your project’s language-specific dependencies</li><li>code: preparing the code for your tests</li><li>test: running your tests</li><li>deployment: deploying your code to your web servers</li></ol><p><strong>Play with CircleCI</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/159/0*1xgQmWGLygxnc6kC" /></figure><p>CircleCi provides us with various options to make a complex pipeline work smoothly. For instance, circleci provides the option FOR ENVIRONMENT VARIABLES under BUILD SETTING which can help in ease of the putting secrets data to confi.yml file. Similarly, under PERMISSION, there are multiple options like SSH PERMISSION that helps in the integration key between GitHub and CircleCi to check out the repository code. CHECKOUT SSH KEYS which authenticates the identity to the git. API PERMISSION, AWS PERMISSION and JIRA INTEGRATION are also available for integration with their respective services.</p><p><strong>Resource classes</strong></p><p>Resource classes allow you to configure the CPU and RAM for each task. We have often heard from customers that limiting memory can lead to test failures, slow down the creation process, or maximum use of RAM, which can result in a browser crash. You can use resource classes to select a large container where you need it and a small container where you don’t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*9T9HwMhj2z8hxYMuEU9J9A.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/383ea19152e2ac3b1ee0d1d58c9d5aa4/href">https://medium.com/media/383ea19152e2ac3b1ee0d1d58c9d5aa4/href</a></iframe><p><strong>Workflow</strong></p><p>Used for orchestrating all jobs. Each workflow consists of the workflow name as a key and a map as a value. A name should be unique within the current config.yml. The top-level keys for the Workflows configuration are version and jobs. Workflow helps in customization of job in any order i.e. sequentially, parallel or in any way chosen.</p><p>Workflows basics</p><ol><li>WORKFLOWS is known as a set of rules defining how jobs (such as build, test, deploy) are run, giving teams granular control over the process</li><li>JOBS is termed as a collection of steps and an execution environment to run them in</li><li>STEP is an executable command</li></ol><p>Example 1: Single Build</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c5e055597cd4a0d200d514276ab37e62/href">https://medium.com/media/c5e055597cd4a0d200d514276ab37e62/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lk4CxHAuEZncB2bP" /></figure><p>Example 2: Sequential Flow</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/687eaf496d58a826c237169f24d6bbec/href">https://medium.com/media/687eaf496d58a826c237169f24d6bbec/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ving9MXRPs5ORumO" /></figure><p>Example 3: Independent Builds in the same Workflow</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d88a08b1f49983a4a2f5a420cc8ec54/href">https://medium.com/media/1d88a08b1f49983a4a2f5a420cc8ec54/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tVKUOzkRCSMNt_AC" /></figure><p>Example 4: Hybrid Workflow</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e02707ce049c8d46d6e053b2053b3fcb/href">https://medium.com/media/e02707ce049c8d46d6e053b2053b3fcb/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nQzoDoCI70m8asg8" /></figure><p>We can further filter the job schedule according to the tag or branch that we want to execute i.e. controlling a job when it should run. We can also corn schedule the job or manually approved jobs.</p><p>Example: Job scheduled at midnight UTC only on the master branch of build-package job.</p><pre>workflows:<br> version: 2<br> build-package:<br>   triggers:<br>     — schedule:<br>         cron: “0 0 * * *”<br>         filters:<br>           branches:<br>             only:<br>               — master</pre><p><strong>Conclusion</strong></p><p>The examples above are written to provide a start for the areas of functionalities available through CircleCI config. As it provides easy setup and maintenance. It also provides built-in support for Docker, can be debugged using SSH and automates your software builds, tests, and deployments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa9464a86673" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xebia-engineering/an-introduction-to-circleci-aa9464a86673">An Introduction to CircleCI</a> was originally published in <a href="https://medium.com/xebia-engineering">Xebia Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best practices to create & organize Terraform code for AWS]]></title>
            <link>https://medium.com/xebia-engineering/best-practices-to-create-organize-terraform-code-for-aws-2f4162525a1a?source=rss-788483d68200------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f4162525a1a</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Prachi Jain]]></dc:creator>
            <pubDate>Wed, 27 Nov 2019 08:04:02 GMT</pubDate>
            <atom:updated>2019-11-27T08:04:02.763Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jjzVWstNbgCGX7wW.jpg" /></figure><p>Terraform is a fairly new project (as most of DevOps tools actually) which was started in 2014. Terraform is powerful and one of the most used tool which allows managing infrastructure-as-code. It allows developers to do a lot of things and does not limit them from doing things in ways which will be difficult to support or integrate with. The collaborative infrastructure-as-code workflow is built on multiple IT best practices (like using version control and preventing manual changes), and one must adopt the foundations before we can fully adopt the suggested workflow. Achieving state-of-the-art provisioning practices is a journey, with several distinct stops along the way.</p><p>This describes the supported Terraform practices and how to adopt them.</p><p><strong>Structuring of Terraform configurations</strong></p><p>Main.tf is the main file that has provider and creates all the resources but increases the complexity of readability. Terraform code can be written in a single file but it would be better if we have several files split logically:</p><ul><li>main.tf — call modules, locals and data-sources to create all the resources</li><li>variables.tf — contains information of variables used in main.tf</li><li>outputs.tf — contains outputs from the resources generated in main.tf</li></ul><p>By splitting the files in this format it helps in reusability and sharing of code as well as helps in improving whenever required.</p><p><strong>Modules as Building Blocks</strong></p><p>A module is a container for multiple resources that are used together. A module can call other modules, which lets you include the child module’s resources into the configuration in a concise way. Modules can also be called multiple times, either within the same configuration or in separate configurations, allowing resource configurations to be packaged and re-used.</p><p>Manage terraform resource with shared modules, this will save a lot of coding time. No need re-invent the wheel! It is because of its reusability nature and also helps in reducing duplication, enable isolation, and enhance testability. Module in can be accessed as by referring to the path in the <em>module </em>resource.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/0*t5Tx_3Ktm1w5_Jn7" /></figure><p>Following is a type of skeleton for creating modules in AWS using Terraform:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/0*NrWZyhisZOV68Igt" /></figure><p>Modules<em> </em>folder contains terraform modules inherently related to the project. Modules are powerful because they make code more readable</p><p><strong>S3 as the backend for storing tfstate file</strong></p><p>This state file is extremely important; it maps various resource metadata to actual resource IDs so that Terraform knows what it is managing. This file must be saved and distributed to anyone who might run Terraform.</p><p>Terraform config can be used to provision many boxes on different infrastructure, each of which could have a different state. As it can also be run by multiple people this state should be in a centralized location (like S3) but <em>not</em> git and enable version control on this bucket. Storing in git could expose potentially sensitive data as there’s no encryption. As terraform state file is just a simple text file which would include all the metadata like AWS credentials.</p><pre>Example Configuration:</pre><pre>terraform {<br> backend “s3” {<br> bucket = “mybucket”<br> key = “path/to/my/key”<br> region = “us-east-1”<br> }<br>}</pre><p><strong>Locking of state file</strong></p><p>Terraform provides locking to prevent parallel runs against the same state. Locking helps make sure that only one team member runs the Terraform configuration. Locking helps us prevent conflicts, data loss and state file corruption due to multiple runs on same state file.</p><p>DynamoDB can be used as a locking mechanism to remote storage backend S3 to store state files. If multiple users are working simultaneously then the name of the DynamoDB table is to use for state locking and consistency. The table must have a primary key named LockID. If not present, locking will be disabled.</p><pre>Usage:</pre><pre>resource “aws_dynamodb_table” “terraform_state_lock” {<br> name = “terraform-lock”<br> read_capacity = 5<br> write_capacity = 5<br> hash_key = “LockID”</pre><pre>attribute {<br> name = “LockID”<br> type = “S”<br> }<br>}</pre><pre>terraform {</pre><pre>backend “s3” {</pre><pre>bucket = “terraformbackend”</pre><pre>key = “terraform”</pre><pre>region = “us-east-2”</pre><pre>dynamodb_table = “terraform-lock”</pre><pre>}</pre><pre>}</pre><p><strong>Use variable files</strong></p><p>Variables on Terraform are a great way to pack your configuration with easily readable data. When you declare variables in the root module of your configuration, you can set their values using CLI options and environment variables. When you declare them in child modules, the calling module should pass values in the module block. They can be set in a number of ways:</p><ul><li>In variable.tf file</li><li>Individually, with the -var command-line option.</li><li>In variable definitions (.tfvars) files, either specified on the command line or automatically loaded.</li><li>As environment variables.</li></ul><p><strong>-var-file application in Terraform commands</strong></p><p>With var-file, you can easily manage the environment (dev/stage/uat/prod) variables and avoid running terraform with long list of key-value pairs. Can easily run terraform as below:</p><pre>terraform plan -var-file=terraform.tfvars<br>terraform apply -var-file=terraform.tfvars<br>terraform destroy -var-file=terraform.tfvars</pre><p><strong>Encryption of credentials</strong></p><p>Static credentials can be provided by adding an access_key and secret_key in-line in the AWS provider block:</p><pre>Usage:</pre><pre>provider “aws” {<br> region = “us-west-2”<br> access_key = “my-access-key”<br> secret_key = “my-secret-key”<br>}</pre><p>This method should be avoided as hard-coding credentials into any Terraform configuration is not recommended, and risks secret leakage should this file ever be committed to a public version control system.</p><p>The AWS provider offers a flexible means of providing credentials for authentication. The following methods are supported:</p><ul><li>Environment variables</li></ul><pre>Usage:</pre><pre>$ export AWS_ACCESS_KEY_ID=”accesskey”<br>$ export AWS_SECRET_ACCESS_KEY=”secretkey”<br>$ export AWS_DEFAULT_REGION=”us-west-2&quot;<br>$ terraform plan</pre><ul><li>Shared credentials file</li></ul><pre>Usage:</pre><pre>provider “aws” {<br> region = “us-west-2”<br> shared_credentials_file = “/Users/tf_user/.aws/creds”<br> profile = “customprofile”<br>}</pre><ul><li>EC2 Role</li></ul><pre>Usage:</pre><pre>provider “aws” {<br> assume_role {<br> role_arn = “arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME”<br> session_name = “SESSION_NAME”<br> external_id = “EXTERNAL_ID”<br> }<br>}</pre><p><strong>Consistent structure and naming convention</strong></p><p>Like procedural code, Terraform code should be written for people to read, consistency will help whenever the changes happen. It is possible to move resources in Terraform state file but it may be harder to do if you have inconsistent structure and naming</p><p><strong>Extraction of metadata</strong></p><p><em>Terraform_remote_state</em> is the only data source that retrieves state data from a Terraform backend. This allows you to use the root-level outputs of one or more Terraform configurations as input data for another configuration.</p><p>We have several layers to manage terraform resources, such as network, database, application layers. After you create the basic network resources, such as vpc, security group, subnets, nat gateway in vpc stack. Your database layer and applications layer should always refer the resource from vpc layer directly via <em>terraform_remote_state</em> data source.</p><pre>Usage:</pre><pre>data “terraform_remote_state” “vpc” {<br> backend = “s3”<br> config = {<br> bucket = var.s3_terraform_bucket<br> key = “${var.environment}/vpc.tfstate”<br> region = var.aws_region<br> }<br>}<br> <br># Retrieves the vpc_id and subnet_ids directly from remote backend state files.<br>resource “aws_xx_xxxx” “main” {<br> # …<br> subnet_ids = split(“,”, data.terraform_remote_state.vpc.data_subnets)<br> vpc_id = data.terraform_remote_state.vpc.outputs.vpc_id<br>}</pre><p><strong>File Path instead of Inline Block</strong></p><p>The configuration for some Terraform resources can be defined either as inline blocks or as separate resources. While writing the Terraform code, you should always prefer using a separate resource. As it helps in becoming the code more flexible and configurable. For example, for <em>user-data.sh</em>, we should use the file interpolation function to read this file from disk. The <em>template_file</em> data source is the file interpolation function that renders a template from a template string, which is usually loaded from an external file.</p><pre>data “template_file” “init” {<br> template = “${file(“${path.module}/init.tpl”)}”<br>}</pre><p><em>path.module</em> helps to convert the path that is relative to the module folder and this can be one of the structure :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/0*JD5_EdegQZ1ud3wo" /></figure><p><strong>Tagging Your Amazon Resources</strong></p><p>You can optionally assign your own metadata to each resource in the form of <em>tags</em>. Tags enable you to categorize your AWS resources in different ways, for example, by purpose, owner, or environment. This is useful when you have many resources of the same type — you can quickly identify a specific resource based on the tags you’ve assigned to it.</p><p><strong>Conclusion</strong></p><p>Terraform is a powerful tool to enable you and your teams to define and deploy infrastructure in a controllable and maintainable way. Performing these best exercises can help you to reduce downtime and allow engineers to focus on their primary job — providing business value.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f4162525a1a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xebia-engineering/best-practices-to-create-organize-terraform-code-for-aws-2f4162525a1a">Best practices to create &amp; organize Terraform code for AWS</a> was originally published in <a href="https://medium.com/xebia-engineering">Xebia Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Container and System Monitoring with Docker, Telegraf, Influxdb, and Grafana on AWS]]></title>
            <link>https://medium.com/xebia-engineering/container-and-system-monitoring-with-docker-telegraf-influxdb-and-grafana-on-aws-2007e5511746?source=rss-788483d68200------2</link>
            <guid isPermaLink="false">https://medium.com/p/2007e5511746</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[telegraf]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[influxdb]]></category>
            <dc:creator><![CDATA[Prachi Jain]]></dc:creator>
            <pubDate>Thu, 07 Nov 2019 10:19:43 GMT</pubDate>
            <atom:updated>2019-11-07T10:19:43.576Z</atom:updated>
            <content:encoded><![CDATA[<p>A container monitoring system collects metrics to ensure applications running in containers are functioning correctly. Metrics are tracked and analyzed in real-time to determine if an application is meeting expected goals. Container monitoring solution uses metric capture, analytics, performance tracking and visualization. Container monitoring covers various metrics like memory utilization, CPU usage, CPU limit, memory limit and many more.</p><h3>Technology stack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/0*bvB2qaNKSWGfCt56" /></figure><p>Fig 1: Architecture Diagram for Container and System Monitoring with Docker, Telegraf, Influxdb and Grafana</p><ul><li><strong>Grafana</strong>- Grafana is an open-source metric analytics &amp; visualization suite. It is most commonly used for visualizing time series data for infrastructure and application analytics and is also used in other domains including industrial sensors, home automation, weather, and process control. It can be used on top of a variety of different data stores but is most commonly used together with either Graphite, InfluxDB, Elasticsearch or Prometheus. Visualizations in Grafana are called panels, and users can create a dashboard containing panels for different data sources. Grafana ships with a built-in alerting engine that allows users to attach conditional rules to dashboard panels that result in triggered alerts to a notification endpoint of your choice (e.g. email, slack, mail, custom webhooks).</li><li><strong>Telegraf</strong>-<strong> </strong>Telegraf is the open-source server agent to help you collect metrics with 200+ plugins already written by subject matter experts in the community. With the help of output InfluxDB plugin in Telegraf, we can capture and visualize the metrics on Grafana.</li><li><strong>Docker</strong>- <em>Docker stats</em> command provides an overview of some metrics we need to collect to ensure the basic monitoring function of Docker containers. Docker stats shows the percentage of CPU utilization for each container, the memory used and total memory available to the container. Added to that we can see the total data sent and received over the network by the container.</li><li><strong>InfluxDB</strong>- InfluxDB is a time-series database designed to handle high write and query loads. It is known for its homogeneity and ease of use, along with its ability to perform at scale. It helps to store the metrics. Also Grafana ships with very feature-rich data source plugin for InfluxDB. InfluxDB supports a feature-rich query editor, annotation and templating queries.</li></ul><h3>Setup steps of Monitoring system on AWS</h3><h3>Step 1:</h3><p>Create an empty cluster with ECS optimised instance to run our monitoring system. The instance has a role attached to it with AmazonEC2ContainerServiceforEC2Role policy. We will install the requisite monitoring components on our ECS instance.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ee182306dbddc258e22b67b5b504fd1a/href">https://medium.com/media/ee182306dbddc258e22b67b5b504fd1a/href</a></iframe><p>Elastic IP is attached to the instance launched in cluster so that Public IP remains static for connection with InfluxDB with any number of instances attached.</p><h3>Step 2:</h3><p>We can access the grafana dashboard using http:<em>&lt;elastic_ip&gt;</em>:3000 and Login credentials:</p><p><em>Username: admin</em></p><p><em>Password: admin</em></p><p>Then add the data source as InfluxDB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yRLCTyrH01JJFL3z" /></figure><p>Fig 2: Grafana Login Page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pWfrtIRxlOdfd0C8" /></figure><p>Fig 3: Datasource InfluxDB</p><p>We need to have Telegraf connected with InfluxDB via environment variables i.e. URL and database name with its username and password are set in Telegraf configuration file hence data source verifies all the parameters. This task is achieved by configuring output plugin named <em>&lt;outputs.influxdb&gt;</em> in Telegraf configuration file. Telegraf agent then posts its metrics to the Influx DB. For collecting docker metrics, similarly, <em>&lt;inputs.docker&gt;</em> plugin is configured.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f77a0c8d978cc395533d5bd6d9585e8d/href">https://medium.com/media/f77a0c8d978cc395533d5bd6d9585e8d/href</a></iframe><h3>Step 3:</h3><p>For custom made dashboard JSON definition is imported which visualizes every aspect of the container as well as system.</p><p><strong>Custom Made Dashboard :</strong></p><p>Templated dashboard uses Telegraf as collector and Influxdb as data source. It gives a quick overview of Container and System Monitoring.</p><ul><li>No. of containers</li><li>No. of Images</li><li>No. of the container based on images</li><li>CPU utilization container wise</li><li>Memory container wise</li><li>Disk i/o container wise</li><li>Cpu utilization</li><li>Memory utilization</li></ul><p>….and mostly everything that could be possibly extracted from a server.</p><p>Docker host and Server will give a drop-down menu if multiple instances are monitored and configured with same elastic IP in &lt;output.influxdb&gt; plugin URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cOLoLlKY6krxYJkz" /></figure><p>Fig 4: Overview of Container and System Monitoring</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*unXv7-m86-mwxitH" /></figure><p>Fig 5: Overview of Container and System Monitoring</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Nw1gpEOspysPKCF_" /></figure><p>Fig 6: CPU Usage Monitored in respect of System</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nzYbfK6HyPOLMGGb" /></figure><p>Fig 7: Per Container Monitoring with CPU usage, I/O, Memory Usage and Network</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i-6_gwBwmOZEUKaO" /></figure><p>Fig 8: Per Container Monitoring with CPU usage, I/O, Memory Usage and Network</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UovwZhA3OZuvNOlC" /></figure><p>Fig 9: Per Container Monitoring with CPU usage, I/O, Memory Usage and Network</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5lr443wRjoAR61Rn" /></figure><p>Fig 10: Memory Usage in detail for system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eovuBCXi4fmFxIX0" /></figure><p>Fig 11: Kernel, Swap, Disk space usage, etc graphically represent for system monitoring</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pqREtRGfEHuXVn4k" /></figure><p>Fig 12: Kernel, Swap, Disk space usage, etc graphically represent for system monitoring</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zYWMfeVyrXVK4aLy" /></figure><p>Fig 13: Kernel, Swap, Disk space usage, etc graphically represent for system monitoring</p><h3>Step 4:</h3><p>Any number of ECS optimized application instances can be launched with the same role attached as mentioned above and can be monitored by the existing monitoring solution by simply having Telegraf installed:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d04d7e28f3e5d17ff9bc1a9b6480192/href">https://medium.com/media/6d04d7e28f3e5d17ff9bc1a9b6480192/href</a></iframe><p>The instance can be in the same cluster or different clusters. In all the further instances we won’t require the installation of Grafana or Influxdb as we have customised the Telegraf configuration file to point to the existing instance. Once the service of Telegraf is started, it can attach to the Grafana dashboard and post metrics to Influxdb.</p><p>Note: Telegraf configuration file is stored in S3 bucket and then is being copied to /etc/telegraf/telegraf.conf</p><h3><strong>Conclusion</strong></h3><p>One can easily set up a monitoring tool with different data types and their respective node collector. We have used InfluxDB as a data source which is an open-source tool based on push-based architecture and support integer and string both data type. It only requires one node collector for collecting container and system monitoring hence reduces the complexities. InfluxDB requires Kapacitor for the alert manager but instead of using an additional tool one can simply use Grafana’s alert system. Hence by saving time and memory with reduced complexity, we can easily monitor any container within any number servers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2007e5511746" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xebia-engineering/container-and-system-monitoring-with-docker-telegraf-influxdb-and-grafana-on-aws-2007e5511746">Container and System Monitoring with Docker, Telegraf, Influxdb, and Grafana on AWS</a> was originally published in <a href="https://medium.com/xebia-engineering">Xebia Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>