-
Notifications
You must be signed in to change notification settings - Fork 707
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 service cmd flag and custom labels, add process metric (process_gorup_count) add process custom labels #1194
Conversation
Why you are not using the relabel config for this? metric_relabel_configs:
- source_labels: [__name__, name]
regex: windows_service_state;windows_exporter
target_label: custom1
replacement: val1 |
It is easier for us to provide specific configuration datas for each hosts we have: they are generated using ansible and deployed with winRM module. |
11543a9
to
6ba0297
Compare
Can't understand why it was closed... |
Can we do same thing for process ? |
Of course it's possible with a little work, but it's useless unless the current PR is accepted! |
a2274d0
to
6ba0297
Compare
Signed-off-by: Peekjef72 <[email protected]>
Signed-off-by: Peekjef72 <[email protected]>
Signed-off-by: Peekjef72 <[email protected]>
I've rebased the code/branch for service collector. |
Signed-off-by: Peekjef72 <[email protected]>
Signed-off-by: Peekjef72 <[email protected]>
Hi, you can use the relabel feature of prometheus to set custom labels. It should be preferred over an custom logic in this exporter. |
Now imagine having 3 thousand hosts! I no longer share your point of view. Almost every server has its own configuration containing the processes and services to monitor. This configuration is contained in a file, generally generated by ansible from a CMDB (a windows_exporter file and a job part). In the proposed solution, you would therefore need to have a Prometheus configuration file with a gigantic relabel rule for the job containing the labels to be positioned by host and by service evaluated at each scrape for each host! To sum up:
|
Hi, I understand your case. In summarize grafana-agent is a better solution for you, since you could do relabeling on a local mache + you could eliminate your Prometheus configuration by enable the Remote Write Endpoint. Grafana Agent also has remote config capabilities which reduce the complexity on ansible to install only. That should work for 3000 hosts and that is what we do with approx. ~950 at the moment. The main purpose of windows-exporter is gathering metrics. Adding additional business logic like the process group increases the complexity. Gathering metrics under windows is already complex enough, since there are a lot API (WMI, perfcounter, Registry) to obverse. In any case, to continue here, merge conflicts needs to be resolved and custom labels and process group features should be separate pull requests. |
Thanks for the reply.
I am not sure to continue the development of the branch if there is no chance that the additions will one day be taken into account. |
replace previous PR PR#1180, PR#1185
This PR adds some feature to service collector: (see service)
the param will only be checked if services-where is not set.
the list will be used to build a service-where query based on Name and is equivalent to:
It allows to set any number of custom labels value for each service:
e.g.:
Use case: allow to build a generic Prometheus alert on not running service and to use the specified associated labels to drive a specific behavior. For me they are used to route for a specific documentation based on context.
Label's names must be identical for each service. Not identical labels names are removed !
This parameter as a lower priority than service-where and service-list.
It accepts a dict (see above example) or a list; in this case it behaves like services-list.
e.g.:
Then generic alert services:
This PR adds some feature to process collector:
It allows to defined "process group" and to set any number of custom labels value for each group:
e.g.: (see process)
the custom labels will be added to each windows_process_metrics
It also adds a metric named
windows_process_group_count
that count number of matching processes for each group:This metric should be used to define a generic alert if occurrence of the metric is equal to 0, instead of a specific alert absent(windows_process_handles{process="firefox"} == 1