diff --git a/src/data/nav.yml b/src/data/nav.yml index 06f2077ee..5747adff7 100644 --- a/src/data/nav.yml +++ b/src/data/nav.yml @@ -148,7 +148,7 @@ url: https://opensource.newrelic.com/nerdpacks/ - title: Instant observability - icon: nr-build-apps + icon: url: '/instant-observability' pages: - title: Build a quickstart diff --git a/src/images/instant-observability/average-response-time-chart.png b/src/images/instant-observability/average-response-time-chart.png new file mode 100644 index 000000000..5da29a4ed Binary files /dev/null and b/src/images/instant-observability/average-response-time-chart.png differ diff --git a/src/images/instant-observability/average-response-time.png b/src/images/instant-observability/average-response-time.png deleted file mode 100644 index e467da702..000000000 Binary files a/src/images/instant-observability/average-response-time.png and /dev/null differ diff --git a/src/images/instant-observability/cache-hits-chart.png b/src/images/instant-observability/cache-hits-chart.png new file mode 100644 index 000000000..14d5634e4 Binary files /dev/null and b/src/images/instant-observability/cache-hits-chart.png differ diff --git a/src/images/instant-observability/cache-hits.png b/src/images/instant-observability/cache-hits.png deleted file mode 100644 index 89d4beb5c..000000000 Binary files a/src/images/instant-observability/cache-hits.png and /dev/null differ diff --git a/src/images/instant-observability/copy-dashboard-json.png b/src/images/instant-observability/copy-dashboard-json.png new file mode 100644 index 000000000..627e94a84 Binary files /dev/null and b/src/images/instant-observability/copy-dashboard-json.png differ diff --git a/src/images/instant-observability/dashboard-final.png b/src/images/instant-observability/dashboard-final.png deleted file mode 100644 index a9b405496..000000000 Binary files a/src/images/instant-observability/dashboard-final.png and /dev/null differ diff --git a/src/images/instant-observability/errors-chart.png b/src/images/instant-observability/errors-chart.png new file mode 100644 index 000000000..38b12bfdd Binary files /dev/null and b/src/images/instant-observability/errors-chart.png differ diff --git a/src/images/instant-observability/errors.png b/src/images/instant-observability/errors.png deleted file mode 100644 index ecdc35e9b..000000000 Binary files a/src/images/instant-observability/errors.png and /dev/null differ diff --git a/src/images/instant-observability/final-dashboard.png b/src/images/instant-observability/final-dashboard.png new file mode 100644 index 000000000..34124777f Binary files /dev/null and b/src/images/instant-observability/final-dashboard.png differ diff --git a/src/images/instant-observability/flashDB-dashboard.png b/src/images/instant-observability/flashDB-dashboard.png deleted file mode 100644 index 63523def2..000000000 Binary files a/src/images/instant-observability/flashDB-dashboard.png and /dev/null differ diff --git a/src/images/instant-observability/flashdb-dashboard-directory.png b/src/images/instant-observability/flashdb-dashboard-directory.png new file mode 100644 index 000000000..35014079f Binary files /dev/null and b/src/images/instant-observability/flashdb-dashboard-directory.png differ diff --git a/src/images/instant-observability/json-dashboard.png b/src/images/instant-observability/json-dashboard.png deleted file mode 100644 index 578b0e2e2..000000000 Binary files a/src/images/instant-observability/json-dashboard.png and /dev/null differ diff --git a/src/images/instant-observability/keys-chart.png b/src/images/instant-observability/keys-chart.png new file mode 100644 index 000000000..191898edc Binary files /dev/null and b/src/images/instant-observability/keys-chart.png differ diff --git a/src/images/instant-observability/keys.png b/src/images/instant-observability/keys.png deleted file mode 100644 index da261b6ad..000000000 Binary files a/src/images/instant-observability/keys.png and /dev/null differ diff --git a/src/images/instant-observability/lab-narrative.png b/src/images/instant-observability/lab-narrative.png new file mode 100644 index 000000000..645369efd Binary files /dev/null and b/src/images/instant-observability/lab-narrative.png differ diff --git a/src/images/instant-observability/lab.png b/src/images/instant-observability/lab.png deleted file mode 100644 index 2b6a20159..000000000 Binary files a/src/images/instant-observability/lab.png and /dev/null differ diff --git a/src/markdown-pages/instant-observability/build-a-quickstart/create-a-dashboard.mdx b/src/markdown-pages/instant-observability/build-a-quickstart/create-a-dashboard.mdx index dd72a740a..856953895 100644 --- a/src/markdown-pages/instant-observability/build-a-quickstart/create-a-dashboard.mdx +++ b/src/markdown-pages/instant-observability/build-a-quickstart/create-a-dashboard.mdx @@ -84,24 +84,24 @@ This takes you to the same **Add to your dashboard** page. Add another chart to Run the following query to observe the **average response time** of flashDB queries. ```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 +SELECT average(fdb_create_responses), average(fdb_read_responses), average(fdb_update_responses), average(fdb_delete_responses) FROM Metric TIMESERIES ``` -![average response time chart](../../../images/instant-observability/average-response-time.png ) +![average response time chart](../../../images/instant-observability/average-response-time-chart.png ) -Here, you the observe average response time for different flashDB queries for past 30 minutes. Click **Save** to add this chart to your dashboard. Follow the same procedure to add the rest of the charts. +Here, you the observe average response time for different flashDB queries. Click **Save** to add this chart to your dashboard. Follow the same procedure to add the rest of the charts. ### Errors For the Errors chart, use the following query: ```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 +SELECT sum(fdb_create_errors), sum(fdb_read_errors), sum(fdb_update_errors), sum(fdb_delete_errors) FROM Metric TIMESERIES ``` -Here, you observe errors for all database transactions for the past one hour. +Here, you observe errors for all database queries. -![errors chart](../../../images/instant-observability/errors.png ) +![errors chart](../../../images/instant-observability/errors-chart.png ) ### Database size @@ -120,28 +120,28 @@ This chart shows you the database size. For the cache hits charts, use the following query: ```sql -SELECT sum(fdb_cache_hits) FROM Metric SINCE 30 MINUTES AGO TIMESERIES +SELECT sum(fdb_cache_hits) FROM Metric TIMESERIES ``` -![cache hits chart](../../../images/instant-observability/cache-hits.png ) +![cache hits chart](../../../images/instant-observability/cache-hits-chart.png ) -Here, you observe the total number of cache hits for past 30 minutes using line chart. +Here, you observe the total number of cache hits using line chart. ### Keys Use the following query to get keys chart. ```sql -SELECT count(fdb_keys) FROM Metric SINCE 5 MINUTES AGO TIMESERIES +SELECT count(fdb_keys) FROM Metric TIMESERIES ``` -![keys chart](../../../images/instant-observability/keys.png ) +![keys chart](../../../images/instant-observability/keys-chart.png ) -Here, you observe the flashDB key count for past 5 minutes. +Here, you observe the flashDB key count. Your final dashboard will look similar to the following: -![dashboard with charts](../../../images/instant-observability/dashboard-final.png ) +![dashboard with charts](../../../images/instant-observability/final-dashboard.png ) ## Summary diff --git a/src/markdown-pages/instant-observability/build-a-quickstart/create-a-quickstart.mdx b/src/markdown-pages/instant-observability/build-a-quickstart/create-a-quickstart.mdx index ddea0ee85..623c4a0a3 100644 --- a/src/markdown-pages/instant-observability/build-a-quickstart/create-a-quickstart.mdx +++ b/src/markdown-pages/instant-observability/build-a-quickstart/create-a-quickstart.mdx @@ -36,184 +36,184 @@ Copy the _\_template_ directory and it's content to a new directory within the _ You're going to add existing dashboard to your quickstart. Move to your dashboard in New Relic and copy its JSON. Then save it as a JSON file in the _dashboards_ directory. -![dashboard'\s json](../../../images/instant-observability/json-dashboard.png) +![dashboard'\s json](../../../images/instant-observability/copy-dashboard-json.png) 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 - { - "name": "FlashDB", - "description": null, - "permissions": "PUBLIC_READ_WRITE", - "pages": [ - { - "name": "FlashDB", - "description": null, - "widgets": [ - { - "visualization": { - "id": "viz.pie" - }, - "layout": { - "column": 1, - "row": 1, - "height": 6, - "width": 8 - }, - "title": "Database methods", - "rawConfiguration": { - "facet": { - "showOtherSeries": true - }, - "nrqlQueries": [ - { - "accountId": 3014901, - "query": "SELECT count(*) FROM fdb_method FACET method " - } - ] - }, - "linkedEntityGuids": null +{ + "name": "FlashDB", + "description": null, + "permissions": "PUBLIC_READ_WRITE", + "pages": [ + { + "name": "FlashDB", + "description": null, + "widgets": [ + { + "visualization": { + "id": "viz.pie" }, - { - "visualization": { - "id": "viz.billboard" - }, - "layout": { - "column": 9, - "row": 1, - "height": 3, - "width": 4 - }, - "title": "Database size (bytes)", - "rawConfiguration": { - "dataFormatters": [], - "nrqlQueries": [ - { - "accountId": 3014901, - "query": "SELECT sum(fdb_size) FROM Metric" - } - ], - "thresholds": [] - }, - "linkedEntityGuids": null + "layout": { + "column": 1, + "row": 1, + "height": 6, + "width": 8 }, - { - "visualization": { - "id": "viz.line" - }, - "layout": { - "column": 9, - "row": 4, - "height": 3, - "width": 4 + "title": "Database methods", + "rawConfiguration": { + "facet": { + "showOtherSeries": true }, - "title": "Average response time", - "rawConfiguration": { - "legend": { - "enabled": true - }, - "nrqlQueries": [ - { - "accountId": 3014901, - "query": "SELECT average(fdb_create_responses), average(fdb_read_responses), average(fdb_update_responses), average(fdb_delete_responses) FROM Metric SINCE 30 MINUTES AGO TIMESERIES" - } - ], - "yAxisLeft": { - "zero": true + "nrqlQueries": [ + { + "accountId": 3248695, + "query": "SELECT count(*) FROM fdb_method FACET method " } - }, - "linkedEntityGuids": null + ] }, - { - "visualization": { - "id": "viz.line" - }, - "layout": { - "column": 1, - "row": 7, - "height": 3, - "width": 4 - }, - "title": "Cache hits", - "rawConfiguration": { - "legend": { - "enabled": true - }, - "nrqlQueries": [ - { - "accountId": 3014901, - "query": "SELECT sum(fdb_cache_hits) FROM Metric SINCE 30 MINUTES AGO TIMESERIES" - } - ], - "yAxisLeft": { - "zero": true + "linkedEntityGuids": null + }, + { + "visualization": { + "id": "viz.billboard" + }, + "layout": { + "column": 9, + "row": 1, + "height": 3, + "width": 4 + }, + "title": "database size (bytes)", + "rawConfiguration": { + "dataFormatters": [], + "nrqlQueries": [ + { + "accountId": 3248695, + "query": "SELECT sum(fdb_size) FROM Metric" } - }, - "linkedEntityGuids": null + ], + "thresholds": [] }, - { - "visualization": { - "id": "viz.line" - }, - "layout": { - "column": 5, - "row": 7, - "height": 3, - "width": 4 + "linkedEntityGuids": null + }, + { + "visualization": { + "id": "viz.line" + }, + "layout": { + "column": 9, + "row": 4, + "height": 3, + "width": 4 + }, + "title": "Average response time", + "rawConfiguration": { + "legend": { + "enabled": true }, - "title": "Errors", - "rawConfiguration": { - "legend": { - "enabled": true - }, - "nrqlQueries": [ - { - "accountId": 3014901, - "query": "SELECT sum(fdb_create_errors), sum(fdb_read_errors), sum(fdb_update_errors), sum(fdb_delete_errors) FROM Metric SINCE 30 MINUTES AGO TIMESERIES" - } - ], - "yAxisLeft": { - "zero": true + "nrqlQueries": [ + { + "accountId": 3248695, + "query": "SELECT average(fdb_create_responses), average(fdb_read_responses), average(fdb_update_responses), average(fdb_delete_responses) FROM Metric TIMESERIES" } - }, - "linkedEntityGuids": null + ], + "yAxisLeft": { + "zero": true + } + }, + "linkedEntityGuids": null + }, + { + "visualization": { + "id": "viz.line" }, - { - "visualization": { - "id": "viz.line" + "layout": { + "column": 1, + "row": 7, + "height": 3, + "width": 4 + }, + "title": "Cache hits", + "rawConfiguration": { + "legend": { + "enabled": true }, - "layout": { - "column": 9, - "row": 7, - "height": 3, - "width": 4 + "nrqlQueries": [ + { + "accountId": 3248695, + "query": "SELECT sum(fdb_cache_hits) FROM Metric TIMESERIES" + } + ], + "yAxisLeft": { + "zero": true + } + }, + "linkedEntityGuids": null + }, + { + "visualization": { + "id": "viz.line" + }, + "layout": { + "column": 5, + "row": 7, + "height": 3, + "width": 4 + }, + "title": "Errors", + "rawConfiguration": { + "legend": { + "enabled": true }, - "title": "FlashDB keys", - "rawConfiguration": { - "legend": { - "enabled": true - }, - "nrqlQueries": [ - { - "accountId": 3014901, - "query": "SELECT count(fdb_keys) FROM Metric SINCE 5 MINUTES AGO TIMESERIES" - } - ], - "yAxisLeft": { - "zero": true + "nrqlQueries": [ + { + "accountId": 3248695, + "query": "SELECT sum(fdb_create_errors), sum(fdb_read_errors), sum(fdb_update_errors), sum(fdb_delete_errors) FROM Metric TIMESERIES" } + ], + "yAxisLeft": { + "zero": true + } + }, + "linkedEntityGuids": null + }, + { + "visualization": { + "id": "viz.line" + }, + "layout": { + "column": 9, + "row": 7, + "height": 3, + "width": 4 + }, + "title": "FlashDB keys", + "rawConfiguration": { + "legend": { + "enabled": true }, - "linkedEntityGuids": null - } - ] - } - ] - } + "nrqlQueries": [ + { + "accountId": 3248695, + "query": "SELECT count(fdb_keys) FROM Metric TIMESERIES" + } + ], + "yAxisLeft": { + "zero": true + } + }, + "linkedEntityGuids": null + } + ] + } + ] +} ``` Next, create a screenshot of your dashboard and add it to _dashboards_ directory. Give it the same name as your JSON file. Your _dashboard_ directory should look similar to the following: -![flashDB dashboard](../../../images/instant-observability/flashDB-dashboard.png) +![flashDB dashboard](../../../images/instant-observability/flashdb-dashboard-directory.png) ## Add alerts to quickstart diff --git a/src/markdown-pages/instant-observability/build-a-quickstart/deploy-your-application.mdx b/src/markdown-pages/instant-observability/build-a-quickstart/deploy-your-application.mdx index 338b029cd..fdcc97d76 100644 --- a/src/markdown-pages/instant-observability/build-a-quickstart/deploy-your-application.mdx +++ b/src/markdown-pages/instant-observability/build-a-quickstart/deploy-your-application.mdx @@ -8,47 +8,65 @@ duration: '5 min' -This procedure is a part of lab that teaches you how to build a quickstart. If you haven't already, check out the [_lab introduction_](/instant-observability/build-a-quickstart) +This procedure is a part of lab that teaches you how to build a quickstart. If you haven't already, check out the [_lab introduction_](/instant-observability/build-a-quickstart). -Before you build a quickstart, you need to spin up demo services. The lab depends on two important services: -- A python program that mimics the database and also provides functions for CRUD operations. It also makes use of `newrelic_telemetry_sdk` to send telemetry data to New Relic One. +Before you build a quickstart, you need to spin up a docker container. The container consists of two important services: +- A python program that mimics the database and also provides functions for create, read, update, and delete (CRUD) operations. It also makes use of [newrelic_telemetry_sdk](https://github.com/newrelic/newrelic-telemetry-sdk-python) to send telemetry data to New Relic. - A simulator service that generates dummy database traffic so you don't have to manually perform CRUD operations -To spin up demo services, you first need to install [Docker](https://www.docker.com/) and also set **NEW_RELIC_INSERT_KEY** environment variable. +To spin up these services, you first need to set **NEW_RELIC_INSERT_KEY** environment variable. - +## Prepare your environment -**NEW_RELIC_INSERT_KEY** environment variable is your New Relic liscence key. [You can find your New Relic liscence key in your New Relic account](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/). +On your local machine, set your license key in an environment variable: - +```bash +export NEW_RELIC_INSERT_KEY= +``` + +Your mock database uses this key to write telemetry data to New Relic. [You can find your New Relic license key in your account settings](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/). ## Spin up demo services Clone the lab repository from GitHub: ```bash - git clone https://github.com/mehreentahir16/FlashDB.git + git clone https://github.com/newrelic-experimental/build-a-quickstart-lab.git ``` -This repository contains the code for flashdb as well as the simulator for dummy database traffic. Navigate to the demo directory and execute the following commands to build and run docker image. +This repository contains the code for Flashdb as well as the simulator for dummy database traffic. Navigate to the demo directory and execute the following commands to build and run docker image: ```bash docker build -t flashdb . - docker run flashdb + docker run -e NEW_RELIC_INSERT_KEY=$NEW_RELIC_INSERT_KEY flashdb ``` Here, you build and run docker image that generates mock database traffic. You will observe this data in New Relic. Once the docker image is up and running, you see the following output in your terminal: -![deploy-your-application](../../../images/instant-observability/terminal-output.png) - - - -Make sure you set NEW_RELIC_INSERT_KEY environment variable with your actual [license key](https://docs.newrelic.com/docs/accounts/accounts-billing/account-setup/new-relic-license-key/). +```bash animate +docker build -t flashdb . +docker run -e NEW_RELIC_INSERT_KEY=$NEW_RELIC_INSERT_KEY flashdb +[output] Writing... +[output] try_send +[output] Writing... +[output] try_send +[output] Reading... +[output] try_send +[output] Reading... +[output] try_send +[output] {green}Sent metrics successfully! +[output] sending event... +[output] {green}Event sent successfully! +[output] Writing... +[output] try_send +[output] Writing... +[output] try_send +[output] Reading... +``` - -The next step is to observe this data in New Relic. +Next, you observe this data in New Relic using dashboard. diff --git a/src/markdown-pages/instant-observability/build-a-quickstart/index.mdx b/src/markdown-pages/instant-observability/build-a-quickstart/index.mdx index 0d194e4bb..ef0d1aad2 100644 --- a/src/markdown-pages/instant-observability/build-a-quickstart/index.mdx +++ b/src/markdown-pages/instant-observability/build-a-quickstart/index.mdx @@ -2,41 +2,44 @@ path: '/instant-observability/build-a-quickstart' title: 'Build a quickstart' template: 'GuideTemplate' -description: 'New Relic One quickstarts gives you a jump start in your observability journey with New Relic and allow you to quickly and easily observe and monitor your services' +description: 'Quickstarts gives you a jump start in your observability journey with New Relic. You can use them to quickly and easily observe and monitor your services' --- -You’ve developed a new database called flashDB, the lightest and fastest database in the space. Your database is already very popular among the developers. Now, you want to help users of flashDB to quickly and easily observe it in New Relic. +You’ve developed a new database called FlashDB, the lightest and fastest database in the space. Your database is already very popular among the developers. Now, you want to help users of FlashDB to quickly and easily observe it in New Relic. -![build a quickstart](../../../images/instant-observability/lab.png) +![build a quickstart](../../../images/instant-observability/lab-narrative.png) -To achieve your goal, contribute a quickstart to New Relic I/O so other users can quickly monitor flashDB. +To achieve your goal, contribute a quickstart to New Relic I/O so other users can quickly monitor FlashDB. ## Why quickstarts? -New Relic allows you to collect, monitor, and report data from different sources. While we offer a large variety of open-source integrations for telemetry tools, you can also use Telemetry SDKs to create your own data solutions. You can use dashboards to view, explore, customize, understand, and correlate the data you collect using different user-friendly charts. -You can also set alert policies to monitor key performance metrics and receive notification for anomalies. +With New Relic you can collect, monitor, and report data from different sources. You can use dashboards to view, explore, customize, understand, and correlate the data you collect using different user-friendly charts. +You can also set alert policies to monitor key performance metrics and receive notifications for anomalies. -Often, you had to custom build these solutions to observe your applications in New Relic but now, we offer "quickstarts" to help you and others quickly and easily observe your applications in New Relic. -New Relic One quickstarts provide immediate value for your specific use case. They include: +Traditionally, FlashDB users would have to spend crucial development hours creating dashboards, alerts, and other entities to monitor their database. But with quickstarts, you can do that work for them. +Quickstarts provide immediate value for your specific use case. They include: - Clear instructions for instrumenting your services - Observbility building blocks like dashboards and alerts All of this is available through an open ecosystem where New Relic developers, partners, and customers contribute their best-practice solutions. -Since you're the developer of flashDB, you can also contribute your best-practice solution to help the users of flashDB quickly monitor it in New Relic. +You, as the developer of FlashDB, are a great candidate to contribute a quickstart to help your users of quickly monitor their instances. ## Learning Objectives -In this lab, you will . +In this lab, you: - Create a dashboard - Create alerts - Create a quickstart - - Package up your dashboard & alerts into quickstart - - Add quickstart description - - Contribute quickstart to GitHub + - Package up your dashboard & alerts + - Add a description + - Contribute it to GitHub ## Prerequisite -- New Relic One account +Before you begin: + +- Create a free [New Relic account](https://login.newrelic.com/login) +- Install [Docker](https://www.docker.com/)