-
Notifications
You must be signed in to change notification settings - Fork 4
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
Limit errorMessage length on metrics endpoint #29
Comments
Or use a list of strings separated by comma passed by environment. Other solution will be create an interface/Enum as parameter for message error besides string. |
I didn't get it. Could you please write an example? |
For example create a environment like this Then create a class that gets this list and put in some Map to be access with the key parameter. Or modify they method to add errorMessage to accept only Enum types, this will force to use only strings that will be create at build time. |
Could you exercise with some examples of messages, config and result, pls? |
Something like this to create a map from a environment String envs = "keyError1:Error in http request,keyError2:name incorrect,keyError3:invalid data";
Arrays.stream(envs.split(","))
.forEach(env -> map.put(env.split(":")[0].trim(), env.split(":" )[1].trim()));
map.get("keyError1"); |
On some of our deployments we had a problem with large error messages being used to notify errors because the /metrics endpoint starts to generate too much data on its output, specially if there are lots of different messages being tracked.
My proposal is to limit by default the maximum message output length to 50 chars in order to minimize accidental performance bottlenecks.
For example, the client do
In this case the related errorMessage will be "Some error is going on here, so please be patient|"
The ending "|" indicates that the message was truncated.
What do you think?
The text was updated successfully, but these errors were encountered: