Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 2, 2025. It is now read-only.
NotificationsYou must be signed in to change notification settings

pydantic/nextjs-client-side-instrumentation

 
 

Repository files navigation

Moved to thelogfire-js monorepo

Example for a Next.js client/server distributed OTel instrumentation with Logfire

The example showcases how a fetch request initiated from the browser can propagate to the server and then to a third-party service, all while being instrumented with OpenTelemetry. The example uses the Logfire OTel SDK for both the client and server sides.

Highlights

  • TheClientInstrumentationProvider is a client-only component that instruments the browser fetch.
  • To avoid exposing the write token, the middleware.ts proxies the logfire/v1/traces request.
  • The instrumentation.ts file is the standard@vercel/otel setup.
  • The.env should look like this:
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://logfire-api.pydantic.dev/v1/tracesOTEL_EXPORTER_OTLP_METRICS_ENDPOINT=https://logfire-api.pydantic.dev/v1/metricsOTEL_EXPORTER_OTLP_HEADERS='Authorization=your-token'LOGFIRE_TOKEN='your-token'

NOTE: alternatively, if you're not sure about the connection between the client and the server, you can host the proxy at a different location (e.g. Cloudflare).

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript58.2%
  • CSS37.4%
  • JavaScript4.4%

[8]ページ先頭

©2009-2025 Movatter.jp