Style guide practices when adding metrics to logstash plugins
- Dominant language
- Java
- Stars
- 14.9k
- Forks
- 3.5k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 88
Description
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:
- Usage of similar vocabulary in terms of, singulars vs plurals.
- Same words for common terms, for example to name errors, etc.
- Provide uniform structure, so consumers will expect similar organization.
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
1. Dealing with errors happening during execution path.
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:
Contributor guide
Research direction
Start by reading issue #5607 and the metric patterns described here, especially the @metric_errors namespace example. Compare existing filter and output plugin metrics and review the discussion for agreement; done means an agreed style guide covering vocabulary, error naming, and metric structure.
Written by the indexing model from the issue text.
Assessment
- Domain
- observability
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100