Skip to content

Commit

Permalink
fix: typos and language revision
Browse files Browse the repository at this point in the history
  • Loading branch information
mehreentahir16 committed Sep 23, 2021
1 parent d5f4a35 commit cc31bc1
Show file tree
Hide file tree
Showing 11 changed files with 290 additions and 250 deletions.
10 changes: 5 additions & 5 deletions src/data/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@
- title: Build a quickstart
url: '/instant-observability/build-a-quickstart'
pages:
- title: Send data to New Relic
url: /instant-observability/build-a-quickstart/send-data-to-newrelic
- title: Create dashboard in New Relic One
url: /instant-observability/build-a-quickstart/create-dashboard
- title: Deploy your application
url: /instant-observability/build-a-quickstart/deploy-your-application
- title: Create a dashboard
url: /instant-observability/build-a-quickstart/create-a-dashboard
- title: Create alerts
url: /instant-observability/build-a-quickstart/create-alerts
- title: Create quickstart
- title: Create a quickstart
url: /instant-observability/build-a-quickstart/create-quickstart
- title: Try our APIs
icon: nr-share
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/images/instant-observability/dashboard2.png
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
path: '/instant-observability/build-a-quickstart/create-a-dashboard'
title: 'Create a dashboard'
template: 'GuideTemplate'
description: 'create a dashboard to observe your data in New Relic'
duration: '15 min'
---

<Callout variant="course" title="Lab">

This procedure is a part of lab that teaches you how to build a quickstart. If you haven't already, checkout the [_Lab introduction_](/instant-observability/build-a-quickstart)

Each procedure in this lab builds on top of the last one, so make sure you [_deploy your application_](/instant-observability/build-a-quickstart/deploy-your-application) before proceeding with this one.

</Callout>

New Relic One dashboards allow you to quickly observe and make meaning of the information that you collect. You can gather and chart the specific data you want to see and customize it the way you want to see.

You're going to create dashboard in New Relic One. Navigate to https://one.newrelic.com/ and sign in with your account. Here, you can see different tabs such as **Browse Data**, **Dashboards**, **Alerts & AI** etc.
Move to **Dashboards** and click **Create a dashboard** in the top right corner.

![create a dashboard](../../../images/instant-observability/create-dashboard.png)

Name your dashboard **FlashDB** and click create.

![name your dashboard](../../../images/instant-observability/name-dashboard.png)

## Add charts to your dashboard

Once the dashboard is in place, you can start creating charts. You're going to add the folloiwng charts:
- Database methods
- Avergae response time
- Errors
- Database size
- Cache hits
- Keys

Hover over the dashboard and click **Add a new chart**.

![add a new chart](../../../images/instant-observability/add-new-chart.png)

New Relic One allow you to add charts using query builder or you can choose to add text, images or links using Markdown. Click **Add a chart**.

![add a chart](../../../images/instant-observability/add-a-chart.png)

It will take you to a query builder option. Edit the query as follow:

>```SQL
>SELECT count(*) FROM fdb_method FACET method
>```
![database methods chart](../../../images/instant-observability/fdb-methods.png)
Here, you group your results of FlashDB methods by attribute values and see the count of each type of transaction. You can choose to present your results in different formats such as table, billboard, pie chart etc.
![chart formats](../../../images/instant-observability/chart-formats.png)
Change the chart type to pie, name your chart and click save.
![pie chart](../../../images/instant-observability/piechart.png)
The chart is now visible on your dashboard.
![piechart dashboard](../../../images/instant-observability/piechart-dashboard.png)
You can add more charts to your dashboard following the same pattern. To do so, click **+** in upper right hand corner.
![add more charts](../../../images/instant-observability/add-more-charts.png)
This will take you to the same _Add to your dashboard_ page, allowing you to add another chart, text, image or links. Add a few more charts to your dashboard as follow:
### Average response time
Run the following query to observe the **average response time** of database transactions.
>```SQL
> SELECT average(fdb_create_responses), average(fdb_read_responses), average(fdb_update_responses), average(fdb_delete_responses) FROM Metric SINCE 30 MINUTES AGO TIMESERIES
>```
![average response time chart](../../../images/instant-observability/average-response-time.png )
>**Note:** Make sure to click **Run** to see above results.
Here, you observe average response time for different transactions for past 30 minutes. Click save to add this chart to your dashboard as well. Follow the same procedure to add the following charts as well.
### Errors
>```SQL
> SELECT sum(fdb_create_errors), sum(fdb_read_errors), sum(fdb_update_errors), sum(fdb_delete_errors) FROM Metric SINCE 60 MINUTES AGO TIMESERIES
>```
Here, you observe errors for all database transactions for past one hour.
![errors chart](../../../images/instant-observability/errors.png )
### Database size
>```SQL
> SELECT sum(mdb_size) FROM Metric
>```
![database size chart](../../../images/instant-observability/database-size.png )
This chart will show you the database size.
### Cache hits
>```SQL
> SELECT sum(fdb_cache_hits) FROM Metric SINCE 30 MINUTES AGO TIMESERIES
>```
![cache hits chart](../../../images/instant-observability/cache-hits.png )
Here, you observe the total number of cache hits for past 30 minutes using line chart.
### Keys
>```SQL
> SELECT count(fdb_keys) FROM Metric SINCE 5 MINUTES AGO TIMESERIES
>```
![keys chart](../../../images/instant-observability/keys.png )
Here, you observe the flashDB key count for past 5 minutes.
You can manipulate the above queries and change time window to focus on the data that you want to observe. Your final dashboard will look similar to the following:
![dashboard with charts](../../../images/instant-observability/dashboard-final.png )
## Summary
Following this procedure, you created a dashboard and added multiple charts to it to observe your services in New Relic One.
<Callout variant="course" title="Lab">
This procedure is a part of lab that teaches you how to build a quickstart. Continue on to next procedure: [_Create alerts_](/instant-observability/build-a-quickstart/create-alerts).
</Callout>
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
---
path: '/instant-observability/build-a-quickstart/create-quickstart'
title: 'Create your quickstart'
title: 'Create a quickstart'
template: 'GuideTemplate'
description: 'Package up your dashboards and alerts and create a quickstart'
duration: '30 min'
---

New Relic One quickstarts allow you to quickly and easily observe and monitor your services since they include observability building blocks like dashboards and alerts.
All of this is available through an open ecosystem where you could contribute your best practices.
<Callout variant="course" title="Lab">

<Callout variant='important'>
This procedure is a part of lab that teaches you how to build quickstart. If you haven't already, checkout the [_lab introduction_](/instant-observability/build-a-quickstart)

This lesson is a part of lab that teaches you to build quickstart. Before proceeding with the lesson, make sure you have a GitHub account and completed the previous lessons to have your dashboards and alerts in place.
As this procedure builds on top of the last ones in the lab, make you create a [dashboard](instant-observability/build-a-quickstart/create-a-dashboard) and [alerts](/instant-observability/build-a-quickstart/create-alerts) before proceeding with this one.

</Callout>

In this lesson, you'll package your dashboards and alerts into a quickstart and contribute your quickstart to New Relic One catalog.
New Relic One quickstarts allow you to quickly and easily observe and monitor your services since they include observability building blocks like dashboards and alerts. You can package your dashboards and alerts into a quickstart and contribute it to New Relic One catalog.

To get started, navigate to GitHub repository of [New Relic One Observability Packs](https://github.com/newrelic/newrelic-observability-packs) and fork it.

![fork github repo](../../../images/instant-observability/fork-github-repo.png)

Now, clone your own repository to your local machine with either using git or GitHub Desktop and open it in the IDE of your choice. Notice the directory structure. __template_ folder is of special importance since it contains the templates for observability building blocks in the quickstart.
Now, clone your own repository to your local machine using `git clone` command and open it in the IDE of your choice.

Notice the directory structure. __template_ folder is of special importance since it contains the templates for observability building blocks in the quickstart.

![template](../../../images/instant-observability/template-directory.png)
![quickstart template](../../../images/instant-observability/template-directory.png)

As you can see in the above image, the _\_template_ directory contains the folders for dashboards, alerts, and instrumentation. Each of these folders contain a template or template directories that you can use to create entities for your quickstart.
The _\_template_ directory contains the folders for dashboards, alerts, and instrumentation. Each of these folders contain a template or template directories that you can use to create entities for your quickstart.

## Add dashboards to quickstart

Copy the _\_template_ directory and it's content to a new directory within the _packs_ folder. You don't need to copy the entire content but only the entities you want to create. Since you're only going to add dashboards and alerts to your quickstart, delete the _instrumentation_ directory. Choose a meaningful name for your recently created directory; which identifies the purpose of your quickstart. For FlashDB, just name it flashdb.
Copy the _\_template_ directory and it's content to a new directory within the _packs_ folder. You don't need to copy the entire content but only the entities you want to create. Since you're only going to add dashboards and alerts to your quickstart, delete the _instrumentation_ directory. Name the directory as **flashdb**.

![flashdb directory](../../../images/instant-observability/flashdb-directory.png)

You're going to add existing dashboard to your quickstart. Copy your dashboard's JSON and save it as a JSON file in the _dashboards_ directory.
You're going to add existing dashboard to your quickstart. Move to your dashboard in New Relic One and copy its JSON. Then save it as a JSON file in the _dashboards_ directory.

![dashboard'\s json](../../../images/instant-observability/json-dashboard.png)

Here, you copied your dashboard's JSON to clipboard. You can simply replace the content of existing JSON file in _dashboards_ directory and rename it as **flashDB.json**. Here's what your _flashDB.json_ file should contain:
Here, you copied your dashboard's JSON to clipboard. Replace the content of existing JSON file in _dashboards_ directory and rename it as **flashDB.json**. Your _flashDB.json_ file should contain the following content:

>```json
> {
Expand Down Expand Up @@ -215,19 +217,19 @@ Next, create a screenshot of your dashboard and add it to _dashboards_ directory
## Add alerts to quickstart
The next step is to add alerts to the quickstart. The _alerts_ directory contain the templates for static, outlier and baseline alerts. You're going to add existing alerts to the quickstart.
Next, you add alerts to the quickstart. You're going to add existing static alerts to the quickstart. The _alerts_ directory contain the templates for static alerts.
To help you populate your .yml alert files, you can use New Relic One's [Graphql API](https://api.newrelic.com/graphiql) to get the json object. Open the Graphql APi and select your account from the drop down.
![graphiql](../../../images/instant-observability/graphiql.png)
![graphiql interface](../../../images/instant-observability/graphiql.png)
Building a query is simple in graphiql. All you need to do is check the appropriate boxes and it will do the rest. Build the query as follow in Graphql.
Building a query is simple in graphiql. Check the appropriate boxes to build the query in Graphql. Your query should be same as follows:
>```json
>{
actor {
account(id: 3248695) {
account(id: {_your account id_}) {
alerts {
nrqlCondition(id: "{_enter nrql conditions's id_}") {
nrqlCondition(id: "{_nrql conditions's id_}") {
... on AlertsNrqlStaticCondition {
id
name
Expand All @@ -249,9 +251,9 @@ Building a query is simple in graphiql. All you need to do is check the appropri
}
>
Running the above query in Graphql will respond with the details of your alert consition which you can use to update your quickstart.
Running the above query in Graphql will respond with the details of your alert condition that you can use to update your quickstart.
![cache hit ratio graphql](../../../images/instant-observability/cache-hit-ratio-graphql.png)
![cache hit ratio in graphql](../../../images/instant-observability/cache-hit-ratio-graphql.png)
For static condition, take the static-alert.yml file and start populating it using the information returned from above query.
First, name the file as **Cache Hit Ratio.yml** and populate it as follow:
Expand Down Expand Up @@ -356,7 +358,9 @@ Create your **Read response.yml** file based on the above response.
## Add quickstart description
Your quickstart is almost ready to go live. But how will other's know and understand what your quickstart is about and what it can do?
To help others understnad the purpose of your quickstart, you need to add quickstart's description. In the root directory of your pack, you can find a _config.yml_ file.
To help others understnad the purpose of your quickstart, you need to add quickstart's description.
In the root directory of your pack, you can find a _config.yml_ file.
Open the file in your IDE and edit it as follow:
>```yml
Expand Down Expand Up @@ -418,13 +422,10 @@ Follow the [conventional commit syntax](https://github.com/newrelic/newrelic-obs
> git commit -m "feat(flashdb): Added a quickstart for flashdb"
> ```
<Callout variant='important'>
<Callout variant="important">
We, at New Relic, are always happy to receive contributions from the community. However, we are expecting a number of contributions for flashdb following the same lab course.
To help us manage your contributions efficiently, we encourage you to label your contribution following this particular lab as **lab**. You can simply using git tag command as follow:
>```bash
> git tag lab HEAD
>
To help us manage your contributions efficiently, we encourage you to label your contribution following this particular lab as **lab** using `git tag` command.
</Callout>
Expand Down
Loading

0 comments on commit cc31bc1

Please sign in to comment.