gravitee-io / issues

Gravitee.io - API Platform - Issues
64 stars 26 forks source link

Disable analytics in Management API #945

Open lbovet opened 6 years ago

lbovet commented 6 years ago

Expected Behavior

There should be a way to disable the analytics in the Management API.

Current Behavior

When deploying without elasticsearch, there is an exception at startup (although things work further).

Possible Solution

Either by removing the analytics key from the configuration or adding an "enabled" property.

Context

There are setups where analytics are not required (e.g. internal APIs).

Your Environment

aelamrani commented 6 years ago

@lbovet why not just catch the exception at startup?

lbovet commented 6 years ago

Well, hiding the stacktrace makes the startup log less "ugly". However, it is still considered as an error. For setups where is it normal to not have analytics, we should have no error in the logs. We could consider logging it with warning level. The ultimate full solution is to let the users choose if it is an error or not, thus the idea of a configuration key because when we want analytics, we need to know at if the ES configuration is ok or not.

brasseld commented 6 years ago

An other option would be to remove the elasticsearch plugin from plugins directory.

lbovet commented 6 years ago

This is possible for the gateway (it is actually what I did), but not for the management api, since analytics seems to be a core feature.

brasseld commented 6 years ago

Hum... I had a try and no issue at all for me. What kind of problem you meet by removing this plugin ?

lbovet commented 6 years ago

Okay... Sorry, I thought I tried this as well and got some errors. Indeed, it starts without error. In the UI, the Logs/Analytics screens do not work, so their menu items could be hidden or the screen saying something like "No analytics plugin found", if we want to have a full support of the "without analytics" mode. We are in the details, now. This is less important because the "without analytics" setup is likely to be configured automatically and not in the UI. You can merge and close this issue and see, from your product point of view if you want the UI to be friendly in absence of analytics repository.

brasseld commented 6 years ago

No reason to merge this PR...

However, your point of view is correct, if no "analytics" plugin is installed, we must send an understandable message saying that No analytics plugin can be found instead of throwing error.

So, keeping this issue to work on this point...

gs11 commented 5 years ago

An enabled option for the Management API would be highly appreciated to make it Kubernetes-friendly. I guess the current workaround would be to remove the plugin from the folder upon pod startup but it would be much more of a hack than a proper solution.

frankkoornstra commented 1 year ago

Any chance this or this can get some TLC? There currently doesn't seem to be a way to run the API through Helm without having an actual ES cluster running.