open-policy-agent / open-policy-agent/java-opa-sdk
SimpleMetrics.histogram() and counter() return null
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 16
- Forks
- 24
- Avg merge
- 8h 17m
- Merged PRs (30d)
- 15
Description
SimpleMetrics only implements Timer. histogram(String) and counter(String) return null, so any caller using those metric types NPEs. Implement both with java-idiomatic types, keeping the well-known metric names so decision-log output lines up with OPA's CLI.
- Implement
Counter(AtomicLong/LongAdderforaddandincr). - Implement
Histogramwith min/max/mean/stddev/median + configurable percentiles. - Backfill unit tests covering all three metric types.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading SimpleMetrics and its existing Timer implementation, then trace the counter(String) and histogram(String) entry points. Define the Counter and Histogram behavior from the issue, preserving the well-known metric names for OPA CLI decision-log output. Done means all three metric types work without null results and unit tests cover them, including configurable percentiles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100