open-policy-agent / open-policy-agent/java-opa-sdk
Gson MetricsModule mirroring opa-jackson
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 16
- Forks
- 24
- Avg merge
- 8h 17m
- Merged PRs (30d)
- 15
Description
opa-jackson has MetricsModule that serializes Metrics.Timer as the underlying Duration. opa-gson has no equivalent, so users on Gson get a default-bean serialization that diverges from OPA's timer_<name>_ns shape.
- Add a Gson
TypeAdapter(orJsonSerializer) forMetrics.Timerand the other metric types. - Match the JSON shape produced by
DecisionLogPlugin. - Tests in
opa-gsonparallel toopa-jackson/.../MetricsModuleTest.
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 comparing the existing opa-jackson MetricsModule with the opa-gson module and read DecisionLogPlugin for the expected metric JSON shape. Use opa-jackson/.../MetricsModuleTest as the model for parallel opa-gson tests. Done means Gson metric serialization matches the timer_ns shape and the relevant metric types are covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100