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

[reporter] [elasticsearch] Reporter should override canHandle(...) method #2320

Closed
VitalyShachkov opened this issue May 31, 2019 · 4 comments

Comments

2 participants
@VitalyShachkov
Copy link

commented May 31, 2019

We want to implement a custom Reporter & Reportable.
We don't want gravitee-reporter-elasticsearch to handle our custom Reportable, because it fails and prints a lot of errors to log.

Expected Behavior

gravitee-reporter-elasticsearch shoud ignore Reportable-s it can not handle.

Current Behavior

gravitee-reporter-elasticsearch tries to handle all Reportable-s it receives.

Possible Solution

gravitee-reporter-elasticsearch shoud override default method canHandle(...), that always returns "true" with:
@override
public boolean canHandle(Reportable reportable) {
return reportable instanceof Metrics ||
reportable instanceof EndpointStatus ||
reportable instanceof Monitor ||
reportable instanceof Log;
}

Steps to Reproduce (for bugs)

  1. Implement custom Reportable;
  2. Report it to reportService.

Context

We have implemented a custom Reporter & Reportable.
To use it were have to disable gravitee-reporter-elasticsearch.

Your Environment

  • Version used: 1.25.0
@brasseld

This comment has been minimized.

Copy link
Member

commented May 31, 2019

Hi @VitalyShachkov

Perhaps you can provide a PR ?

Also, can you tell me more about the custom reporter and reportable ?

@VitalyShachkov

This comment has been minimized.

Copy link
Author

commented Jun 3, 2019

Hi @brasseld
I have created the PR:
gravitee-io/gravitee-elasticsearch#53

About Reporter - it's just a custom reporter that logs into a custom logging system.
About Reportable - currently, there is no way to send results of policy execution to the Reporter.
But I am required to do this. A custom reportable surves for this purpose.

BTW, will be great if Metrics.Log will provide a way for policies to save some information into it.

@brasseld

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

Hi @VitalyShachkov

Just validated it, thanks !

About the ability to extend log, is it only for metrics log or request metrics ? Because metrics log mean that log must be enabled to store additional informations.

@brasseld

This comment has been minimized.

Copy link
Member

commented Jun 6, 2019

Hi @VitalyShachkov

BTW, will be great if Metrics.Log will provide a way for policies to save some information into it.

Please fill a new issue if you think it's a missing feature.

@brasseld brasseld closed this Jun 6, 2019

@brasseld brasseld changed the title gravitee-reporter-elasticsearch should override canHandle(...) method [reporter] [elasticsearch] Reporter should override canHandle(...) method Jun 6, 2019

@brasseld brasseld added this to the APIM - 1.27.0 milestone Jun 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.