Skip to content

feat(ponder-sdk): Ponder Indexing Metrics#1604

Merged
tk-o merged 9 commits intomainfrom
feat/ponder-metrics
Feb 5, 2026
Merged

feat(ponder-sdk): Ponder Indexing Metrics#1604
tk-o merged 9 commits intomainfrom
feat/ponder-metrics

Conversation

@tk-o
Copy link
Contributor

@tk-o tk-o commented Feb 4, 2026

Lite PR

Tip: Review docs on the ENSNode PR process

Summary

  • PonderClient in ponder-sdk was extended with the following methods:
    • health() allows running Ponder application healthcheck
    • metrics() allows fetching information about Ponder Indexing Metrics which include the following fields
      • application to capture relevant settings that Ponder application was initialized with
      • chains to describe indexing metrics for each indexed chain. Indexing metrics for each chain include:
        • check if indexing is realtime?
        • check if indexing has been completed?
        • total count of blocks to sync during backfill
        • the latest synced block reference (number, timestamp)

Why

  • Ponder SDK has to provide useful data model for ENSNode that isolates implementation details of Prometheus metrics (and related parsing requirements).
  • We need this "layer 1" set of abstractions to build more powerful abstractions for ENSIndexer integration.

Testing

  • I added unit tests, ran typechecks. All went well.

Notes for Reviewer (Optional)


Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.
  • Relevant changesets are included (or are not required)

Copilot AI review requested due to automatic review settings February 4, 2026 19:27
@changeset-bot
Copy link

changeset-bot bot commented Feb 4, 2026

🦋 Changeset detected

Latest commit: 19cd0b4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@ensnode/ponder-sdk Major
ensindexer Major
ensadmin Major
ensrainbow Major
ensapi Major
fallback-ensapi Major
@ensnode/datasources Major
@ensnode/ensrainbow-sdk Major
@ensnode/ponder-metadata Major
@ensnode/ensnode-schema Major
@ensnode/ensnode-react Major
@ensnode/ensnode-sdk Major
@ensnode/ponder-subgraph Major
@ensnode/shared-configs Major
@docs/ensnode Major
@docs/ensrainbow Major
@docs/mintlify Major
@namehash/ens-referrals Major
@namehash/namehash-ui Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
admin.ensnode.io Skipped Skipped Feb 5, 2026 8:14am
ensnode.io Skipped Skipped Feb 5, 2026 8:14am
ensrainbow.io Skipped Skipped Feb 5, 2026 8:14am

@tk-o
Copy link
Contributor Author

tk-o commented Feb 4, 2026

@greptile review

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

Warning

Rate limit exceeded

@tk-o has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Adds PonderClient.health() and PonderClient.metrics(), implements Prometheus exposition-text parsing and Ponder indexing metrics deserialization with Zod validation, introduces new types and mocks/tests, renames several exported schema identifiers, and bundles the Prometheus parser dependency.

Changes

Cohort / File(s) Summary
Package config
packages/ponder-sdk/package.json, packages/ponder-sdk/tsup.config.ts, .changeset/late-oranges-like.md
Adds runtime dependency parse-prometheus-text-format, marks it as bundled in tsup, and adds a changeset entry for the SDK bump.
Client & tests
packages/ponder-sdk/src/client.ts, packages/ponder-sdk/src/client.test.ts
Adds PonderClient.health() and PonderClient.metrics(); extensive tests for health/status/metrics covering valid and many invalid/error scenarios.
Prometheus parsing
packages/ponder-sdk/src/deserialize/prometheus-metrics-text.types.ts, packages/ponder-sdk/src/deserialize/prometheus-metrics-text.ts, packages/ponder-sdk/src/deserialize/prometheus-metrics.test.ts
New PrometheusMetrics parser and deserializePrometheusMetrics helper, ambient types for parse-prometheus-text-format, and unit tests for parsing/querying metrics.
Indexing metrics deserialization & mocks
packages/ponder-sdk/src/deserialize/indexing-metrics.ts, packages/ponder-sdk/src/deserialize/indexing-metrics.mock.ts
New deserializePonderIndexingMetrics that parses Prometheus text into a Map of per-chain metrics and validates invariants via Zod; includes multiple valid/invalid mock payloads for tests.
Chain ID string handling
packages/ponder-sdk/src/deserialize/chains.ts
Adds schemaChainIdString to validate chain IDs provided as strings and coerce to numeric schemaChainId.
Types / models
packages/ponder-sdk/src/indexing-metrics.ts, packages/ponder-sdk/src/deserialize/indexing-status.ts
Adds PonderIndexingMetrics, PonderApplicationSettings, ChainIndexingMetrics and updates indexing-status schemas to use renamed schema exports.
Schema renames across primitives
packages/ponder-sdk/src/numbers.ts, packages/ponder-sdk/src/time.ts, packages/ponder-sdk/src/blocks.ts, packages/ponder-sdk/src/chains.ts
Renames many exported schema identifiers (e.g., numberSchemaschemaNumber, unixTimestampSchemaschemaUnixTimestamp, blockNumberSchemaschemaBlockNumber, chainIdSchemaschemaChainId) and updates imports/usages.
Public API surface
packages/ponder-sdk/src/index.ts
Re-exports new indexing metrics/status modules so new types/deserializers are part of the package public API.

Sequence Diagram

sequenceDiagram
    participant Client as PonderClient
    participant Server as /metrics Endpoint
    participant Parser as PrometheusMetrics
    participant Validator as Zod Validator
    participant Output as PonderIndexingMetrics

    Client->>Server: GET /metrics
    Server-->>Client: Prometheus exposition text
    Client->>Parser: deserializePrometheusMetrics(text)
    Parser-->>Client: PrometheusMetrics instance
    Client->>Validator: deserializePonderIndexingMetrics(PrometheusMetrics)
    Validator-->>Output: validated PonderIndexingMetrics
    Output-->>Client: Promise<PonderIndexingMetrics>
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐇
I hopped through metrics, parsed each line,
Prometheus crumbs made structure fine,
Chains and timestamps held in map,
Health checks green — a joyful clap,
I nibble bugs and leave code bright.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(ponder-sdk): Ponder Indexing Metrics' clearly and concisely summarizes the main change: adding indexing metrics support to ponder-sdk.
Description check ✅ Passed The pull request description follows the template with all major sections complete: Summary clearly lists the new methods and their fields, Why explains the motivation, Testing confirms unit tests and typechecks were run, and the Pre-Review Checklist is fully marked.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/ponder-metrics

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 4, 2026

Greptile Overview

Greptile Summary

This PR extends the PonderClient with two new methods (health() and metrics()) to provide health checks and expose Ponder indexing metrics.

Key Changes:

  • Added health() method that calls /health endpoint to verify Ponder instance availability
  • Added metrics() method that fetches and deserializes Prometheus metrics from /metrics endpoint into a structured PonderIndexingMetrics object
  • Implemented PrometheusMetrics class for parsing Prometheus text format and querying metrics with helpful methods (getValue(), getLabel(), getLabels(), etc.)
  • Created comprehensive deserialization pipeline with Zod v4 validation that enforces:
    • At least one indexed chain must be present
    • Chain IDs must be valid positive integers
    • indexingCompleted and indexingRealtime cannot both be true simultaneously
    • All required Prometheus metrics are present
  • Renamed schemas across the codebase for consistency (e.g., chainIdSchemaschemaChainId, blockRefSchemaschemaBlockRef)
  • Added comprehensive test coverage including edge cases (empty responses, invalid chain IDs, conflicting metrics, malformed data)
  • Added type declarations for the parse-prometheus-text-format third-party library

Architecture:
The implementation provides a clean abstraction layer between raw Prometheus metrics and the application domain model, isolating ENSNode from Prometheus-specific parsing requirements.

Confidence Score: 5/5

Important Files Changed

Filename Overview
packages/ponder-sdk/src/client.ts Added health() and metrics() methods to PonderClient with proper error handling
packages/ponder-sdk/src/indexing-metrics.ts Defined type interfaces for PonderIndexingMetrics with comprehensive documentation
packages/ponder-sdk/src/deserialize/prometheus-metrics-text.ts Implemented PrometheusMetrics class for parsing and querying Prometheus metrics
packages/ponder-sdk/src/deserialize/indexing-metrics.ts Comprehensive deserialization with validation for Ponder indexing metrics
packages/ponder-sdk/src/client.test.ts Added comprehensive test coverage for health() and metrics() methods
packages/ponder-sdk/src/deserialize/prometheus-metrics.test.ts Added tests validating PrometheusMetrics parsing and querying functionality

Sequence Diagram

sequenceDiagram
    participant Client as Consumer
    participant PC as PonderClient
    participant API as Ponder API
    participant Parser as PrometheusMetrics
    participant Deserializer as deserializePonderIndexingMetrics
    participant Validator as Zod Schema

    Note over Client,Validator: health() method flow
    Client->>PC: health()
    PC->>API: GET /health
    alt response.ok
        API-->>PC: 200 OK
        PC-->>Client: void (success)
    else !response.ok
        API-->>PC: 503 Service Unavailable
        PC-->>Client: throw Error
    end

    Note over Client,Validator: metrics() method flow
    Client->>PC: metrics()
    PC->>API: GET /metrics
    alt response.ok
        API-->>PC: 200 OK (Prometheus text format)
        PC->>Deserializer: deserializePonderIndexingMetrics(responseText)
        Deserializer->>Parser: PrometheusMetrics.parse(text)
        Parser-->>Deserializer: PrometheusMetrics instance
        Deserializer->>Validator: Validate required metrics exist
        alt all required metrics present
            Validator->>Deserializer: Build unvalidated metrics object
            Deserializer->>Validator: Validate chains Map, appSettings
            Validator->>Validator: Check invariants (1+ chains, no conflicting states)
            alt validation passes
                Validator-->>Deserializer: PonderIndexingMetrics
                Deserializer-->>PC: PonderIndexingMetrics
                PC-->>Client: PonderIndexingMetrics
            else validation fails
                Validator-->>Deserializer: ZodError
                Deserializer-->>PC: throw Error (prettified)
                PC-->>Client: throw Error
            end
        else missing required metrics
            Validator-->>Deserializer: ZodError
            Deserializer-->>PC: throw Error
            PC-->>Client: throw Error
        end
    else !response.ok
        API-->>PC: 500 Internal Server Error
        PC-->>Client: throw Error
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the ponder-sdk package with new functionality to fetch and parse Ponder indexing metrics from a Ponder application's Prometheus /metrics endpoint.

Changes:

  • Added health() and metrics() methods to PonderClient for health checks and retrieving indexing metrics
  • Introduced PonderIndexingMetrics data model with application settings and per-chain indexing metrics
  • Implemented Prometheus text format parser to deserialize metrics into a structured format

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pnpm-lock.yaml Added parse-prometheus-text-format@1.1.1 dependency
packages/ponder-sdk/package.json Added parse-prometheus-text-format to dependencies
packages/ponder-sdk/tsup.config.ts Configured bundling to include parse-prometheus-text-format
packages/ponder-sdk/src/indexing-metrics.ts Defined TypeScript interfaces for Ponder indexing metrics data model
packages/ponder-sdk/src/deserialize/prometheus-metrics-text.types.ts Type definitions for external Prometheus parsing library
packages/ponder-sdk/src/deserialize/prometheus-metrics-text.ts Prometheus metrics parser with query methods for extracting metric values and labels
packages/ponder-sdk/src/deserialize/prometheus-metrics.test.ts Unit tests for Prometheus metrics parser
packages/ponder-sdk/src/deserialize/indexing-metrics.ts Deserialization and validation logic for Ponder indexing metrics with Zod schemas
packages/ponder-sdk/src/deserialize/indexing-metrics.mock.ts Mock data for testing valid and invalid indexing metrics responses
packages/ponder-sdk/src/deserialize/chains.ts Chain ID deserialization helper
packages/ponder-sdk/src/client.ts Added health() and metrics() methods to PonderClient
packages/ponder-sdk/src/client.test.ts Tests for new client methods including validation and error handling
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@packages/ponder-sdk/src/deserialize/indexing-metrics.ts`:
- Around line 170-173: Update the function signature of
deserializePonderIndexingMetrics to accept a single unknown parameter (replace
`string | unknown` with `unknown`) and keep the existing runtime type check `if
(typeof data !== "string") { ... }` and error message intact; this simplifies
the type annotation while preserving the explicit validation inside the
function.

In `@packages/ponder-sdk/src/deserialize/prometheus-metrics-text.types.ts`:
- Around line 1-16: The current PrometheusMetric declaration is too narrow (only
{ value, labels? }) and misses Histogram and Summary shapes; introduce a
MetricEntry discriminated union and tighten PrometheusMetric.type to the literal
union ("GAUGE" | "COUNTER" | "HISTOGRAM" | "SUMMARY" | "UNTYPED"), then replace
PrometheusMetric.metrics: Array<{...}> with metrics: MetricEntry[] so histogram
entries ({ buckets, count, sum, labels? }) and summary entries ({ quantiles,
count, sum, labels? }) are represented alongside value-style entries; keep the
exported parsePrometheusTextFormat signature as-is but update the types
accordingly.

@vercel vercel bot temporarily deployed to Preview – ensrainbow.io February 4, 2026 19:37 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io February 4, 2026 19:37 Inactive
@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io February 4, 2026 19:37 Inactive
Copy link
Contributor Author

@tk-o tk-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review completed.

@@ -0,0 +1,204 @@
/**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has been moved from packages/ponder-metadata/src/prometheus-metrics.ts.

@@ -0,0 +1,82 @@
import { describe, expect, it } from "vitest";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has been moved from packages/ponder-metadata/src/prometheus-metrics.test.ts.

@@ -0,0 +1,16 @@
/**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has been moved from packages/ponder-metadata/src/types/parse-prometheus-text-format.ts.

* @returns Unvalidated (possibly incomplete) Ponder Indexing Metrics
* to be validated with {@link schemaSerializedPonderIndexingMetrics}.
*/
function buildUnvalidatedPonderIndexingMetrics(metricsText: string): unknown {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use unknown type to highlight that the returned object is unpredictable in terms of fields it's going to contain. The buildUnvalidatedPonderIndexingMetrics is implementation detail of schemaSerializedPonderIndexingMetrics, which ultimately validates the unvalidated Ponder Indexing Metrics object.

.getLabels("ponder_sync_block", "chain")
.map((chainIdString) => deserializeChainIdString(chainIdString));

const chains = new Map<ChainId, unknown>();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, the unknown type let us avoid fighting TS compiler which wants us to declare a type for all possible partial outcomes.

dts: true,
clean: true,
external: ["zod/*"], // Mark peer dependencies as external
noExternal: ["parse-prometheus-text-format"],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need the parse-prometheus-text-format dependency to be included in the output bundle for the Ponder SDK package.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 4, 2026 19:40
@vercel vercel bot temporarily deployed to Preview – ensnode.io February 4, 2026 19:40 Inactive
@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io February 4, 2026 19:40 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io February 4, 2026 19:40 Inactive
@tk-o tk-o marked this pull request as ready for review February 4, 2026 19:42
@tk-o tk-o requested a review from a team as a code owner February 4, 2026 19:42
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@packages/ponder-sdk/src/deserialize/indexing-metrics.ts`:
- Around line 170-179: The deserializePonderIndexingMetrics function currently
calls schemaSerializedPonderIndexingMetrics.safeParse(data) but preprocessors
(PrometheusMetrics.parse and deserializeChainIdString) can throw outside
safeParse; wrap the safeParse invocation in a try-catch so any thrown exception
is caught, convert the caught error into a normalized message using
prettifyError (or include the error message) and rethrow a single Error with the
existing `Invalid serialized Ponder Indexing Metrics: ...` format; keep
references to deserializePonderIndexingMetrics,
schemaSerializedPonderIndexingMetrics, PrometheusMetrics.parse,
deserializeChainIdString, and prettifyError to locate the change.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tk-o Nice work on this PR. Some small feedback. Please take the lead to merge when ready 👍

/**
* Ordering strategy for onchain data used during indexing.
*/
ordering: "omnichain";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding a comment here about how support for other Ponder indexing strategies is planned for the future.

/**
* Ponder Application Settings
*
* Represents the application-level settings for Ponder application.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Represents the application-level settings for Ponder application.
* Represents the application-level settings for a Ponder app.

/**
* Chain Indexing Metrics
*
* Represents the indexing metrics for a specific chain indexed by Ponder application.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Represents the indexing metrics for a specific chain indexed by Ponder application.
* Represents the indexing metrics for a specific chain indexed by a Ponder app.

*/
interface ChainIndexingMetrics {
/**
* Number of blocks required to be synced during backfill.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Number of blocks required to be synced during backfill.
* Number of blocks required to be synced to complete the backfill phase of indexing.

It would also help if you could clarify some things here more in comments. For example, as I understand the Ponder config defines the start block in the range that is used to calculate this value. For the end block in the range that is used to calculate this value: how / when is it calculated? Does it change across time for an active Ponder instance? What happens to this value after backfill is completed but then the Ponder app is restarted? When it restarts how then is this value calculated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do 👍

/**
* Settings related to how the Ponder application is configured to index onchain data.
*/
application: PonderApplicationSettings;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
application: PonderApplicationSettings;
appSettings: PonderApplicationSettings;

/**
* Schema representing settings of a Ponder app.
*/
const schemaSerializedApplicationSettings = z.object({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an easy way to avoid passing arrays of hardcoded strings into the z.enum calls here? Can we pass the existing definitions you created in a different file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, will define "const enums" for those and import the values from business layer.

Copilot AI review requested due to automatic review settings February 5, 2026 07:59
@vercel vercel bot temporarily deployed to Preview – ensnode.io February 5, 2026 07:59 Inactive
@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io February 5, 2026 07:59 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io February 5, 2026 07:59 Inactive
@tk-o
Copy link
Contributor Author

tk-o commented Feb 5, 2026

@greptile review

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@packages/ponder-sdk/src/client.test.ts`:
- Around line 101-158: The two tests ("should handle invalid Ponder application
settings in the response" and "should handle metrics using non-int chain names
in the response") nest assertions inside catch blocks so they silently pass if
PonderClient.metrics() does not throw; change each to use the same pattern as
the earlier test: call const ponderClient = new PonderClient(new
URL("http://localhost:3000")); then await
expect(ponderClient.metrics()).rejects.toThrowError() (and assert the specific
substrings/regexes you currently check for), or otherwise capture the thrown
error with await and assert its message outside a try/catch—apply this change to
both tests referencing PonderClient.metrics() and the existing expected error
messages.

In `@packages/ponder-sdk/src/deserialize/indexing-metrics.ts`:
- Around line 40-57: The backfillSyncBlocksTotal field in
schemaSerializedChainIndexingMetrics currently uses schemaPositiveInteger which
disallows zero; change that field to use a non-negative integer schema (e.g.,
makeNonNegativeIntegerSchema() or the existing schema that permits zero) so zero
values are accepted during deserialization, and add the corresponding import if
missing; update the schemaSerializedChainIndexingMetrics definition to reference
the non-negative integer validator for backfillSyncBlocksTotal.

In `@packages/ponder-sdk/src/indexing-metrics.ts`:
- Around line 58-62: Fix the doc typo in the backfill metric comment: locate the
comment that starts "Number of blocks required to be synced to complete the
backfill phase of indexing." and replace the phrase "calculated determined by
Ponder" with a single correct wording such as "calculated by Ponder" (or
"determined by Ponder") so the sentence reads "...This value is calculated by
Ponder at the time the backfill starts." Ensure the updated comment is applied
to the same metric/documentation block.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io February 5, 2026 08:08 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io February 5, 2026 08:08 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io February 5, 2026 08:08 Inactive
Copilot AI review requested due to automatic review settings February 5, 2026 08:14
@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io February 5, 2026 08:14 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io February 5, 2026 08:14 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io February 5, 2026 08:14 Inactive
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tk-o tk-o merged commit eec37a7 into main Feb 5, 2026
22 checks passed
@tk-o tk-o deleted the feat/ponder-metrics branch February 5, 2026 08:26
@github-actions github-actions bot mentioned this pull request Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants