-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Style guide practices when adding metrics to logstash plugins #5716
Comments
Style guide proposal:
|
@jordansissel excellent writes up, I will finish the review of the PR and update this issue also. I think we should name this as |
agreed, my though my preference is to call it a style guide, not best practices |
What are others' thoughts on this style guide I proposed a few comments above? |
+1. Looks good |
@jordansissel thanks for your feedback, will update the current PR's following your advices. I'm not sure about the naming you propose, but I guess I'm good with it, basic idea for me was to extrapolate similar patterns for all to follow, so I guess naming is ok 😸 . @ph what do you mean by
? curious to know more what you are thinking here. |
I've reread the plugins PR and I am +1 with your proposal @jordansissel.
We could add to the metric library normalization of keys and adding validation. edited for typos. |
Thanks for this @jordansissel. This style guide looks like good material to include within a general "Adding and Collecting New Plugin Metrics" section in the docs. |
@acchen97 ++. Target this for 5.0.0? |
++ added to 5.0 docs meta issue (#5148) to track. |
Hi,
during the work I've been doing lately on #5607 I've noticed a few patterns that might DRY'ed somehow in order to provide:
I'm sure as far as we get into adding more metrics to filters and outputs we will encounter patterns that might makes sense to uniform.
Patterns
For this I started creating a namespaced metric,
@metric_errors = metric.namespace(:errors)
that later on is used to track error situations like exceptions, for example. This makes all error situation be namespaced.example:
The text was updated successfully, but these errors were encountered: