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

Gson MetricsModule mirroring opa-jackson

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

Nobody has claimed this yet.

good first issue metrics
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 (or JsonSerializer) for Metrics.Timer and the other metric types.
  • Match the JSON shape produced by DecisionLogPlugin.
  • Tests in opa-gson parallel to opa-jackson/.../MetricsModuleTest.

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.