{"id":26189,"date":"2021-12-25T04:44:21","date_gmt":"2021-12-25T04:44:21","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=26189"},"modified":"2024-05-29T03:10:51","modified_gmt":"2024-05-29T03:10:51","slug":"grafana-setup-a-sample-application-grafana-news","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/grafana-setup-a-sample-application-grafana-news\/","title":{"rendered":"Grafana &#8211; Setup a Sample Application &#8220;Grafana News&#8221;"},"content":{"rendered":"\n<p>This tutorial uses a sample application to demonstrate some of the features in Grafana. To complete the exercises in this tutorial, you need to download the files to your local machine.<\/p>\n\n\n\n<p>In this step, you\u2019ll set up the sample application, as well as supporting services, such as Prometheus and Loki.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Clone the github.com\/grafana\/tutorial-environment repository.<\/strong><\/li><\/ol>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">git <span class=\"hljs-keyword\">clone<\/span> https:<span class=\"hljs-comment\">\/\/github.com\/grafana\/tutorial-environment.git<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>2. Change to the directory where you cloned this repository:<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">cd tutorial-environment<\/code><\/span><\/pre>\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>3<strong>. Make sure Docker is running:<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">docker ps<\/code><\/span><\/pre>\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>4. No errors means it is running. If you get an error, then start Docker and then run the command again.<\/strong><\/p>\n\n\n\n<p>Start the sample application:<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">docker-compose up -d<\/code><\/span><\/pre>\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>The first time you run docker-compose up -d, Docker downloads all the necessary resources for the tutorial. This might take a few minutes, depending on your internet connection.<\/strong><\/p>\n\n\n\n<p><strong>Ensure all services are up-and-running:<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">docker-compose ps<\/code><\/span><\/pre>\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>In the State column, it should say Up for all services.<\/p>\n\n\n\n<p>Browse to the sample application on localhost:8081.<\/p>\n\n\n\n<p><strong>About Grafana News Application<\/strong><\/p>\n\n\n\n<p>The sample application, Grafana News, lets you post links and vote for the ones you like.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>To add a link:<\/li><li>In Title, enter Example.<\/li><li>In URL, enter https:\/\/example.com.<\/li><li>Click Submit to add the link.<\/li><\/ul>\n\n\n\n<p>The link appears in the list under the Grafana News heading.<\/p>\n\n\n\n<p>To vote for a link, click the triangle icon next to the name of the link.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Reference<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>https:\/\/grafana.com\/tutorials\/grafana-fundamentals\/<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial uses a sample application to demonstrate some of the features in Grafana. To complete the exercises in this tutorial, you need to download the files to your local&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5012],"tags":[],"class_list":["post-26189","post","type-post","status-publish","format-standard","hentry","category-grafana"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/26189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=26189"}],"version-history":[{"count":6,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/26189\/revisions"}],"predecessor-version":[{"id":26197,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/26189\/revisions\/26197"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=26189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=26189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=26189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}