-
Notifications
You must be signed in to change notification settings - Fork 6
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 support for generating metrics #4
Comments
Straw Proposal
|
References: Relevant queries from the Sumo Logic process dashboard(s):
|
So... since this uses a field named field.. should i make this a sumologic-compat flag? |
Also for reference: |
Development branch pushed... here's initial implementation output: $ ./sensu-processes-check -s '[{"search_string":"sensu", "full_cmdline" : true }]'
# OK | 1 >= 1 (found >= required) evaluated true for "sensu"
# Status - OK
# HELP procstat SumoLogic Compatibility
# TYPE procstat gauge
procstat{field="cpu_usage",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu"} 0.7501450595132637 1646347704969 This should be compatible with the first SumoLogic metric query:
|
All SumoLogic metric queries referencing Note: some metrics require privileged access. IThese metrics will be silently ignored if the executable cannot access them. |
Okay SumoLogic metric queries referencing $ ./sensu-processes-check -s '[{"search_string":"sensu", "full_cmdline" : true }]'
# OK | 1 >= 1 (found >= required) evaluated true for "sensu"
# Status - OK
# HELP processes SumoLogic Dashboard Compatible Cumulative Process Metrics
# TYPE processes gauge
processes{field="total",host.name="carbon",units="count"} 1 1646355921928
processes{field="total_threads",host.name="carbon",units="count"} 14 1646355921928
processes{field="parked",host.name="carbon",units="count"} 0 1646355921928
processes{field="wait",host.name="carbon",units="count"} 0 1646355921928
processes{field="zombies",host.name="carbon",units="count"} 0 1646355921928
processes{field="running",host.name="carbon",units="count"} 0 1646355921928
processes{field="sleeping",host.name="carbon",units="count"} 1 1646355921928
processes{field="unknown",host.name="carbon",units="count"} 0 1646355921928
processes{field="blocked",host.name="carbon",units="count"} 0 1646355921928
processes{field="dead",host.name="carbon",units="count"} 0 1646355921928
processes{field="stopped",host.name="carbon",units="count"} 0 1646355921928
processes{field="idle",host.name="carbon",units="count"} 0 1646355921928
processes{field="unexpected",host.name="carbon",units="count"} 0 1646355921928
# HELP procstat SumoLogic Dashboard Compatible Per Process Metrics
# TYPE procstat gauge
procstat{field="cpu_usage",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="percent"} 0.8524630207020176 1646355921928
procstat{field="memory_usage",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="percent"} 0.7666301131248474 1646355921928
procstat{field="memory_rss",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="bytes"} 1.25980672e+08 1646355921928
procstat{field="memory_vms",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="bytes"} 6.205018112e+09 1646355921928
procstat{field="memory_swap",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="bytes"} 0 1646355921928
procstat{field="memory_data",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="bytes"} 0 1646355921928
procstat{field="memory_stack",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="bytes"} 0 1646355921928
procstat{field="memory_locked",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="bytes"} 0 1646355921928
procstat{field="created_at",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="nanoseconds"} 1.646275163e+18 1646355921928
procstat{field="num_fds",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="count"} 0 1646355921928
procstat{field="num_threads",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="count"} 1.4e+07 1646355921928
procstat{field="major_faults",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="count"} 1042 1646355921928
procstat{field="minor_faults",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="count"} 37969 1646355921928
procstat{field="child_major_faults",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="count"} 0 1646355921928
procstat{field="child_minor_faults",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="count"} 314065 1646355921928
procstat{field="involuntary_context_switches",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="count"} 9416 1646355921928
procstat{field="voluntary_context_switches",host.name="carbon",process.executable.name="sensu-backend",search_string="sensu",units="count"} 864533 1646355921928
|
@jspaleta @calebhailey noting that the request in this internal ref may be related to this. However, the need appears to be such that they want to alert on if a named process is using more than X% CPU. While the metrics above would go part way to solving the request in the internal ref, we'd still need to add a status component, if that's even a possibility. |
No description provided.
The text was updated successfully, but these errors were encountered: