{
  "leansignal_demand_export": "1.0",
  "exported_at": "2026-07-17T00:00:00Z",
  "source_tenant": "leansignal-catalog",
  "catalog": {
    "slug": "leansignal-agent-otel-demand-standard",
    "integration": "leansignal-agent",
    "variant": "standard",
    "title": "LeanSignal Agent — Standard",
    "category": "Infrastructure",
    "dashboards": 1,
    "panels": 13,
    "alerts": 6,
    "docs_url": "https://docs.leansignal.io/integrations/leansignal-agent/"
  },
  "demand": {
    "ref": "demand",
    "name": "LeanSignal Agent — Standard (OpenTelemetry)",
    "description": "A rounded fleet view: adds export throughput, export-queue utilization, the size of the demand set, receiver backpressure, and the agent stack's own logs, with warning/critical alerting. The recommended default.",
    "dashboards": [
      {
        "ref": "dash-leansignal-agent",
        "name": "LeanSignal Agent — Standard",
        "description": "The LeanSignal Agent's own telemetry — control-stream health, pipeline throughput, export failures, queue depth, and process memory (standard variant).",
        "data": {
          "display": {
            "name": "LeanSignal Agent — Standard"
          },
          "panels": {
            "connection_up": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Control stream connected",
                  "description": "1 = connected to LeanSignal, 0 = down. Down means no demand updates, index sync, or edit-mode queries."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "decimal"
                      },
                      "min": 0,
                      "max": 1
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "min by (leansignal_agent_name) (leansignal_edgecontroller_connection_up{leansignal_agent_name=~\"$instance\"})",
                          "seriesNameFormat": "{{leansignal_agent_name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "demanded_series": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Demanded timeseries",
                  "description": "Size of the demand set this agent enforces. Zero means nothing is forwarded."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "decimal"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (leansignal_agent_name) (leansignal_edgecontroller_demand_timeseries_cache_size{leansignal_agent_name=~\"$instance\"})",
                          "seriesNameFormat": "{{leansignal_agent_name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "ingest_rate": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Accepted metric points",
                  "description": "Points entering the pipeline, per receiver."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "counts/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (leansignal_agent_name, receiver) (rate(otelcol_receiver_accepted_metric_points_total{leansignal_agent_name=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{leansignal_agent_name}} · {{receiver}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "export_rate": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Sent metric points",
                  "description": "Points leaving the pipeline, per exporter (local store and dataplane)."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "counts/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (leansignal_agent_name, exporter) (rate(otelcol_exporter_sent_metric_points_total{leansignal_agent_name=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{leansignal_agent_name}} · {{exporter}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "export_rate_logs": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Sent log records",
                  "description": "Log records leaving the pipeline, per exporter (local store and tenant log store)."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "counts/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (leansignal_agent_name, exporter) (rate(otelcol_exporter_sent_log_records_total{leansignal_agent_name=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{leansignal_agent_name}} · {{exporter}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "export_rate_spans": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Sent spans",
                  "description": "Spans leaving the pipeline, per exporter (local store and tenant trace store)."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "counts/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (leansignal_agent_name, exporter) (rate(otelcol_exporter_sent_spans_total{leansignal_agent_name=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{leansignal_agent_name}} · {{exporter}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "store_disk": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Local metrics store disk",
                  "description": "Bytes of TSDB data in the agent's co-located VictoriaMetrics — the full-fidelity local buffer (1d retention)."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "bytes"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (leansignal_agent_name) (vm_data_size_bytes{leansignal_agent_name=~\"$instance\",job=\"leansignal-avm\"})",
                          "seriesNameFormat": "{{leansignal_agent_name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "store_free_disk": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Local store free disk",
                  "description": "Free disk space at the local metrics store's storage path — headroom before the 1d buffer starts failing writes."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "bytes"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "min by (leansignal_agent_name) (vm_free_disk_space_bytes{leansignal_agent_name=~\"$instance\",job=\"leansignal-avm\"})",
                          "seriesNameFormat": "{{leansignal_agent_name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "receiver_refused": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Refused metric points",
                  "description": "Points rejected at the door (backpressure or limits) — zero on a healthy agent."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "counts/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (leansignal_agent_name, receiver) (rate(otelcol_receiver_refused_metric_points_total{leansignal_agent_name=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{leansignal_agent_name}} · {{receiver}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "export_failures": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Failed metric points",
                  "description": "Points that failed to write out — sustained failures mean data loss."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "counts/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (leansignal_agent_name, exporter) (rate(otelcol_exporter_send_failed_metric_points_total{leansignal_agent_name=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{leansignal_agent_name}} · {{exporter}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "queue_utilization": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Export queue utilization",
                  "description": "Queue fill per exporter — at 100% the next batch is dropped."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "percent-decimal"
                      },
                      "min": 0,
                      "max": 1
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (leansignal_agent_name, exporter) (otelcol_exporter_queue_size{leansignal_agent_name=~\"$instance\"} / otelcol_exporter_queue_capacity{leansignal_agent_name=~\"$instance\"})",
                          "seriesNameFormat": "{{leansignal_agent_name}} · {{exporter}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "agent_logs": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Agent & store logs",
                  "description": "Live logs from the agent and its co-located stores. On Windows — where the service captures no log file — this stream is the only way to read agent logs."
                },
                "plugin": {
                  "kind": "LogsTable",
                  "spec": {
                    "showTime": true,
                    "allowWrap": true,
                    "enableDetails": true
                  }
                },
                "queries": [
                  {
                    "kind": "LogQuery",
                    "spec": {
                      "plugin": {
                        "kind": "LokiLogQuery",
                        "spec": {
                          "query": "{service_name=~\"leansignal-agent|leansignal-loki|leansignal-tempo|leansignal-victoria-metrics\"}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "memory_rss": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Agent memory (RSS)",
                  "description": "Resident memory of the agent process."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "bytes"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (leansignal_agent_name) (otelcol_process_memory_rss_bytes{leansignal_agent_name=~\"$instance\"})",
                          "seriesNameFormat": "{{leansignal_agent_name}}"
                        }
                      }
                    }
                  }
                ]
              }
            }
          },
          "layouts": [
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Control Plane",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/connection_up"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/demanded_series"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Throughput",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/ingest_rate"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/export_rate"
                    }
                  },
                  {
                    "x": 0,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/export_rate_logs"
                    }
                  },
                  {
                    "x": 12,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/export_rate_spans"
                    }
                  },
                  {
                    "x": 0,
                    "y": 16,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/receiver_refused"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Export Health",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/export_failures"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/queue_utilization"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Local Stores",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/store_disk"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/store_free_disk"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Logs",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 24,
                    "height": 10,
                    "content": {
                      "$ref": "#/spec/panels/agent_logs"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Process",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/memory_rss"
                    }
                  }
                ]
              }
            }
          ],
          "variables": [
            {
              "kind": "ListVariable",
              "spec": {
                "name": "instance",
                "display": {
                  "name": "Instance"
                },
                "allowAllValue": true,
                "allowMultiple": true,
                "customAllValue": ".*",
                "defaultValue": ".*",
                "plugin": {
                  "kind": "PrometheusLabelValuesVariable",
                  "spec": {
                    "labelName": "leansignal_agent_name"
                  }
                }
              }
            }
          ],
          "duration": "1h",
          "refreshInterval": "30s",
          "datasources": {}
        }
      }
    ],
    "alert_rules": [
      {
        "ref": "alert-agent-disconnected",
        "name": "Agent control stream down",
        "description": null,
        "query": "min by (leansignal_agent_name) (leansignal_edgecontroller_connection_up)",
        "condition_op": "lt",
        "threshold": 1,
        "interval": "1m",
        "for": "5m",
        "severity": "critical",
        "message": "Agent {{labels.leansignal_agent_name}} has lost its control stream to LeanSignal — no demand updates, no index sync, no UI queries.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-export-failures",
        "name": "Agent export failures",
        "description": null,
        "query": "sum by (leansignal_agent_name, exporter) (rate(otelcol_exporter_send_failed_metric_points_total[5m]))",
        "condition_op": "gt",
        "threshold": 0,
        "interval": "1m",
        "for": "10m",
        "severity": "critical",
        "message": "Agent {{labels.leansignal_agent_name}} is failing to write to {{labels.exporter}} ({{value}} points/s) — data-loss risk.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-queue-near-capacity",
        "name": "Agent export queue near capacity",
        "description": null,
        "query": "max by (leansignal_agent_name, exporter) (otelcol_exporter_queue_size / otelcol_exporter_queue_capacity)",
        "condition_op": "gt",
        "threshold": 0.8,
        "interval": "1m",
        "for": "5m",
        "severity": "warning",
        "message": "Agent {{labels.leansignal_agent_name}} export queue for {{labels.exporter}} is {{value | percent:1}} full — the next step is dropped data.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-receiver-refusing",
        "name": "Agent refusing incoming data",
        "description": null,
        "query": "sum by (leansignal_agent_name, receiver) (rate(otelcol_receiver_refused_metric_points_total[5m]))",
        "condition_op": "gt",
        "threshold": 0,
        "interval": "1m",
        "for": "10m",
        "severity": "warning",
        "message": "Agent {{labels.leansignal_agent_name}} is refusing points on {{labels.receiver}} ({{value}}/s) — backpressure or limits.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-empty-demand-set",
        "name": "Agent demand set is empty",
        "description": null,
        "query": "max by (leansignal_agent_name) (leansignal_edgecontroller_demand_timeseries_cache_size)",
        "condition_op": "lt",
        "threshold": 1,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "Agent {{labels.leansignal_agent_name}} has an empty demand set — nothing is being forwarded to the central dataplane (fail-closed).",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-agent-restarted",
        "name": "Agent restarted",
        "description": null,
        "query": "min by (leansignal_agent_name) (otelcol_process_uptime_seconds_total)",
        "condition_op": "lt",
        "threshold": 300,
        "interval": "1m",
        "for": "1m",
        "severity": "warning",
        "message": "Agent {{labels.leansignal_agent_name}} restarted (uptime {{value}}s).",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      }
    ]
  }
}
