{
  "tags": [],
  "title": "NodeJS Application Dashboard",
  "widgets": [
    {
      "layout": {
        "x": 0,
        "y": 0,
        "width": 5,
        "height": 2
      },
      "definition": {
        "type": "timeseries",
        "title": "Process CPU Usage",
        "yaxis": {
          "max": "auto",
          "min": "auto",
          "label": "",
          "scale": "linear",
          "include_zero": true
        },
        "requests": [
          {
            "style": {
              "palette": "dog_classic",
              "line_type": "solid",
              "line_width": "normal"
            },
            "queries": [
              {
                "name": "query1",
                "query": "avg:process_cpu_user_seconds.count{$instance} by {instance}.as_rate()",
                "data_source": "metrics"
              },
              {
                "name": "query2",
                "query": "avg:process_cpu_system_seconds.count{$instance} by {instance}.as_rate()",
                "data_source": "metrics"
              }
            ],
            "formulas": [
              {
                "formula": "query1 * 100"
              },
              {
                "formula": "query2 * 100"
              }
            ],
            "display_type": "area",
            "response_format": "timeseries"
          }
        ],
        "show_legend": true,
        "legend_layout": "auto",
        "legend_columns": [
          "avg",
          "min",
          "max",
          "value",
          "sum"
        ]
      }
    },
    {
      "layout": {
        "x": 5,
        "y": 0,
        "width": 4,
        "height": 2
      },
      "definition": {
        "type": "timeseries",
        "title": "Event Loop Lag",
        "yaxis": {
          "max": "auto",
          "min": "auto",
          "label": "",
          "scale": "linear",
          "include_zero": true
        },
        "requests": [
          {
            "style": {
              "palette": "dog_classic",
              "line_type": "solid",
              "line_width": "normal"
            },
            "queries": [
              {
                "name": "query1",
                "query": "avg:nodejs_eventloop_lag_seconds{$instance} by {instance}",
                "data_source": "metrics"
              }
            ],
            "formulas": [
              {
                "formula": "query1"
              }
            ],
            "display_type": "area",
            "response_format": "timeseries"
          }
        ],
        "show_legend": true,
        "legend_layout": "auto",
        "legend_columns": [
          "avg",
          "min",
          "max",
          "value",
          "sum"
        ]
      }
    },
    {
      "layout": {
        "x": 9,
        "y": 0,
        "width": 3,
        "height": 1
      },
      "definition": {
        "type": "query_value",
        "title": "Node.js Version",
        "requests": [
          {
            "queries": [
              {
                "name": "query1",
                "query": "sum:nodejs_version_info{$instance} by {version}",
                "aggregator": "last",
                "data_source": "metrics"
              }
            ],
            "formulas": [
              {
                "formula": "query1"
              }
            ],
            "response_format": "scalar"
          }
        ],
        "autoscale": true,
        "precision": 2,
        "text_align": "center"
      }
    },
    {
      "layout": {
        "x": 9,
        "y": 1,
        "width": 3,
        "height": 1
      },
      "definition": {
        "type": "note",
        "content": "**Process Restart Times**\n\nUnsupported panel (singlestat)\n\n- changes() over a range has no Datadog formula equivalent; restart counting cannot be expressed\n\nOriginal PromQL:\n```\nA: sum(changes(process_start_time_seconds{instance=~\"$instance\"}[1m]))\n```",
        "tick_pos": "50%",
        "font_size": "14",
        "show_tick": false,
        "tick_edge": "left",
        "text_align": "left",
        "has_padding": true,
        "vertical_align": "top",
        "background_color": "white"
      }
    },
    {
      "layout": {
        "x": 0,
        "y": 2,
        "width": 8,
        "height": 2
      },
      "definition": {
        "type": "timeseries",
        "title": "Process Memory Usage",
        "yaxis": {
          "max": "auto",
          "min": "auto",
          "label": "",
          "scale": "linear",
          "include_zero": true
        },
        "requests": [
          {
            "style": {
              "palette": "dog_classic",
              "line_type": "solid",
              "line_width": "normal"
            },
            "queries": [
              {
                "name": "query1",
                "query": "avg:process_resident_memory_bytes{$instance} by {instance}",
                "data_source": "metrics"
              },
              {
                "name": "query2",
                "query": "avg:nodejs_heap_size_total_bytes{$instance} by {instance}",
                "data_source": "metrics"
              },
              {
                "name": "query3",
                "query": "avg:nodejs_heap_size_used_bytes{$instance} by {instance}",
                "data_source": "metrics"
              },
              {
                "name": "query4",
                "query": "avg:nodejs_external_memory_bytes{$instance} by {instance}",
                "data_source": "metrics"
              }
            ],
            "formulas": [
              {
                "formula": "query1"
              },
              {
                "formula": "query2"
              },
              {
                "formula": "query3"
              },
              {
                "formula": "query4"
              }
            ],
            "display_type": "area",
            "response_format": "timeseries"
          }
        ],
        "show_legend": true,
        "legend_layout": "auto",
        "legend_columns": [
          "avg",
          "min",
          "max",
          "value",
          "sum"
        ]
      }
    },
    {
      "layout": {
        "x": 8,
        "y": 2,
        "width": 4,
        "height": 2
      },
      "definition": {
        "type": "timeseries",
        "title": "Active Handlers/Requests Total",
        "yaxis": {
          "max": "auto",
          "min": "auto",
          "label": "",
          "scale": "linear",
          "include_zero": true
        },
        "requests": [
          {
            "style": {
              "palette": "dog_classic",
              "line_type": "solid",
              "line_width": "normal"
            },
            "queries": [
              {
                "name": "query1",
                "query": "avg:nodejs_active_handles.count{$instance} by {instance}",
                "data_source": "metrics"
              },
              {
                "name": "query2",
                "query": "avg:nodejs_active_requests.count{$instance} by {instance}",
                "data_source": "metrics"
              }
            ],
            "formulas": [
              {
                "formula": "query1"
              },
              {
                "formula": "query2"
              }
            ],
            "display_type": "area",
            "response_format": "timeseries"
          }
        ],
        "show_legend": true,
        "legend_layout": "auto",
        "legend_columns": [
          "avg",
          "min",
          "max",
          "value",
          "sum"
        ]
      }
    },
    {
      "layout": {
        "x": 0,
        "y": 4,
        "width": 4,
        "height": 2
      },
      "definition": {
        "type": "timeseries",
        "title": "Heap Total Detail",
        "yaxis": {
          "max": "auto",
          "min": "auto",
          "label": "",
          "scale": "linear",
          "include_zero": true
        },
        "requests": [
          {
            "style": {
              "palette": "dog_classic",
              "line_type": "solid",
              "line_width": "normal"
            },
            "queries": [
              {
                "name": "query1",
                "query": "avg:nodejs_heap_space_size_total_bytes{$instance} by {instance,space}",
                "data_source": "metrics"
              }
            ],
            "formulas": [
              {
                "formula": "query1"
              }
            ],
            "display_type": "area",
            "response_format": "timeseries"
          }
        ],
        "show_legend": true,
        "legend_layout": "auto",
        "legend_columns": [
          "avg",
          "min",
          "max",
          "value",
          "sum"
        ]
      }
    },
    {
      "layout": {
        "x": 4,
        "y": 4,
        "width": 4,
        "height": 2
      },
      "definition": {
        "type": "timeseries",
        "title": "Heap Used Detail",
        "yaxis": {
          "max": "auto",
          "min": "auto",
          "label": "",
          "scale": "linear",
          "include_zero": true
        },
        "requests": [
          {
            "style": {
              "palette": "dog_classic",
              "line_type": "solid",
              "line_width": "normal"
            },
            "queries": [
              {
                "name": "query1",
                "query": "avg:nodejs_heap_space_size_used_bytes{$instance} by {instance,space}",
                "data_source": "metrics"
              }
            ],
            "formulas": [
              {
                "formula": "query1"
              }
            ],
            "display_type": "area",
            "response_format": "timeseries"
          }
        ],
        "show_legend": true,
        "legend_layout": "auto",
        "legend_columns": [
          "avg",
          "min",
          "max",
          "value",
          "sum"
        ]
      }
    },
    {
      "layout": {
        "x": 8,
        "y": 4,
        "width": 4,
        "height": 2
      },
      "definition": {
        "type": "timeseries",
        "title": "Heap Available Detail",
        "yaxis": {
          "max": "auto",
          "min": "auto",
          "label": "",
          "scale": "linear",
          "include_zero": true
        },
        "requests": [
          {
            "style": {
              "palette": "dog_classic",
              "line_type": "solid",
              "line_width": "normal"
            },
            "queries": [
              {
                "name": "query1",
                "query": "avg:nodejs_heap_space_size_available_bytes{$instance} by {instance,space}",
                "data_source": "metrics"
              }
            ],
            "formulas": [
              {
                "formula": "query1"
              }
            ],
            "display_type": "area",
            "response_format": "timeseries"
          }
        ],
        "show_legend": true,
        "legend_layout": "auto",
        "legend_columns": [
          "avg",
          "min",
          "max",
          "value",
          "sum"
        ]
      }
    }
  ],
  "description": "Converted from Grafana dashboard https://grafana.com/grafana/dashboards/11159 (by Joey Yang). node.js prometheus client basic metrics",
  "layout_type": "ordered",
  "reflow_type": "fixed",
  "template_variables": [
    {
      "name": "instance",
      "prefix": "instance",
      "default": "*",
      "available_values": []
    }
  ]
}