open-policy-agent / open-policy-agent/java-opa-sdk

SimpleMetrics.histogram() and counter() return null

Open
#60 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

evaluator metrics
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 / LongAdder for add and incr).
  • Implement Histogram with min/max/mean/stddev/median + configurable percentiles.
  • Backfill unit tests covering all three metric types.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.