Git Product home page Git Product logo

Comments (9)

carlpett avatar carlpett commented on May 27, 2024

Hi @mikenowak,
Thanks for the suggestion. I had a look, and it looks like it should be quite straightforward. Initially, I'd say we would only expose name and state, the other properties seem less useful. Do you agree about that?

from windows_exporter.

mikenowak avatar mikenowak commented on May 27, 2024

Hi @carlpett,

Agreed, yes - thats pretty much all that I am after.

from windows_exporter.

carlpett avatar carlpett commented on May 27, 2024

Alright, I have a working prototype now. Some choices made:

  • I went with the service name instead of the display name, which makes it somewhat less easy to parse (name="igfxcuiservice1.0.0.0"...), but I think there is no guarantee that a display name is unique.
  • I'm lower-casing everything
  • I expose the start_mode as a separate metric, which should make for easy alerting if something isn't in the state you want it to.

Example output:

# HELP wmi_service_start_mode The start mode of the service (StartMode)
# TYPE wmi_service_start_mode gauge
wmi_service_start_mode{name="aelookupsvc",start_mode="manual"} 1
wmi_service_start_mode{name="alg",start_mode="manual"} 1
wmi_service_start_mode{name="aphidmonitorservice",start_mode="auto"} 1
wmi_service_start_mode{name="appidsvc",start_mode="manual"} 1
[...]
# HELP wmi_service_state The state of the service (State)
# TYPE wmi_service_state gauge
wmi_service_state{name="aelookupsvc",state="running"} 1
wmi_service_state{name="alg",state="stopped"} 1
wmi_service_state{name="aphidmonitorservice",state="running"} 1
wmi_service_state{name="appidsvc",state="stopped"} 1

Looks ok?

from windows_exporter.

martinlindhe avatar martinlindhe commented on May 27, 2024

Hi @mikenowak and thanks for the suggestion. Our excellent @carlpett is already on the ball, reviewing his patch now!

from windows_exporter.

martinlindhe avatar martinlindhe commented on May 27, 2024

@mikenowak Could you give v0.1.3 a spin? We just pushed this release containing the service collector

from windows_exporter.

mikenowak avatar mikenowak commented on May 27, 2024

Good day @martinlindhe, @carlpett,

thank you for quick turnaround - truly outstanding!

I verified this to work on Win2013 R2 and Win2016 Server.

Here is one more question as my knowledge is incomplete because so far focused on gathering metrics rather than visualising data.

Is there any real benefit of the node_exporter approach (which exposes all the possible statuses for a given service and a gauge) versus solution implemented herein?

node_systemd_unit_state{name="syslog.service",state="activating"} 0
node_systemd_unit_state{name="syslog.service",state="active"} 0
node_systemd_unit_state{name="syslog.service",state="deactivating"} 0
node_systemd_unit_state{name="syslog.service",state="failed"} 0
node_systemd_unit_state{name="syslog.service",state="inactive"} 1

from windows_exporter.

carlpett avatar carlpett commented on May 27, 2024

@mikenowak It does not matter, as far as I am aware. Prometheus will consider any absent series as zero. However, the case could be made that it would be clearer to always expose all the series. It would also ensure that any other consumers of the endpoint (I'm aware of at least one other client) work the same, as I'm not sure if this is required behavior. I'll have a look at it.

from windows_exporter.

carlpett avatar carlpett commented on May 27, 2024

@mikenowak We merged an update which exposes all the states/start modes for clarity

from windows_exporter.

mikenowak avatar mikenowak commented on May 27, 2024

Thanks, confirmed to work as expected.

from windows_exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.