Files
o11y/pkg/modules/sentry/implsentry/dsn.go
T
zeekay f4b78d6371 docs: name the thing instead of calling it a door
One word stood for several: the MCP server, one address that accepts requests,
the single way in, and the boundary a credential is validated at. Doc comments
here are lifted into OpenAPI descriptions and republished on docs.hanzo.ai, so
the ambiguity was reaching customers.

Each site now names its own sense — endpoint, entry point, the MCP server, the
edge, address — or takes the word the surrounding code already uses.

Comments and prose strings only. Identifiers keep their names, including the doc
comments that must open with the identifier they document. go build ./... passes.
2026-08-23 14:47:23 -07:00

27 lines
1.2 KiB
Go

package implsentry
import (
"github.com/hanzoai/o11y/pkg/modules/errortracking/implerrortracking"
"github.com/hanzoai/o11y/pkg/valuer"
)
// mintDSN builds the DSN an operator hands to an app to report into a project. The
// key is the reused errortracking derivation keyed on the PROJECT id + version; the
// endpoint is the CLEAN Hanzo route — no /api/ segment:
//
// https://<version>:<hmac>@<host>/v1/event/<projectID>
//
// THE INGEST ADDRESS IS /v1/event, the same one the product event stream
// uses. @hanzo/event derives its ingest URL from the DSN's OWN path — base plus
// /envelope/ — so this line decides where every reporting client posts, and it is
// the one place the server states it.
//
// The product FACE — issues, projects, stats, traces, the reads a console makes —
// is /v1/o11y/sentinel. Ingest and face are different nouns and do not share a root:
// ingest is keyed by a DSN and answers a beacon, the face is keyed by a session
// and answers a person.
func mintDSN(secret []byte, host string, projectID valuer.UUID, version int) string {
key := implerrortracking.PublicKeyForVersion(secret, projectID.String(), version)
return "https://" + key + "@" + host + "/v1/event/" + projectID.String()
}