-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Prometheus support v2 #342
base: master
Are you sure you want to change the base?
Add Prometheus support v2 #342
Commits on Aug 3, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 935fead - Browse repository at this point
Copy the full SHA 935feadView commit details -
Ignore JetBrains project files
If you open this project in GoLand, it will create a .idea/ directory which could have been tracked by Git.
Configuration menu - View commit details
-
Copy full SHA for f8ebc47 - Browse repository at this point
Copy the full SHA f8ebc47View commit details -
feat(prometheus): Remove Prometheusd and add global metrics
Some metrics are implemented in handler.go and scan.go. Each metrics is accessible via global variable. Helper method UpdateMeasurementMetric adds flexibility to updating specific measurement without hardcoding Prometheus Metric in certain places.
Configuration menu - View commit details
-
Copy full SHA for a7a6e25 - Browse repository at this point
Copy the full SHA a7a6e25View commit details -
Configuration menu - View commit details
-
Copy full SHA for a253643 - Browse repository at this point
Copy the full SHA a253643View commit details -
feat(prometheus): Refactor creation of Counter/Gauge options objects
When using newGaugeOpts/newCounterOpts, all objects will share the same namespace "mbmd"
Configuration menu - View commit details
-
Copy full SHA for 50bfbf1 - Browse repository at this point
Copy the full SHA 50bfbf1View commit details -
feat(prometheus): Implement approach of dynamically adding counters/g…
…auges of measurements Instead of creating a new counter/gauges for a measurement by hand, we simply just add a newly added measurement to the appropriate counterVeh/gaugesVeh map. This also means that everytime a new measurement in meters.Measurement is introduced, the maps in prometheus.go need to be updated as well.
Configuration menu - View commit details
-
Copy full SHA for 0116e2f - Browse repository at this point
Copy the full SHA 0116e2fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 817615e - Browse repository at this point
Copy the full SHA 817615eView commit details -
feat(prometheus): Delegate metric type storage to measurements.go
Instead of actively managing and storing each measurement in gauges and counters map respectively, in measurements.go, each entry in `iec` is assigned a PrometheusMetricType. When prometheus_metrics.Init is called, the appropriate prometheus.Metric will be initialized and will still be stored in gauges/counters map, but its content now dynamically changes based on meters.Measurements actually enum entries, making meters.Measurements the single instance of responsibility for handling metric types.
Configuration menu - View commit details
-
Copy full SHA for 4c6342d - Browse repository at this point
Copy the full SHA 4c6342dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 07bc41b - Browse repository at this point
Copy the full SHA 07bc41bView commit details -
Configuration menu - View commit details
-
Copy full SHA for d933f2e - Browse repository at this point
Copy the full SHA d933f2eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 81e11f7 - Browse repository at this point
Copy the full SHA 81e11f7View commit details -
feat(prometheus): Create measurement metrics for device manufacturers
Instead of creating only one instance of each Prometheus metric measurement, each metric will now differ in each device's manufacturer
Configuration menu - View commit details
-
Copy full SHA for eca3cff - Browse repository at this point
Copy the full SHA eca3cffView commit details -
Configuration menu - View commit details
-
Copy full SHA for bc1c5e8 - Browse repository at this point
Copy the full SHA bc1c5e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for deaa378 - Browse repository at this point
Copy the full SHA deaa378View commit details -
Configuration menu - View commit details
-
Copy full SHA for 958afc7 - Browse repository at this point
Copy the full SHA 958afc7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 229231d - Browse repository at this point
Copy the full SHA 229231dView commit details -
feat(prometheus): Add socket metrics and categorize static metrics
Each static metrics is now categorized by interface `collectable`. `collectable.Collect()` will be called when all static metrics are registered to the default Prometheus registry.
Configuration menu - View commit details
-
Copy full SHA for 1287bc3 - Browse repository at this point
Copy the full SHA 1287bc3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d24da7 - Browse repository at this point
Copy the full SHA 3d24da7View commit details -
Configuration menu - View commit details
-
Copy full SHA for c540b47 - Browse repository at this point
Copy the full SHA c540b47View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2706e30 - Browse repository at this point
Copy the full SHA 2706e30View commit details -
feat(prometheus): Change way of registering Prometheus metrics
When using `prometheus.MustRegister(...)`, the app will panic if a slice entry is nil. Meanwhile fail fast isn't bad, the stack trace doesn't provide enough/precise information about the panic. `prometheus.Register(prometheus.Collector)` however returns an error object which makes it much easier to troubleshoot metric registrations.
Configuration menu - View commit details
-
Copy full SHA for 6000a63 - Browse repository at this point
Copy the full SHA 6000a63View commit details -
Configuration menu - View commit details
-
Copy full SHA for 398b29b - Browse repository at this point
Copy the full SHA 398b29bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 69c2a5f - Browse repository at this point
Copy the full SHA 69c2a5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 72bbef7 - Browse repository at this point
Copy the full SHA 72bbef7View commit details -
Configuration menu - View commit details
-
Copy full SHA for fb942f7 - Browse repository at this point
Copy the full SHA fb942f7View commit details -
Configuration menu - View commit details
-
Copy full SHA for a9024f8 - Browse repository at this point
Copy the full SHA a9024f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9fa4317 - Browse repository at this point
Copy the full SHA 9fa4317View commit details -
feat(prometheus): Move subsystem name into label, no panic on register
Previously, log.Fatalf was used for logging if a metric registration to default Prometheus registry fails. However, I don't think there's a need to panic - logging should be enough
Configuration menu - View commit details
-
Copy full SHA for 5809ed2 - Browse repository at this point
Copy the full SHA 5809ed2View commit details -
feat(prometheus): Add generalized device info
Measurement labels are stripped to just serial_numbers as they can be accessed via Join with mbmd_device_info
Configuration menu - View commit details
-
Copy full SHA for b315eb9 - Browse repository at this point
Copy the full SHA b315eb9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d735c8 - Browse repository at this point
Copy the full SHA 8d735c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for b398b0a - Browse repository at this point
Copy the full SHA b398b0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c6153c - Browse repository at this point
Copy the full SHA 0c6153cView commit details -
feat(prometheus): Integrate device name (by config) for unique metric ID
If no device description is available, we cannot distinguish between all device structs which it makes also difficult to distinguish between metrics. Therefore I add the device name that the config specifies in order to make them "comparable"
Configuration menu - View commit details
-
Copy full SHA for 95114bc - Browse repository at this point
Copy the full SHA 95114bcView commit details -
feat(prometheus): Move SunSpec labels to name
As these metrics are SunSpec specific, we integrate them into Prometheus metrics name
Configuration menu - View commit details
-
Copy full SHA for 84d7062 - Browse repository at this point
Copy the full SHA 84d7062View commit details -
feat(prometheus): Change help texts and units' full names
Full names now use the plural form.
Configuration menu - View commit details
-
Copy full SHA for 331c3da - Browse repository at this point
Copy the full SHA 331c3daView commit details -
feat(prometheus): Add conversion funcs for unit
Add conversion funcs in order to display measurement values in units specifically set for Prometheus. Starting with this commit, Kilowatt-hours are converted to Joules.
Configuration menu - View commit details
-
Copy full SHA for 76bf539 - Browse repository at this point
Copy the full SHA 76bf539View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba20cc3 - Browse repository at this point
Copy the full SHA ba20cc3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4d2d07e - Browse repository at this point
Copy the full SHA 4d2d07eView commit details -
feat(prometheus): Change some metrics descriptions
This is purely a change of expressions
Configuration menu - View commit details
-
Copy full SHA for 8d758e7 - Browse repository at this point
Copy the full SHA 8d758e7View commit details -
feat(prometheus): Add device name label to Measurement metrics
This can be quite useful in case the serial number of the smart meter is missing
Configuration menu - View commit details
-
Copy full SHA for b1b4acf - Browse repository at this point
Copy the full SHA b1b4acfView commit details -
refactor(prometheus): Change some measurement names and their Prometh…
…eus names This also renames measurementOptions functions: - withPrometheusDescription -> withPrometheusHelpText - withGenericPrometheusDescription -> withGenericPrometheusHelpText - generatePrometheusDescription -> generatePrometheusHelpText
Configuration menu - View commit details
-
Copy full SHA for 9a1339b - Browse repository at this point
Copy the full SHA 9a1339bView commit details -
refactor(prometheus): Refactor conversion map to static function
Prometheus metrics are now automatically converted to a measurement's elementary unit.
Configuration menu - View commit details
-
Copy full SHA for 71c23f7 - Browse repository at this point
Copy the full SHA 71c23f7View commit details -
refactor(prometheus): Refactor unit logic and update measurement desc…
…riptions Unit stuff is now in a separate package called `units`. units.go has been completely refactored to use the functional options pattern as well.
Configuration menu - View commit details
-
Copy full SHA for f7b7d23 - Browse repository at this point
Copy the full SHA f7b7d23View commit details -
Configuration menu - View commit details
-
Copy full SHA for 91a515a - Browse repository at this point
Copy the full SHA 91a515aView commit details -
refactor(prometheus): Add Prometheus names for "String N Generation" …
…measurement Prometheus (partial) names: string_n_energy_generated
Configuration menu - View commit details
-
Copy full SHA for 703aaa2 - Browse repository at this point
Copy the full SHA 703aaa2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e30516 - Browse repository at this point
Copy the full SHA 0e30516View commit details -
cleanup(prometheus): Remove metrics in scan.go
Bus scan metrics are pointless as they're used for diagnosis purposes. As they're not registered and no REST is available, we can remove these metrics.
Configuration menu - View commit details
-
Copy full SHA for 63bdaea - Browse repository at this point
Copy the full SHA 63bdaeaView commit details -
refactor(prometheus): Rename prometheus_metrics package to simply pro…
…metheus Also removes debug message of printing all measurement names.
Configuration menu - View commit details
-
Copy full SHA for 9871692 - Browse repository at this point
Copy the full SHA 9871692View commit details -
feat(prometheus): Add custom collector for gauges and counters
This allows us to pass a measurement's timestamp and using setters on gauges.
Configuration menu - View commit details
-
Copy full SHA for 3ea5024 - Browse repository at this point
Copy the full SHA 3ea5024View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b795a1 - Browse repository at this point
Copy the full SHA 7b795a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for f7f8eb9 - Browse repository at this point
Copy the full SHA f7f8eb9View commit details -
Configuration menu - View commit details
-
Copy full SHA for f246cb4 - Browse repository at this point
Copy the full SHA f246cb4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 96880f3 - Browse repository at this point
Copy the full SHA 96880f3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 389ac76 - Browse repository at this point
Copy the full SHA 389ac76View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4de4f3f - Browse repository at this point
Copy the full SHA 4de4f3fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ef02f5c - Browse repository at this point
Copy the full SHA ef02f5cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0545de7 - Browse repository at this point
Copy the full SHA 0545de7View commit details -
Refactor prometheus integration
remove collectors for device, handlers, publishers and sockets as they are superfluous and uninteresting.
Configuration menu - View commit details
-
Copy full SHA for 827944a - Browse repository at this point
Copy the full SHA 827944aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b482bb - Browse repository at this point
Copy the full SHA 4b482bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2fd6481 - Browse repository at this point
Copy the full SHA 2fd6481View commit details -
Configuration menu - View commit details
-
Copy full SHA for b90471c - Browse repository at this point
Copy the full SHA b90471cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c5df405 - Browse repository at this point
Copy the full SHA c5df405View commit details -
Configuration menu - View commit details
-
Copy full SHA for fe1966b - Browse repository at this point
Copy the full SHA fe1966bView commit details -
Configuration menu - View commit details
-
Copy full SHA for b73f757 - Browse repository at this point
Copy the full SHA b73f757View commit details -
promtheus: change the structure of a measurement. move unit to label/val
reduces the name FQ name of measurement und moves the unit with its abbreviation into the label/value section.
Configuration menu - View commit details
-
Copy full SHA for 98e4cf3 - Browse repository at this point
Copy the full SHA 98e4cf3View commit details -
Configuration menu - View commit details
-
Copy full SHA for f0384f0 - Browse repository at this point
Copy the full SHA f0384f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba70d02 - Browse repository at this point
Copy the full SHA ba70d02View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0af4f49 - Browse repository at this point
Copy the full SHA 0af4f49View commit details -
Configuration menu - View commit details
-
Copy full SHA for 59db7aa - Browse repository at this point
Copy the full SHA 59db7aaView commit details -
Dockerfile: remove make install step
because contains code gen programs
Configuration menu - View commit details
-
Copy full SHA for 03f12d8 - Browse repository at this point
Copy the full SHA 03f12d8View commit details -
remove arithmetics of conversion kwh to joules
it does not make sense and make grafana implementation more difficult. Ot it's me ;-)
Configuration menu - View commit details
-
Copy full SHA for 5de63fb - Browse repository at this point
Copy the full SHA 5de63fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d8266a - Browse repository at this point
Copy the full SHA 7d8266aView commit details -
use direct map access instead of iterating over it.
Configuration menu - View commit details
-
Copy full SHA for 9fb0e7f - Browse repository at this point
Copy the full SHA 9fb0e7fView commit details -
Configuration menu - View commit details
-
Copy full SHA for d0f15dd - Browse repository at this point
Copy the full SHA d0f15ddView commit details -
MeasurementCounterCollector.Set check if current value is lower
than previous value, if set. if the current value is lower than we skip that value
Configuration menu - View commit details
-
Copy full SHA for af44c5a - Browse repository at this point
Copy the full SHA af44c5aView commit details -
Configuration menu - View commit details
-
Copy full SHA for af4e8bf - Browse repository at this point
Copy the full SHA af4e8bfView commit details