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

Extension of the cloud::aws::apigateway::mode::requests and latency plugin with --api-gateway-type option to distinguish between REST, HTTP and WebSocket #4843

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

rmorandell-pgum
Copy link
Contributor

add possibility to change the dimension instance for the Api Gateway type. (REST, HTTP, WebSocket)

Description

Currently, the ApiGateway plugin always uses --api-name as a parameter. In the code, the dimension is fixed with ApiName.

image

This is working only for ApiGateways of type REST. But there is also HTTP or WebSocket.

Using this two types must be used ApiId and not ApiName for the dimension instance. Otherwise the plugin returns 0 for the metric (when --zeroed is set) because metric not found.

image

Fixes # (issue)

After my changes the value will be returned correctly.

perl centreon_plugins.pl --aws-secret-key=*** --aws-access-key=*** --custommode=paws --region=eu-central-1 --plugin=cloud::aws::apigateway::plugin --mode=latency --zeroed --api-gateway-type=HTTP --dimension-value=j5ebxxxx --filter-metric=

OK: 'j5ebxxxx' Statistic 'Sum' Metrics HTTP 5XX Errors: 0.00, HTTP 4XX Errors: 0.00, Client Requests: 3.00 | 'j5ebxxxx~sum#apigateway.requests.errors.5xx.count'=0.00;;;; 'j5ebxxxx~sum#apigateway.requests.errors.4xx.count'=0.00;;;; 'j5ebxxxx~sum#apigateway.requests.client.count'=3.00;;;;

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software

Target serie

  • 22.04.x
  • 22.10.x
  • 23.04.x
  • 23.10.x
  • 24.04.x (master)

How to test

Use a AWS ApiGateway of type HTTP and use --api-gateway-type=HTTP and --dimension-value=MyApiId
Use a AWS ApiGateway of type REST and use --api-gateway-type=REST and --dimension-value=MyApiName

Community contributors & Centreon team

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have rebased my development branch on the base branch (master, maintenance).

add possibility to change the dimension instance for the Api Gateway type. (REST, HTTP, WebSocket)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants