diff --git a/demos/shared/grafana/Dockerfile b/demos/shared/grafana/Dockerfile new file mode 100644 index 00000000..40ec1b54 --- /dev/null +++ b/demos/shared/grafana/Dockerfile @@ -0,0 +1,15 @@ +FROM grafana/grafana:latest + +FROM grafana/grafana:latest + +# Set environment variables +ENV GF_SECURITY_ADMIN_USER=admin +ENV GF_SECURITY_ADMIN_PASSWORD=grafana + +# Copy provisioning files +COPY ./datasource.yaml /etc/grafana/provisioning/datasources/datasource.yaml +COPY ./dashboard.yaml /etc/grafana/provisioning/dashboards/main.yaml +COPY ./dashboards /var/lib/grafana/dashboards + +# Expose Grafana port +EXPOSE 3000 diff --git a/demos/weather_forecast/grafana/dashboard.yaml b/demos/shared/grafana/dashboard.yaml similarity index 100% rename from demos/weather_forecast/grafana/dashboard.yaml rename to demos/shared/grafana/dashboard.yaml diff --git a/demos/weather_forecast/grafana/dashboards/envoy_overview.json b/demos/shared/grafana/dashboards/envoy_overview.json similarity index 100% rename from demos/weather_forecast/grafana/dashboards/envoy_overview.json rename to demos/shared/grafana/dashboards/envoy_overview.json diff --git a/demos/weather_forecast/grafana/datasource.yaml b/demos/shared/grafana/datasource.yaml similarity index 100% rename from demos/weather_forecast/grafana/datasource.yaml rename to demos/shared/grafana/datasource.yaml diff --git a/demos/shared/prometheus/Dockerfile b/demos/shared/prometheus/Dockerfile new file mode 100644 index 00000000..1c245059 --- /dev/null +++ b/demos/shared/prometheus/Dockerfile @@ -0,0 +1,11 @@ + +FROM prom/prometheus:latest + +# Set the command to run Prometheus with the specified configuration file +CMD ["--config.file=/etc/prometheus/prometheus.yaml"] + +# Copy the Prometheus configuration files +COPY ./prometheus.yaml /etc/prometheus/prometheus.yaml + +# Expose Prometheus port +EXPOSE 9090 diff --git a/demos/weather_forecast/prometheus/prometheus.yaml b/demos/shared/prometheus/prometheus.yaml similarity index 100% rename from demos/weather_forecast/prometheus/prometheus.yaml rename to demos/shared/prometheus/prometheus.yaml diff --git a/demos/weather_forecast/docker-compose.yaml b/demos/weather_forecast/docker-compose.yaml index c032b1ed..7d074ae4 100644 --- a/demos/weather_forecast/docker-compose.yaml +++ b/demos/weather_forecast/docker-compose.yaml @@ -39,31 +39,11 @@ services: - ~/archgw_logs:/var/log/ prometheus: - image: prom/prometheus - container_name: prometheus - command: - - "--config.file=/etc/prometheus/prometheus.yaml" - ports: - - 9090:9090 - restart: unless-stopped - volumes: - - ./prometheus:/etc/prometheus - - ./prom_data:/prometheus - profiles: - - monitoring + build: + context: ../shared/prometheus grafana: - image: grafana/grafana - container_name: grafana + build: + context: ../shared/grafana ports: - - 3000:3000 - restart: unless-stopped - environment: - - GF_SECURITY_ADMIN_USER=admin - - GF_SECURITY_ADMIN_PASSWORD=grafana - volumes: - - ./grafana:/etc/grafana/provisioning/datasources - - ./grafana/dashboard.yaml:/etc/grafana/provisioning/dashboards/main.yaml - - ./grafana/dashboards:/var/lib/grafana/dashboards - profiles: - - monitoring + - "3000:3000" diff --git a/demos/weather_forecast_signoz/docker-compose.yaml b/demos/weather_forecast_signoz/docker-compose.yaml index e8bc1730..56d7c9da 100644 --- a/demos/weather_forecast_signoz/docker-compose.yaml +++ b/demos/weather_forecast_signoz/docker-compose.yaml @@ -34,31 +34,11 @@ services: - ~/archgw_logs:/var/log/ prometheus: - image: prom/prometheus - container_name: prometheus - command: - - "--config.file=/etc/prometheus/prometheus.yaml" - ports: - - 9090:9090 - restart: unless-stopped - volumes: - - ./prometheus:/etc/prometheus - - ./prom_data:/prometheus - # profiles: - # - monitoring + build: + context: ../shared/prometheus grafana: - image: grafana/grafana - container_name: grafana + build: + context: ../shared/grafana ports: - - 3000:3000 - restart: unless-stopped - environment: - - GF_SECURITY_ADMIN_USER=admin - - GF_SECURITY_ADMIN_PASSWORD=grafana - volumes: - - ./grafana:/etc/grafana/provisioning/datasources - - ./grafana/dashboard.yaml:/etc/grafana/provisioning/dashboards/main.yaml - - ./grafana/dashboards:/var/lib/grafana/dashboards - # profiles: - # - monitoring + - "3000:3000" diff --git a/demos/weather_forecast_signoz/grafana/dashboard.yaml b/demos/weather_forecast_signoz/grafana/dashboard.yaml deleted file mode 100644 index fd66a479..00000000 --- a/demos/weather_forecast_signoz/grafana/dashboard.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: 1 - -providers: - - name: "Dashboard provider" - orgId: 1 - type: file - disableDeletion: false - updateIntervalSeconds: 10 - allowUiUpdates: false - options: - path: /var/lib/grafana/dashboards - foldersFromFilesStructure: true diff --git a/demos/weather_forecast_signoz/grafana/dashboards/envoy_overview.json b/demos/weather_forecast_signoz/grafana/dashboards/envoy_overview.json deleted file mode 100644 index 5d372209..00000000 --- a/demos/weather_forecast_signoz/grafana/dashboards/envoy_overview.json +++ /dev/null @@ -1,587 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 1, - "id": 1, - "links": [], - "panels": [ - { - "datasource": { - "default": true, - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 5, - "x": 0, - "y": 0 - }, - "id": 4, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.3.0+security-01", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "disableTextWrap": false, - "editorMode": "builder", - "exemplar": false, - "expr": "envoy_cluster_upstream_rq_completed{envoy_cluster_name=~\"openai|api_server\"}", - "fullMetaSearch": false, - "includeNullMetadata": false, - "instant": true, - "legendFormat": "{{envoy_cluster_name}}", - "range": false, - "refId": "A", - "useBackend": false - } - ], - "title": "# of Completd Requests", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "histogram_quantile(0.5, sum by(le) (rate(input_sequence_length_bucket[1h])))" - }, - "properties": [ - { - "id": "displayName", - "value": "Input Sequence Length" - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 9, - "x": 5, - "y": 0 - }, - "id": 7, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.3.0+security-01", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "code", - "expr": "histogram_quantile(0.5, sum by(le) (rate(input_sequence_length_bucket[5m])))", - "fullMetaSearch": false, - "includeNullMetadata": false, - "legendFormat": "__auto", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "input sequence length (p50)", - "type": "timeseries" - }, - { - "datasource": { - "default": true, - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "histogram_quantile(0.5, sum(rate(output_sequence_length_bucket[1h])) by(le))" - }, - "properties": [ - { - "id": "displayName", - "value": "Output Sequence Length" - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 10, - "x": 14, - "y": 0 - }, - "id": 3, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.3.0+security-01", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "disableTextWrap": false, - "editorMode": "code", - "expr": "histogram_quantile(0.5, sum(rate(output_sequence_length_bucket[5m])) by(le))", - "fullMetaSearch": false, - "includeNullMetadata": false, - "instant": false, - "legendFormat": "__auto", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "output sequence length (p50)", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "histogram_quantile(0.5, sum by(le) (rate(time_to_first_token_bucket[1h])))" - }, - "properties": [ - { - "id": "displayName", - "value": "Time to First Token" - } - ] - } - ] - }, - "gridPos": { - "h": 14, - "w": 11, - "x": 0, - "y": 9 - }, - "id": 8, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.3.0+security-01", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "code", - "expr": "histogram_quantile(0.5, sum by(le) (rate(time_to_first_token_bucket[5m])))", - "fullMetaSearch": false, - "includeNullMetadata": false, - "legendFormat": "__auto", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "time to first token (p50)", - "type": "timeseries" - }, - { - "datasource": { - "default": true, - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "histogram_quantile(0.5, sum(rate(latency_bucket[60m])) by (le))" - }, - "properties": [ - { - "id": "displayName", - "value": "Total Request Latency" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "histogram_quantile(0.5, sum(rate(time_to_first_token_bucket[60m])) by (le))" - }, - "properties": [ - { - "id": "displayName", - "value": "Time to First Token" - } - ] - } - ] - }, - "gridPos": { - "h": 14, - "w": 13, - "x": 11, - "y": 9 - }, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.3.0+security-01", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "histogram_quantile(0.5, sum(rate(latency_bucket[5m])) by (le))", - "hide": false, - "instant": false, - "legendFormat": "__auto", - "range": true, - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "histogram_quantile(0.5, sum(rate(time_to_first_token_bucket[5m])) by (le))", - "hide": false, - "instant": false, - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "request latency (p50)", - "type": "timeseries" - } - ], - "preload": false, - "refresh": "", - "schemaVersion": 40, - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-15m", - "to": "now" - }, - "timepicker": {}, - "timezone": "browser", - "title": "Arch Gateway Dashboard", - "uid": "adt6uhx5lk8aob", - "version": 2, - "weekStart": "" -} diff --git a/demos/weather_forecast_signoz/grafana/datasource.yaml b/demos/weather_forecast_signoz/grafana/datasource.yaml deleted file mode 100644 index 44999d46..00000000 --- a/demos/weather_forecast_signoz/grafana/datasource.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: 1 - -datasources: - - name: Prometheus - type: prometheus - url: http://prometheus:9090 - isDefault: true - access: proxy - editable: true diff --git a/demos/weather_forecast_signoz/prometheus/prometheus.yaml b/demos/weather_forecast_signoz/prometheus/prometheus.yaml deleted file mode 100644 index 59b47e8c..00000000 --- a/demos/weather_forecast_signoz/prometheus/prometheus.yaml +++ /dev/null @@ -1,23 +0,0 @@ -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - static_configs: - - targets: [] - scheme: http - timeout: 10s - api_version: v1 -scrape_configs: - - job_name: envoy - honor_timestamps: true - scrape_interval: 15s - scrape_timeout: 10s - metrics_path: /stats - scheme: http - static_configs: - - targets: - - host.docker.internal:19901 - params: - format: ["prometheus"]