Skip to content

No metric distinguishes GraphQL from anything else #374

Open

Description

@Miracle656

Background

src/metrics.ts has no GraphQL metrics, and src/middleware/httpMetrics.ts
sees GraphQL as a single route: POST /graphql. So every GraphQL request looks
identical on the dashboard whatever it asked for, and getPrice traffic is
invisible — the resolver increments price_requests_total, which does not say
it came from GraphQL.

Once L188 prices GraphQL, "how much GraphQL traffic is there and what is it
asking for" becomes a revenue question, not just an operational one.

What to build

  • A counter of GraphQL operations by operation name and type (query,
    mutation, subscription).
  • A histogram of resolver duration by field, for the expensive fields at least.
  • A counter of GraphQL errors by category.
  • Keep label cardinality bounded. Operation names come from the client and
    are therefore unbounded — fold unknown names into one label value rather than
    creating a series per name.

Acceptance criteria

  • Operations are counted by name and type
  • Resolver duration is recorded for the database-backed fields
  • Errors are counted with a bounded set of categories
  • No client-supplied string becomes an unbounded label
  • Metrics appear on the existing /metrics endpoint

Drips Wave · Complexity: Easy · 100 points


Repo: Divinity-Labs/Lens. Node + TypeScript, Fastify, mercurius for
GraphQL at POST /graphql, Prisma on Postgres, Redis, Prometheus.

Run the tests: npm test. The tests are vitest, not jest. Running jest
here reports "66 suites, 0 tests" and means nothing. A single file is
npx vitest run src/__tests__/graphqlSubscription.test.ts.

Load test (prices) is already failing on main and has been for some
time. It is not your PR. Everything else should be green.

Read src/__tests__/graphqlSubscription.test.ts before you start. It is the
house pattern for testing this surface and it is good — it drives a real
subscription through a real server and asserts on what a client receives.

This service prices real assets on Stellar mainnet. A wrong number is worse
than a missing one, because the caller cannot tell.

Never elide an address, a contract id or a key in code, comments or test
fixtures. A previous batch shortened a contract id in an issue and five
contributors invented plausible-looking ids to fill the gap. Write it in full or
not at all.


Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk

Activity

  1. Ranjeet2063 commented on Oct 16, 2026

    @Ranjeet2063
    Contributor

    @Ranjeet2063 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Ready to ship immediately! Focus: Modern Frontend Architecture (React / Next.js / Tailwind) for "No metric distinguishes GraphQL from anything else". Plan: Develop modular, reusable UI components adhering to design tokens, strict TypeScript props, and responsive viewport guidelines. Guaranteed 100% green CI & test coverage. Zero hand-holding. SLA: clean PR in 1-2h. Track record: 166+ merged PRs in Web3 (OSS score 83, Top 2%).

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Ranjeet2063 to this issue.

  2. collins-uzu commented on Oct 16, 2026

    @collins-uzu

    @collins-uzu has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi, I’ve reviewed the issue and understand the requirements. I have the skills needed to work on it and would be happy to take it up. Please assign it to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @collins-uzu to this issue.

  3. DEV-CHIDIOFFICIAL commented on Oct 16, 2026

    @DEV-CHIDIOFFICIAL

    @DEV-CHIDIOFFICIAL has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I would like to work on this task

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @DEV-CHIDIOFFICIAL to this issue.

  4. drips-wave commented on Oct 16, 2026

    @drips-wave

    Congratulations, @AllysiadevOps! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @AllysiadevOps: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions