KittyCAD / machine-api

This API intends to provide a standardized local interface to any machines used for manufacturing physical things.
17 stars 3 forks source link

export prom metrics from the printer #121

Closed paultag closed 1 month ago

paultag commented 1 month ago

more work to be done, but this will poll the implemented machine(s) to export prom metrics about the health and status of the connected machine(s).

This has a ways to go, but it's a start. Going to try and build out good coverage for my printer and then see if I can sprint on the X1 next.

# HELP extruder_temperature_celsius Last temp of the extruder.
# TYPE extruder_temperature_celsius gauge
# UNIT extruder_temperature_celsius celsius
extruder_temperature_celsius{id="neptune"} 219.87
# HELP extruder_temperature_target_celsius Target temp of the extruder.
# TYPE extruder_temperature_target_celsius gauge
# UNIT extruder_temperature_target_celsius celsius
extruder_temperature_target_celsius{id="neptune"} 220.0
# HELP bed_temperature_celsius Last temp of the bed.
# TYPE bead_temperature_celsius gauge
# UNIT bead_temperature_celsius celsius
bed_temperature_celsius{id="neptune"} 60.2
# HELP bed_temperature_target_celsius Target temp of the bed.
# TYPE bed_temperature_target_celsius gauge
# UNIT bed_temperature_target_celsius celsius
bed_temperature_target_celsius{id="neptune"} 60.0
codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 10.28037% with 96 lines in your changes missing coverage. Please review.

Project coverage is 23.30%. Comparing base (6d2dcae) to head (217462b). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/bin/machine-api/cmd_serve.rs 0.00% 68 Missing :warning:
src/server/endpoints.rs 7.69% 12 Missing :warning:
src/server/raw.rs 0.00% 7 Missing :warning:
src/server/mod.rs 53.84% 6 Missing :warning:
src/moonraker/mod.rs 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #121 +/- ## ========================================== - Coverage 23.89% 23.30% -0.59% ========================================== Files 47 48 +1 Lines 2507 2609 +102 ========================================== + Hits 599 608 +9 - Misses 1908 2001 +93 ``` | [Flag](https://app.codecov.io/gh/KittyCAD/machine-api/pull/121/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=KittyCAD) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/KittyCAD/machine-api/pull/121/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=KittyCAD) | `23.30% <10.28%> (-0.59%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=KittyCAD#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

paultag commented 1 month ago

todo: remove autometrics

paultag commented 1 month ago

autometrics has been excised; will land when it's green - working locally against my printer