Skip to content
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

feat(inputs.icinga2): Support collecting hosts,services and endpoint metrics #12506

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

deric
Copy link
Contributor

@deric deric commented Jan 15, 2023

This PR adds possibility to collect both hosts and services metrics from Icinga 2 API at the same time. Furthermore it adds possibility to parse Icinga2 endpoint metrics. These metrics are crucial for evaluating bottlenecks in Icinga2 setup.

Currently only partial stats endpoints support:

  • /v1/status/ApiListener
  • /v1/status/CIB
  • /v1/status/IdoMysqlConnection
  • /v1/status/IdoPgsqlConnection

Test output:

> icinga2_status,component=CIB,host=test active_host_checks=4.483333333333333,active_host_checks_15min=3496,
active_host_checks_1min=269,active_host_checks_5min=1191,active_service_checks=620.85,
active_service_checks_15min=579580,active_service_checks_1min=37251,
active_service_checks_5min=192239,avg_execution_time=0.03036015721774434,
avg_latency=0.000002201153386722349,current_concurrent_checks=1,
current_pending_callbacks=0,max_execution_time=38.768075942993164,
max_latency=0.0030307769775390625,min_execution_time=0,
min_latency=0,num_hosts_acknowledged=0,num_hosts_down=0,
num_hosts_flapping=0,num_hosts_handled=0,num_hosts_in_downtime=0,
num_hosts_pending=0,num_hosts_problem=0,num_hosts_unreachable=0,
num_hosts_up=457,num_services_acknowledged=0,num_services_critical=58,
num_services_flapping=0,num_services_handled=0,num_services_in_downtime=0,
num_services_ok=114404,num_services_pending=1,num_services_problem=1189,
num_services_unknown=184,num_services_unreachable=0,num_services_warning=948,
passive_host_checks=0,passive_host_checks_15min=0,passive_host_checks_1min=0,
passive_host_checks_5min=0,passive_service_checks=0,passive_service_checks_15min=0,
passive_service_checks_1min=0,passive_service_checks_5min=0,remote_check_queue=0,
uptime=314454.3722131252 1673859991000000000
> icinga2_status,component=IdoPgsqlConnection,host=test pgsql_queries_15mins=588245,pgsql_queries_1min=38875,
pgsql_queries_5mins=195997,pgsql_queries_rate=647.9166666666666,
pgsql_query_queue_item_rate=1291.1333333333334,pgsql_query_queue_items=0 1673859991000000000

@telegraf-tiger telegraf-tiger bot added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Jan 15, 2023
@deric deric force-pushed the icinga2 branch 6 times, most recently from 7a2b35f to f67a024 Compare January 16, 2023 12:06
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to put a PR. I think the big things are 1) we have a deprecation framework that you should use and 2) the default values need to be consistent and documented.

Once you make some updates we can give it a more complete review

plugins/inputs/icinga2/README.md Outdated Show resolved Hide resolved
plugins/inputs/icinga2/README.md Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Show resolved Hide resolved
@deric deric force-pushed the icinga2 branch 5 times, most recently from 094cf3d to 89845d6 Compare January 18, 2023 08:21
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow-up, just some final small items.

plugins/inputs/deprecations.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/README.md Outdated Show resolved Hide resolved
plugins/inputs/icinga2/sample.conf Outdated Show resolved Hide resolved
@deric deric force-pushed the icinga2 branch 3 times, most recently from 56788b9 to 4a2d80c Compare January 18, 2023 14:33
@deric
Copy link
Contributor Author

deric commented Jan 18, 2023

@powersj Thanks, let me know if you need more changes. The CI failures should be unrelated.

Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@powersj powersj added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jan 18, 2023
Copy link
Contributor

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks quite nice @deric, however I do have a few comments. Can you please take a look?

plugins/inputs/icinga2/README.md Outdated Show resolved Hide resolved
plugins/inputs/icinga2/README.md Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/sample.conf Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2_test.go Outdated Show resolved Hide resolved
@Hipska Hipska removed the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jan 23, 2023
@deric deric force-pushed the icinga2 branch 3 times, most recently from 6cf407b to 4b01367 Compare January 23, 2023 09:56
plugins/inputs/icinga2/sample.conf Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2_test.go Outdated Show resolved Hide resolved
@deric
Copy link
Contributor Author

deric commented Jan 23, 2023

@srebhan @Hipska Thanks for review! Hopefully all issues have been addressed.

plugins/inputs/icinga2/icinga2.go Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2_test.go Outdated Show resolved Hide resolved
@deric deric force-pushed the icinga2 branch 2 times, most recently from e1f3200 to af1ff52 Compare January 23, 2023 17:34
@Hipska Hipska added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jan 24, 2023
Copy link
Contributor

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deric I do have two cosmetic suggestions/comments. Let me know if you want to apply those. Otherwise I will merge in about 7h...

plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
plugins/inputs/icinga2/icinga2.go Outdated Show resolved Hide resolved
@telegraf-tiger
Copy link
Contributor

Copy link
Contributor

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for your contribution @deric!

@srebhan srebhan merged commit d380995 into influxdata:master Jan 26, 2023
@srebhan srebhan added this to the v1.26.0 milestone Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants