Skip to content

Commit

Permalink
Merge pull request #7 from rizalgowandy/arwego_f_v1
Browse files Browse the repository at this point in the history
Restructure Dashboard
  • Loading branch information
Rizal Widyarta Gowandy authored Feb 1, 2021
2 parents 0a2efa2 + 1e32e63 commit 34aebb1
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 37 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/pr-labeler.yml → .github/configs/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enhancement: [ 'feature/*', 'feat/*', 'f_*', '*_f*', 'i_*', '*_i*' ]
bug: [ 'fix/*', 'bug/*', 'b_*', '*_b*' ]
chore: [ 'chore/*', '*_c_*', 'c_*' ]
chore: [ 'chore/*', '*_chore_*', '*_c_*', 'c_*' ]
documentation: [ 'documentation/*', 'doc/*', '*_d*', 'd_*', '*_doc*', 'doc_*' ]
File renamed without changes.
17 changes: 17 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Greetings

on:
pull_request:
types: [ opened ]
issues:
types: [ opened ]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Hi, thank you for creating this issue'
pr-message: 'Hi, thank you for your contribution'
2 changes: 1 addition & 1 deletion .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
steps:
- uses: TimonVS/pr-labeler-action@v3
with:
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
configuration-path: .github/configs/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ jobs:
steps:
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v5
with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
config-name: configs/release-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,27 @@ Terraform module to interact with NewRelic.

```hcl
data "newrelic_entity" "app_grpc" {
name = "app_grpc"
# Replace with your service name.
name = "app_grpc"
domain = "APM"
type = "APPLICATION"
}
module "grpc_dashboard" {
source = "git::https://github.com/rizalgowandy/terraform-peractio-newrelic?ref=v0.0.2"
service_name = "app_grpc"
# Replace with your service name.
service_name = "app_grpc"
# Replace with your application id.
application_id = data.newrelic_entity.app_grpc.application_id
event_name = "grpc_performance"
# Replace with your metric name.
event_methods = [
"/inventory.v1.Inventory/GetProducts", # Replace with your metric method name.
event_name = "grpc_performance"
# Replace with your metric method name.
event_methods = [
"/inventory.v1.Inventory/GetProducts",
"/inventory.v1.Inventory/CheckStocks",
]
}
Expand Down
58 changes: 29 additions & 29 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "newrelic_dashboard" "main" {
title = var.service_name
title = var.dashboard_name

filter {
event_types = [
Expand Down Expand Up @@ -64,44 +64,44 @@ resource "newrelic_dashboard" "main" {
}

widget {
title = "Operation with most errors"
title = "Error with most occurrence"
visualization = "facet_bar_chart"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE metric_status = 'error' or metric_status = 'expected_error' FACET `ops` LIMIT 10 EXTRAPOLATE"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE metric_status = 'error' or metric_status = 'expected_error' FACET `err` LIMIT 10 EXTRAPOLATE"
row = 3
column = 1
}

widget {
title = "Error with most occurrence"
title = "Error code with most occurrence"
visualization = "facet_bar_chart"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE metric_status = 'error' or metric_status = 'expected_error' FACET `err` LIMIT 10 EXTRAPOLATE"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE metric_status = 'error' or metric_status = 'expected_error' FACET `code` LIMIT 10 EXTRAPOLATE"
row = 3
column = 2
}

widget {
title = "Error code with most occurrence"
visualization = "facet_bar_chart"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE metric_status = 'error' or metric_status = 'expected_error' FACET `code` LIMIT 10 EXTRAPOLATE"
title = "Human error message with most occurrence"
visualization = "facet_table"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE metric_status = 'error' or metric_status = 'expected_error' FACET `message` LIMIT 10 EXTRAPOLATE"
row = 3
column = 3
}

widget {
title = "Line with most errors"
title = "Operation with most errors"
visualization = "facet_bar_chart"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE metric_status = 'error' or metric_status = 'expected_error' FACET `err_line` LIMIT 10 EXTRAPOLATE"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE metric_status = 'error' or metric_status = 'expected_error' FACET `ops` LIMIT 10 EXTRAPOLATE"
row = 4
column = 1
width = 2
}

widget {
title = "Human error message with most occurrence"
visualization = "facet_table"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE metric_status = 'error' or metric_status = 'expected_error' FACET `message` LIMIT 10 EXTRAPOLATE"
title = "Line with most errors"
visualization = "facet_bar_chart"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE metric_status = 'error' or metric_status = 'expected_error' FACET `err_line` LIMIT 10 EXTRAPOLATE"
row = 4
column = 3
column = 2
width = 2
}

#####################
Expand Down Expand Up @@ -152,9 +152,9 @@ resource "newrelic_dashboard" "main" {
for_each = var.event_methods

content {
title = "${widget.value} operation with most errors"
title = "${widget.value} error with most occurrence"
visualization = "facet_bar_chart"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE method ='${widget.value}' AND metric_status = 'error' or metric_status = 'expected_error' FACET `ops` LIMIT 10 EXTRAPOLATE"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE method ='${widget.value}' AND metric_status = 'error' or metric_status = 'expected_error' FACET `err` LIMIT 10 EXTRAPOLATE"
row = 1 + var.base_row + widget.key * (var.total_column_per_method / 3)
column = 1
}
Expand All @@ -164,9 +164,9 @@ resource "newrelic_dashboard" "main" {
for_each = var.event_methods

content {
title = "${widget.value} error with most occurrence"
title = "${widget.value} error code with most occurrence"
visualization = "facet_bar_chart"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE method ='${widget.value}' AND metric_status = 'error' or metric_status = 'expected_error' FACET `err` LIMIT 10 EXTRAPOLATE"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE method ='${widget.value}' AND metric_status = 'error' or metric_status = 'expected_error' FACET `code` LIMIT 10 EXTRAPOLATE"
row = 1 + var.base_row + widget.key * (var.total_column_per_method / 3)
column = 2
}
Expand All @@ -176,9 +176,9 @@ resource "newrelic_dashboard" "main" {
for_each = var.event_methods

content {
title = "${widget.value} error code with most occurrence"
visualization = "facet_bar_chart"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE method ='${widget.value}' AND metric_status = 'error' or metric_status = 'expected_error' FACET `code` LIMIT 10 EXTRAPOLATE"
title = "${widget.value} human error message with most occurrence"
visualization = "facet_table"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE method ='${widget.value}' AND metric_status = 'error' or metric_status = 'expected_error' FACET `message` LIMIT 10 EXTRAPOLATE"
row = 1 + var.base_row + widget.key * (var.total_column_per_method / 3)
column = 3
}
Expand All @@ -190,24 +190,24 @@ resource "newrelic_dashboard" "main" {
for_each = var.event_methods

content {
title = "${widget.value} line with most errors"
title = "${widget.value} operation with most errors"
visualization = "facet_bar_chart"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE method ='${widget.value}' AND metric_status = 'error' or metric_status = 'expected_error' FACET `err_line` LIMIT 10 EXTRAPOLATE"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE method ='${widget.value}' AND metric_status = 'error' or metric_status = 'expected_error' FACET `ops` LIMIT 10 EXTRAPOLATE"
row = 2 + var.base_row + widget.key * (var.total_column_per_method / 3)
column = 1
width = 2
}
}

dynamic "widget" {
for_each = var.event_methods

content {
title = "${widget.value} human error message with most occurrence"
visualization = "facet_table"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE method ='${widget.value}' AND metric_status = 'error' or metric_status = 'expected_error' FACET `message` LIMIT 10 EXTRAPOLATE"
title = "${widget.value} line with most errors"
visualization = "facet_bar_chart"
nrql = "SELECT count(*) FROM ${var.event_name} WHERE method ='${widget.value}' AND metric_status = 'error' or metric_status = 'expected_error' FACET `err_line` LIMIT 10 EXTRAPOLATE"
row = 2 + var.base_row + widget.key * (var.total_column_per_method / 3)
column = 3
column = 2
width = 2
}
}
}
4 changes: 4 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
variable "dashboard_name" {
type = string
}

variable "service_name" {
type = string
}
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = "~> 0.14.4"
required_version = "~> 0.14.5"

required_providers {
newrelic = {
Expand Down

0 comments on commit 34aebb1

Please sign in to comment.