Skip to content

feat(pkg): add go-import page for metrics/exporters/gcp - #226

Merged
aryanmehrotra merged 1 commit into
mainfrom
fix/go-import-gcp-metrics-exporter
Sep 1, 2026
Merged

aryanmehrotra merged 1 commit into
mainfrom
fix/go-import-gcp-metrics-exporter

Conversation

@aryanmehrotra

Copy link
Copy Markdown
Member

What

Adds the missing vanity-import route for gofr.dev/pkg/gofr/metrics/exporters/gcp.

Why

That path is its own Go module in the gofr repo, but it cannot be fetched from outside the repository — the vanity server returns 404 with no go-import meta tag, so resolution fails before the module's tags are ever consulted:

$ curl -s -o /dev/null -w '%{http_code}\n' 'https://gofr.dev/pkg/gofr/metrics/exporters/gcp?go-get=1'
404

$ curl https://proxy.golang.org/gofr.dev/pkg/gofr/metrics/exporters/gcp/@v/list
not found: unrecognized import path "gofr.dev/pkg/gofr/metrics/exporters/gcp":
reading https://gofr.dev/pkg/gofr/metrics/exporters/gcp?go-get=1: 404 Not Found

Every route under src/app/pkg is hand-written, and the tree only ever covered pkg/gofr/datasource/*. The metrics tree does not exist at all, so /pkg/gofr/metrics, /pkg/gofr/metrics/exporters and the module path itself all 404.

Approach

Identical to #222 (cloudsql, influxdb, kv-store/dynamodb) and #205 (azure):

  • layout.jsx — carries the go-import / go-source metadata. Byte-identical to the existing datasource layouts (verified with diff against cloudsql/layout.jsx).
  • page.jsx — a PkgRedirect page, so the route actually renders and returns 200. A layout.jsx on its own is not a route in the App Router and would still 404.

docsPath points at /docs/references/configs, which is where METRICS_EXPORTER=gcp is documented. The custom-metrics guide does not mention the exporter.

Verification

Structural clone of a pattern already deployed and working; I did not run a local next build (the prebuild step makes live GitHub calls). Post-merge check:

curl -s -o /dev/null -w '%{http_code}\n' 'https://gofr.dev/pkg/gofr/metrics/exporters/gcp?go-get=1'   # expect 200

Note — this is one half of the fix

Ref gofr-dev/gofr#4112. The module has also never been tagged: the batch of 26 submodule tags was cut at 285d3d2ec (the merge of gofr#3928, the PR that fixed this exporter's go.mod) and covered pkg/gofr/datasource/* only.

This PR must land and deploy first — a tag is useless while the meta lookup 404s. The tag pkg/gofr/metrics/exporters/gcp/v0.1.0 then needs pushing on the gofr repo separately.

`gofr.dev/pkg/gofr/metrics/exporters/gcp` is its own Go module, but the
vanity path served no go-import meta tag, so resolution failed with 404
before the module's tags were ever consulted:

    $ curl -s -o /dev/null -w '%{http_code}\n' \
        'https://gofr.dev/pkg/gofr/metrics/exporters/gcp?go-get=1'
    404

Every route under src/app/pkg is hand-written, and the tree only covered
pkg/gofr/datasource/*. The metrics tree was never added, so no exporter
submodule could be fetched from outside the repo.

Same shape as #222 (cloudsql, influxdb, kv-store/dynamodb): a layout.jsx
carrying the go-import/go-source metadata and a PkgRedirect page. The
layout is byte-identical to the existing datasource ones; the page points
at /docs/references/configs, which is where METRICS_EXPORTER=gcp is
actually documented.

Unblocks gofr-dev/gofr#4112. The module tag still has to be cut
separately on the gofr repo.
@aryanmehrotra
aryanmehrotra merged commit 5b5a877 into main Sep 1, 2026
4 checks passed
@aryanmehrotra
aryanmehrotra deleted the fix/go-import-gcp-metrics-exporter branch September 1, 2026 11:14
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.

1 participant