diff --git a/README.md b/README.md index f43ca35ea..71137ed77 100644 --- a/README.md +++ b/README.md @@ -1,87 +1,30 @@ -If you want to apply as a support engineer at [Datadog](http://datadog.com) you are in the right spot. Read on, it's fun, I promise. - +If you want to apply as an engineer at [Datadog](http://datadog.com) you are in the right spot. _DSC4652 -# The Challenge - -Don't forget to read the **References**. - -## Questions - -### Level 1 - -* Sign up for Datadog, get the agent reporting metrics from your local machine. -* Bonus question: what is the agent? -* Submit an event via the API. -* Get an event to appear in your email inbox (the email address you signed up for the account with) - -### Level 2 - -* Take a simple web app ([in any of our supported languages](http://docs.datadoghq.com/libraries/)) that you've already built and instrument your code with dogstatsd. This will create **metrics**. -* While running a load test (see References) for a few minutes, visualize page views per second. Send us the link to this graph! -* Create a histogram to see the latency; also give us the link to the graph -* Bonus points for putting together more creative dashboards. - -### Level 3 - -Using the same web app from level 2: -* tag your metrics with `support` (one tag for all metrics) -* tag your metrics per page (e.g. metrics generated on `/` can be tagged with `page:home`, `/page1` with `page:page1`) -* visualize the latency by page on a graph (using stacked areas, with one color per `page`) - -### Level 4 - -Same web app: -* count the overall number of page views using dogstatsd counters. -* count the number of page views, split by page (hint: use tags) -* visualize the results on a graph -* Bonus question: do you know why the graphs are very spiky? - -### Level 5 - -Let's switch to the agent. - -* Write an agent check that samples a random value. Call this new metric: `test.support.random` - -Here is a snippet that prints a random value in python: - -```python -import random -print(random.random()) -``` - -## Instructions -If you have a question, create an issue in this repository. - -To submit your answers: +# Why work at Datadog? -1. Fork this repo. -2. Answer the questions in `answers.md` -3. Commit your code for question #4. -4. Submit a pull request. -5. Don't forget to include links to your dashboard(s) +We tackle some of the hardest technical problems while delivering a product that "just works" for our customers. And we are backed by some of the best VCs in NYC and the world. -## References +Do you want to make a difference? Are you exceptional at your job, and intrinsically motivated by it? Do you eat hard problems for breakfast and find them beautifully simple solutions by lunchtime? Do you ever wish you were there in the early days of these startups everyone is talking about? -### How to get started with Datadog +If so, we want to hear from you. -* [Datadog overview](http://docs.datadoghq.com/overview/) -* [Guide to graphing in Datadog](http://docs.datadoghq.com/graphing/) +[source](http://jobs.datadoghq.com/) -### The Datadog API and clients +# The Positions -* [API docs](http://docs.datadoghq.com/api) -* [Guide to the Agent](http://docs.datadoghq.com/guides/basic_agent_usage/) -* [Libraries](http://docs.datadoghq.com/libraries/) -* [Guide to Metrics](http://docs.datadoghq.com/guides/metrics/) +1. Support Engineer: check out the `support-engineer` [branch](https://github.com/DataDog/hiring-engineers/tree/support-engineer) of this repository. +2. Solutions Engineer: check out the `solutions-engineer` [branch](https://github.com/DataDog/hiring-engineers/tree/solutions-engineer) of this repository. +3. Devops Evangelist: check out the `devops-evangelist` [branch](https://github.com/DataDog/hiring-engineers/tree/devops-evangelist) of this repository. -### Extending the Agent -* [Writing an agent check](http://docs.datadoghq.com/guides/agent_checks/) +# How do I submit my results? -### Tools you may need +1. Fork this repository. +2. Check out the branch that interests you. +3. Commit your work. +4. Submit a pull request against this upstream repository. -Load testing -* [ab](https://httpd.apache.org/docs/2.2/programs/ab.html) -* [tsung](http://tsung.erlang-projects.org/user_manual.html#htoc2) +# Questions? +File an issue in this repository. diff --git a/answers.md b/answers.md index 092b6d280..cd49609d2 100644 --- a/answers.md +++ b/answers.md @@ -1 +1,309 @@ -Your answers to the questions go here. + +

DATADOG TEST

+

by Morsalin Billah

+









+ + +# Level 0 (optional) - Setup an Ubuntu VM + +I followed the instructions in the link ([Here are instructions for +setting up a Vagrant Ubuntu 12.04 +VM](https://www.vagrantup.com/docs/getting-started/)) and setup an +Ubuntu VM. + +1. Download Virtual Box from the official link below: + + +2. Download the correct Virtual Box host for your Operating Systems + + + +3. Install Virtual Box using following your Operating System standard +procedure. + +4. Download and install Vagrant from the link below: + + +5. I find it difficult to find the username and password to Ubuntu system installed in Virtual Box. I searched online and found the +username and password to be ‘vagrant’. + + + +6. I have followed the step-by-step instruction provided ‘Getting Started Page’. It is very helpful and described each steps elaborately. + +7. Vagrant Networking: I have entered the URL and I can see a web page +that is being served from the virtual machine that was automatically setup by Vagrant. + + + +8. While executing vagrant share I have encountered the following error: + + + +9. I install ‘ngrok’ from and execute the +command in terminal. + + + +10. I copy over ‘ngrok’ to my test project folder +‘vagrant\_getting\_started’ and run `./ngrok help` command. + +11. I could not run vagrant share as it was giving me the following error: + + + +12. I read Internet articles from different source and found that I just realized I didn't need to use vagrant share I can run ngrok and share +any port with no problem. So I use the command `./ngrok http 4567` + + + +13. I used the URL to view the page. + + + + +# Level 1 - Collecting your Data + +## Installing Agent: + +1. At first I went to Datadog home page and signed up myself with company name as ‘Datadog Recruiting Candidate’. + +2. Then I downloaded the agent by following the instruction on the screen. + + + +3. Then I downloaded agent, copied the following code snippet and pasted it to MacOSX terminal. +`DD\_API\_KEY=0668e689f28ba3418c76ee8f62e7f5f9 bash -c "$(curl -L +https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/osx/install.sh)"` +While installing the agent in terminal I encountered the following +error: + + + +4. As a workaround, I manually downloaded the ‘datadogagent.dmg’ and +installed it. + +5. I have executed ‘vi /opt/datadog-agent/etc/datadog.conf’ command to +read the ‘datadog.conf’ file and my API Key was already installed. + + + +6. After that I clicked finish button and received a welcome email from +Datadog that has my username and login URL. + +7. Then I started the datadog agent and it was working fine without +error. + + + +## What is an Agent? + +An agent is a software installed in user’s computer that collects and +delivers the metrics and events from the computer to Datadog server. +User can see more information of the agent installed in computer by +executing the command + +`$ datadog-agent info`. + + + + +## Add tags in the Agent config file + +1. I have searched Datadog Docs and found a help document ‘Guide to +Tagging’. + + + +2. I have used ‘Configuration File’. I have tried to add ‘HTTP\_Check’ +and successfully get the information in ‘datadog-agent info’ + + + +3. I have downloaded and installed ‘MongoDB’. I have followed the +instruction from the following site: + + +4. I installed Homebrew using the following command: +`/usr/bin/ruby -e "$(curl -fsSL +https://raw.githubusercontent.com/Homebrew/install/master/install)"` + +5. Then installed MongoDB by the instructions of the following page: + + + + +6. I have found the following Youtube video handy to create data/db +directory for MongoDB: + + +7. Then I have created the following user (datadogMorsalin) in MongoDB +according to the manual installation process: +`db.createUser({"user":"datadogMorsalin", "pwd": +"YG0Z80l4bHizR3ayEoLplg0Y", "roles" : \[ {role: 'read', db: 'admin' }, +{role: 'clusterMonitor', db: 'admin'}, {role: 'read', db: 'local' }\]})` + +8. After creating the user successfully into MongoDB, I modified the +‘mongo.yaml’ file in conf.d directory: +`init\_config:` +`instances:` +`- server:` +`mongodb://datadogMorsalin:YG0Z80l4bHizR3ayEoLplg0Y@localhost:27016` +`tags:` +`- mytag1` +`- mytag2` +`- server:` +`mongodb://datadogMorsalin:YG0Z80l4bHizR3ayEoLplg0Y@localhost:27017` +`tags:` +`- mytag1` +`- mytag2` + +9. Further following the instructions, I went into the Integrations tab +on Datadog-web app and installed MongoDB begin configuration for the +same. This is where I changed the User and followed the steps to +configure the MongoDB integration with Datadog-agent. + + + + + +10. I went to Infrastructure Host Map Click on mongodb. This is where I +found the tags which I have added using the Configuration File. + + + +11. Once I got it working and installed properly I ran ‘Datadog-agent +info’ in terminal to verify Mongo was up and running. However, instance +\#0 was not running properly due to the local host either being +incorrect or due to me not having permission rights to access the local +host of 27016 (found a couple of references on Datadog—GitHub stating +that one instance running would be sufficient for the time being.) + + + + +## Write a custom Agent check that samples a random value + +1. First of all I searched Datadog site to found instruction on ‘How to +a Custom Agent Check’ and I found it under the guides. + + +2. In ‘Writing an Agent Check’ page I found the section ‘Your First +Check’ + + + +3. I have used `Finder` of Mac OS X to navigate to `conf.d` and `checks.d` directories. + + + +4. Then I have created `test.support.random.py` and +`test.support.random.yaml` files in `/opt/datadog-agent/agent/checks.d/` +and `/opt/datadog-agent/etc/conf.d/` respectively using text editor +application (Sublime Text). + +5. I have added an `import random` line as the first line and modified the code snippet in `test.support.random.py` file. I have changed the +class `HelloCheck` to `TestCheck` and edited `hello.world` to `test.support.random`. + + + +6. I have copied over the code for `test.support.random.yaml` file and +left it untouched. + + + +7. I ran `datadog-agent info` in terminal and can see the `test.support.random` check has been integrated successfully. + + + +8. Now I can see the custom agent check in my Host Map: + + + +# Level 2 - Visualizing Data + +## Database Dashboard: + +1. To visualize data, I went to ‘Dashboards’ menu and selected ‘Dashboard List’. Found the ‘Integration Dashboards’ list and selected the proper integration dashboard (MongoDB here) shown below. + + + +2. Then I have selected MongoDB dashboard and opened it. On the top-right corner of the screen there is a setting icon where I found ‘Clone Dashboard’ option. + + + +3. After cloning the dashboard I went to Dashboard List again and can see ‘MongoDB(cloned)’ dashboard in the list on the left hand side of the screen. After that, I opened the ‘MongoDB(cloned)’ dashboard and add custom metric `test.support.random` to the dashboard. + + + +**Link to the Dashboard:** + + +## Difference between Timeboard and Screenboard? + +**Timeboard:** For a timeboard, all the graphs are scoped within the same time and appear in a grid-like fashion. A timeboard has utility for +correlation of data and troubleshooting. + +**Screenboard:** Screenboard is for getting a high level look into the functioning of the system. It is much more flexible and customizable. The widgets may have different time frames. + + + +## Snapshot of `test.support.random` graph: + + + +After that, I have cloned this Custom Metrics – test dashboard and turned on the notification. I have then taken snapshot and could not manage to send that snapshot to my email address. Then I used the annotation process to send the snapshot to my other email address: + +Link: + +The email I received: + + + +# Level 3 - Alerting on your Data + +1. I went to ‘Monitors’ drop down menu and selected ‘New Monitor’. After that I selected the option ‘Metric’ and continued to define the metric +‘test.support.random’ according to the requirements of test. + +2. I set the alert threshold at 0.9 and warning threshold at 0.8. I also selected Multi Alerts via hosts. + + + +3. Then I named monitor ‘Threshold Monitor, wrote a message body and added recipients to notify. + + + +4. Then I created email notifications by selecting my own name/email in the ‘Notify your team’ section. + + + +5. After a while I received the following warning emails followed by recovered emails from monitor I have created. + +**Warning Email (1):** + + + +**Recovered Email (1):** + + + +**Warning Email (2):** + + + +**Recovered Email (2):** + + + +**Recent Activity under Threshold Monitor:** + + + +6. Setting up Downtime: I went to Monitors then selected ‘Manage Downtime’. On Manage Downtime page I clicked ‘Schedule Downtime’ button located on top-right corner of the screen. After clicking on the button a pop up window opened to setup schedule downtime. I setup schedule downtime and received an error message saying ‘Schedule downtime start +cannot be in the past’ + +7. Then I changed the date to start from tomorrow and it allowed me to save the Schedule Downtime. + +Email from Monitor: + +