elastic / elastic/logstash

Style guide practices when adding metrics to logstash plugins

Open
#5,716 10 comments 0 reactions 0 assignees View on GitHub
design discuss monitoring
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:

aa6c8e48-4e9a-11e6-80a6-ab60a918403e

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.