feat: Add custom metric builder, export/import, and Grafana dashboards (v0.3.0)
All checks were successful
Create Release Package / build-release (push) Successful in 59s

- Custom Metrics Builder with admin UI for gauge metrics
- Support for static values and WordPress option-based values
- JSON-based export/import with skip/overwrite/rename modes
- Three Grafana dashboard templates (overview, runtime, WooCommerce)
- New tabs: Custom Metrics and Dashboards
- Reset runtime metrics button

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-02 15:27:16 +01:00
parent da6d5081f7
commit bad977bef0
16 changed files with 6239 additions and 620 deletions

Binary file not shown.

View File

@@ -3,7 +3,7 @@
# This file is distributed under the GPL v2 or later.
msgid ""
msgstr ""
"Project-Id-Version: WP Prometheus 0.2.0\n"
"Project-Id-Version: WP Prometheus 0.3.0\n"
"Report-Msgid-Bugs-To: https://src.bundespruefstelle.ch/magdev/wp-prometheus/issues\n"
"POT-Creation-Date: 2026-02-02T00:00:00+00:00\n"
"PO-Revision-Date: 2026-02-02T00:00:00+00:00\n"
@@ -31,6 +31,14 @@ msgstr "Lizenz"
msgid "Help"
msgstr "Hilfe"
#: src/Admin/Settings.php
msgid "Custom Metrics"
msgstr "Eigene Metriken"
#: src/Admin/Settings.php
msgid "Dashboards"
msgstr "Dashboards"
#: src/Admin/Settings.php
msgid "License settings saved."
msgstr "Lizenz-Einstellungen gespeichert."
@@ -213,6 +221,18 @@ msgstr "WooCommerce-Umsatz (gesamt, heute, Monat)"
msgid "WooCommerce Customers (registered, guest)"
msgstr "WooCommerce-Kunden (registriert, Gast)"
#: src/Admin/Settings.php
msgid "Reset Runtime Metrics"
msgstr "Laufzeit-Metriken zuruecksetzen"
#: src/Admin/Settings.php
msgid "Clear all accumulated runtime metric data."
msgstr "Alle gesammelten Laufzeit-Metrikdaten loeschen."
#: src/Admin/Settings.php
msgid "Reset Metrics"
msgstr "Metriken zuruecksetzen"
#: src/Admin/Settings.php
msgid "Prometheus Configuration"
msgstr "Prometheus-Konfiguration"
@@ -329,14 +349,252 @@ msgstr "WooCommerce-Umsatz nach Zeitraum"
msgid "WooCommerce customers by type"
msgstr "WooCommerce-Kunden nach Typ"
#: src/Admin/Settings.php
msgid "Custom Metrics"
msgstr "Benutzerdefinierte Metriken"
#: src/Admin/Settings.php
msgid "You can add custom metrics using the wp_prometheus_collect_metrics action:"
msgstr "Sie koennen benutzerdefinierte Metriken mit der wp_prometheus_collect_metrics-Aktion hinzufuegen:"
#: src/Admin/Settings.php
msgid "Add Custom Metric"
msgstr "Eigene Metrik hinzufuegen"
#: src/Admin/Settings.php
msgid "Edit Custom Metric"
msgstr "Eigene Metrik bearbeiten"
#: src/Admin/Settings.php
msgid "Metric Name"
msgstr "Metrik-Name"
#: src/Admin/Settings.php
msgid "Must follow Prometheus naming conventions."
msgstr "Muss den Prometheus-Namenskonventionen entsprechen."
#: src/Admin/Settings.php
msgid "Help Text"
msgstr "Hilfetext"
#: src/Admin/Settings.php
msgid "Description shown in Prometheus output."
msgstr "Beschreibung in der Prometheus-Ausgabe."
#: src/Admin/Settings.php
msgid "Value Type"
msgstr "Werttyp"
#: src/Admin/Settings.php
msgid "Static Value"
msgstr "Statischer Wert"
#: src/Admin/Settings.php
msgid "WordPress Option"
msgstr "WordPress-Option"
#: src/Admin/Settings.php
msgid "Static Value:"
msgstr "Statischer Wert:"
#: src/Admin/Settings.php
msgid "Option Name:"
msgstr "Optionsname:"
#: src/Admin/Settings.php
msgid "The name of the WordPress option to read."
msgstr "Der Name der zu lesenden WordPress-Option."
#: src/Admin/Settings.php
msgid "Labels"
msgstr "Labels"
#: src/Admin/Settings.php
msgid "Label name"
msgstr "Label-Name"
#: src/Admin/Settings.php
msgid "Add Label"
msgstr "Label hinzufuegen"
#: src/Admin/Settings.php
msgid "Label Values"
msgstr "Label-Werte"
#: src/Admin/Settings.php
msgid "Value"
msgstr "Wert"
#: src/Admin/Settings.php
msgid "Add Value Row"
msgstr "Wertezeile hinzufuegen"
#: src/Admin/Settings.php
msgid "Enabled"
msgstr "Aktiviert"
#: src/Admin/Settings.php
msgid "Save Metric"
msgstr "Metrik speichern"
#: src/Admin/Settings.php
msgid "Cancel"
msgstr "Abbrechen"
#: src/Admin/Settings.php
msgid "Your Custom Metrics"
msgstr "Ihre eigenen Metriken"
#: src/Admin/Settings.php
msgid "Name"
msgstr "Name"
#: src/Admin/Settings.php
msgid "Status"
msgstr "Status"
#: src/Admin/Settings.php
msgid "Actions"
msgstr "Aktionen"
#: src/Admin/Settings.php
msgid "Active"
msgstr "Aktiv"
#: src/Admin/Settings.php
msgid "Inactive"
msgstr "Inaktiv"
#: src/Admin/Settings.php
msgid "Edit"
msgstr "Bearbeiten"
#: src/Admin/Settings.php
msgid "Delete"
msgstr "Loeschen"
#: src/Admin/Settings.php
msgid "No custom metrics defined yet."
msgstr "Noch keine eigenen Metriken definiert."
#: src/Admin/Settings.php
msgid "Export / Import"
msgstr "Export / Import"
#: src/Admin/Settings.php
msgid "Export your custom metrics configuration for backup or transfer to another site."
msgstr "Exportieren Sie Ihre Metriken-Konfiguration zur Sicherung oder Uebertragung auf eine andere Website."
#: src/Admin/Settings.php
msgid "Export Metrics"
msgstr "Metriken exportieren"
#: src/Admin/Settings.php
msgid "Import Metrics"
msgstr "Metriken importieren"
#: src/Admin/Settings.php
msgid "Import Options"
msgstr "Import-Optionen"
#: src/Admin/Settings.php
msgid "Skip existing metrics"
msgstr "Bestehende Metriken ueberspringen"
#: src/Admin/Settings.php
msgid "Overwrite existing metrics"
msgstr "Bestehende Metriken ueberschreiben"
#: src/Admin/Settings.php
msgid "Rename duplicates"
msgstr "Duplikate umbenennen"
#: src/Admin/Settings.php
msgid "Import"
msgstr "Importieren"
#: src/Admin/Settings.php
msgid "Grafana Dashboard Templates"
msgstr "Grafana Dashboard-Vorlagen"
#: src/Admin/Settings.php
msgid "Download pre-built Grafana dashboards for visualizing your WordPress metrics."
msgstr "Laden Sie vorgefertigte Grafana-Dashboards zur Visualisierung Ihrer WordPress-Metriken herunter."
#: src/Admin/Settings.php
msgid "Download"
msgstr "Herunterladen"
#: src/Admin/Settings.php
msgid "Import instructions:"
msgstr "Import-Anleitung:"
#: src/Admin/Settings.php
msgid "Download the desired dashboard JSON file"
msgstr "Laden Sie die gewuenschte Dashboard-JSON-Datei herunter"
#: src/Admin/Settings.php
msgid "In Grafana, go to Dashboards > Import"
msgstr "Gehen Sie in Grafana zu Dashboards > Import"
#: src/Admin/Settings.php
msgid "Upload the JSON file or paste its contents"
msgstr "Laden Sie die JSON-Datei hoch oder fuegen Sie deren Inhalt ein"
#: src/Admin/Settings.php
msgid "Select your Prometheus data source"
msgstr "Waehlen Sie Ihre Prometheus-Datenquelle"
#: src/Admin/Settings.php
msgid "Click Import"
msgstr "Klicken Sie auf Import"
#: src/Metrics/CustomMetricBuilder.php
msgid "Metric name is required."
msgstr "Metrik-Name ist erforderlich."
#: src/Metrics/CustomMetricBuilder.php
msgid "Invalid metric name format."
msgstr "Ungueltiges Metrik-Namensformat."
#: src/Metrics/CustomMetricBuilder.php
msgid "A metric with this name already exists."
msgstr "Eine Metrik mit diesem Namen existiert bereits."
#: src/Metrics/CustomMetricBuilder.php
msgid "Help text is required."
msgstr "Hilfetext ist erforderlich."
#: src/Metrics/CustomMetricBuilder.php
msgid "Invalid value type."
msgstr "Ungueltiger Werttyp."
#: src/Metrics/CustomMetricBuilder.php
msgid "Static value must be numeric."
msgstr "Statischer Wert muss numerisch sein."
#: src/Metrics/CustomMetricBuilder.php
msgid "Option name is required for option value type."
msgstr "Optionsname ist fuer den Options-Werttyp erforderlich."
#. translators: %d: Maximum number of labels
#: src/Metrics/CustomMetricBuilder.php
msgid "Maximum %d labels allowed."
msgstr "Maximal %d Labels erlaubt."
#: src/Metrics/CustomMetricBuilder.php
msgid "Invalid label name format."
msgstr "Ungueltiges Label-Namensformat."
#. translators: %d: Maximum number of label value combinations
#: src/Metrics/CustomMetricBuilder.php
msgid "Maximum %d label value combinations allowed."
msgstr "Maximal %d Label-Wert-Kombinationen erlaubt."
#: src/Metrics/CustomMetricBuilder.php
msgid "Invalid JSON format."
msgstr "Ungueltiges JSON-Format."
#: src/Metrics/CustomMetricBuilder.php
msgid "Invalid export format."
msgstr "Ungueltiges Export-Format."
#: src/Plugin.php
msgid "Settings"
msgstr "Einstellungen"

View File

@@ -2,7 +2,7 @@
# This file is distributed under the GPL v2 or later.
msgid ""
msgstr ""
"Project-Id-Version: WP Prometheus 0.2.0\n"
"Project-Id-Version: WP Prometheus 0.3.0\n"
"Report-Msgid-Bugs-To: https://src.bundespruefstelle.ch/magdev/wp-prometheus/issues\n"
"POT-Creation-Date: 2026-02-02T00:00:00+00:00\n"
"MIME-Version: 1.0\n"
@@ -28,6 +28,14 @@ msgstr ""
msgid "Help"
msgstr ""
#: src/Admin/Settings.php
msgid "Custom Metrics"
msgstr ""
#: src/Admin/Settings.php
msgid "Dashboards"
msgstr ""
#: src/Admin/Settings.php
msgid "License settings saved."
msgstr ""
@@ -210,6 +218,18 @@ msgstr ""
msgid "WooCommerce Customers (registered, guest)"
msgstr ""
#: src/Admin/Settings.php
msgid "Reset Runtime Metrics"
msgstr ""
#: src/Admin/Settings.php
msgid "Clear all accumulated runtime metric data."
msgstr ""
#: src/Admin/Settings.php
msgid "Reset Metrics"
msgstr ""
#: src/Admin/Settings.php
msgid "Prometheus Configuration"
msgstr ""
@@ -327,11 +347,249 @@ msgid "WooCommerce customers by type"
msgstr ""
#: src/Admin/Settings.php
msgid "Custom Metrics"
msgid "You can add custom metrics using the wp_prometheus_collect_metrics action:"
msgstr ""
#: src/Admin/Settings.php
msgid "You can add custom metrics using the wp_prometheus_collect_metrics action:"
msgid "Add Custom Metric"
msgstr ""
#: src/Admin/Settings.php
msgid "Edit Custom Metric"
msgstr ""
#: src/Admin/Settings.php
msgid "Metric Name"
msgstr ""
#: src/Admin/Settings.php
msgid "Must follow Prometheus naming conventions."
msgstr ""
#: src/Admin/Settings.php
msgid "Help Text"
msgstr ""
#: src/Admin/Settings.php
msgid "Description shown in Prometheus output."
msgstr ""
#: src/Admin/Settings.php
msgid "Value Type"
msgstr ""
#: src/Admin/Settings.php
msgid "Static Value"
msgstr ""
#: src/Admin/Settings.php
msgid "WordPress Option"
msgstr ""
#: src/Admin/Settings.php
msgid "Static Value:"
msgstr ""
#: src/Admin/Settings.php
msgid "Option Name:"
msgstr ""
#: src/Admin/Settings.php
msgid "The name of the WordPress option to read."
msgstr ""
#: src/Admin/Settings.php
msgid "Labels"
msgstr ""
#: src/Admin/Settings.php
msgid "Label name"
msgstr ""
#: src/Admin/Settings.php
msgid "Add Label"
msgstr ""
#: src/Admin/Settings.php
msgid "Label Values"
msgstr ""
#: src/Admin/Settings.php
msgid "Value"
msgstr ""
#: src/Admin/Settings.php
msgid "Add Value Row"
msgstr ""
#: src/Admin/Settings.php
msgid "Enabled"
msgstr ""
#: src/Admin/Settings.php
msgid "Save Metric"
msgstr ""
#: src/Admin/Settings.php
msgid "Cancel"
msgstr ""
#: src/Admin/Settings.php
msgid "Your Custom Metrics"
msgstr ""
#: src/Admin/Settings.php
msgid "Name"
msgstr ""
#: src/Admin/Settings.php
msgid "Status"
msgstr ""
#: src/Admin/Settings.php
msgid "Actions"
msgstr ""
#: src/Admin/Settings.php
msgid "Active"
msgstr ""
#: src/Admin/Settings.php
msgid "Inactive"
msgstr ""
#: src/Admin/Settings.php
msgid "Edit"
msgstr ""
#: src/Admin/Settings.php
msgid "Delete"
msgstr ""
#: src/Admin/Settings.php
msgid "No custom metrics defined yet."
msgstr ""
#: src/Admin/Settings.php
msgid "Export / Import"
msgstr ""
#: src/Admin/Settings.php
msgid "Export your custom metrics configuration for backup or transfer to another site."
msgstr ""
#: src/Admin/Settings.php
msgid "Export Metrics"
msgstr ""
#: src/Admin/Settings.php
msgid "Import Metrics"
msgstr ""
#: src/Admin/Settings.php
msgid "Import Options"
msgstr ""
#: src/Admin/Settings.php
msgid "Skip existing metrics"
msgstr ""
#: src/Admin/Settings.php
msgid "Overwrite existing metrics"
msgstr ""
#: src/Admin/Settings.php
msgid "Rename duplicates"
msgstr ""
#: src/Admin/Settings.php
msgid "Import"
msgstr ""
#: src/Admin/Settings.php
msgid "Grafana Dashboard Templates"
msgstr ""
#: src/Admin/Settings.php
msgid "Download pre-built Grafana dashboards for visualizing your WordPress metrics."
msgstr ""
#: src/Admin/Settings.php
msgid "Download"
msgstr ""
#: src/Admin/Settings.php
msgid "Import instructions:"
msgstr ""
#: src/Admin/Settings.php
msgid "Download the desired dashboard JSON file"
msgstr ""
#: src/Admin/Settings.php
msgid "In Grafana, go to Dashboards > Import"
msgstr ""
#: src/Admin/Settings.php
msgid "Upload the JSON file or paste its contents"
msgstr ""
#: src/Admin/Settings.php
msgid "Select your Prometheus data source"
msgstr ""
#: src/Admin/Settings.php
msgid "Click Import"
msgstr ""
#: src/Metrics/CustomMetricBuilder.php
msgid "Metric name is required."
msgstr ""
#: src/Metrics/CustomMetricBuilder.php
msgid "Invalid metric name format."
msgstr ""
#: src/Metrics/CustomMetricBuilder.php
msgid "A metric with this name already exists."
msgstr ""
#: src/Metrics/CustomMetricBuilder.php
msgid "Help text is required."
msgstr ""
#: src/Metrics/CustomMetricBuilder.php
msgid "Invalid value type."
msgstr ""
#: src/Metrics/CustomMetricBuilder.php
msgid "Static value must be numeric."
msgstr ""
#: src/Metrics/CustomMetricBuilder.php
msgid "Option name is required for option value type."
msgstr ""
#. translators: %d: Maximum number of labels
#: src/Metrics/CustomMetricBuilder.php
msgid "Maximum %d labels allowed."
msgstr ""
#: src/Metrics/CustomMetricBuilder.php
msgid "Invalid label name format."
msgstr ""
#. translators: %d: Maximum number of label value combinations
#: src/Metrics/CustomMetricBuilder.php
msgid "Maximum %d label value combinations allowed."
msgstr ""
#: src/Metrics/CustomMetricBuilder.php
msgid "Invalid JSON format."
msgstr ""
#: src/Metrics/CustomMetricBuilder.php
msgid "Invalid export format."
msgstr ""
#: src/Plugin.php