Giter Site home page Giter Site logo

alvin-cheung / nextview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oslabs-beta/nextview

0.0 0.0 0.0 20.68 MB

NextView is an easy-to-use and lightweight toolkit for measuring performance of server-side rendering requests in your Next.js application

Home Page: https://www.nextview.dev

License: MIT License

Shell 0.05% JavaScript 8.87% TypeScript 88.06% CSS 2.59% HTML 0.43%

nextview's Introduction

NextView-banner-final-900x300

TypeScript JavaScript React Tailwind MUI Recharts Node Express PostgreSQL OpenTelemetry NextJS Vite Docker GitHubActions Husky Jest

Website LinkedIn npm Medium

NextView is a lightweight and user-friendly application designed to assist developers in optimizing the server performance of their Next.js applications. Our observability platform utilizes OpenTelemetry to trace and monitor crucial server metrics, stores the data in real time, and visualizes the time-series data in clear graphical representations on the NextView Dashboard. With easier data analysis, developers can swiftly identify bottlenecks and pinpoint areas that require server performance optimization, and thereby improve the efficiency of their applications.

Getting Started

  1. To get started, install our npm package in your Next.js application
npm i nextview-tracing
  1. In your next.config.js file, opt-in to the Next.js instrumentation by setting the experimental instrumentationHook to true
experimental.instrumentationHook = true;
  1. Navigate to the NextView Dashboard and copy your generated API key

  2. In the .env.local file in the root directory of your application (create one if it doesn’t exist), create an environment variable for your API Key

API_KEY=<Your-NextView-API-Key>
  1. Return to your NextView account and enter the Dashboard to see the metrics displayed!

Key Concepts in OpenTelemetry

Trace

The entire "path" of events that occurs when a request is made to an application. A trace is a collection of spans.

Span

A trace consists of spans, each of which represents an individual operation. A span contains information on the operation, such as request methods (get/post), start and end timestamps, status codes, and URL endpoints. NextView focuses on three main spans.

  • Client: The span is a request to some remote service, and does not complete until a response is received. It is usually the parent of a remote server span.
  • Server: The child of a remote client span that covers server-side handling of a remote request.
  • Internal: The span is an internal operation within an application that does not have remote parents or children.

Action

The term "action" in the NextView application refers to a child span within a trace. A single trace typically contains a parent span and one or more child spans. While the parent span represents the request to a particular page, the child spans represent the various actions that need to be completed before that request can be fulfilled.

For more details on OpenTelemetry, please read the documentation here.

User Guidelines

Overview Page

dashboard-overview

The NextView Dashboard automatically lands the Overview page that provides an overview of performance metrics for your entire Next.js application. Specific values can be seen by hovering over the graph.

Metrics displayed on the page include:

  • Average page load duration (in milliseconds)
  • Total number of traces
  • Average span load duration
  • Top 5 slowest pages
  • Average duration of operations by span kind (in milliseconds) over time

By default, the overview data covers the last 24 hours. You can modify the time period using the date and time selector located in the top right corner of the dashboard.

User's App Page(s)

Screenshot 2023-06-21 at 1 26 38 PM

On the left-hand sidebar, you will find a list of all the pages in your application. When selecting a specific page, you can view server performance metrics for that individual page.

Metrics displayed for each page include:

  • Average page load duration (in milliseconds)
  • Total number of traces
  • Details on each request (duration in milliseconds, number of traces, number of executions)
  • Average duration of actions (in milliseconds) over time

Contribution Guidelines

Contribution Method

We welcome your contributions to the NextView product!

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/newFeature) and create your new feature
  3. Commit your changes (git commit -m 'Added [new-feature-description]')
  4. Push to the branch (git push origin feature/newFeature)
  5. Make a Pull Request
  6. The NextView Team will review the feature and approve!

Looking Ahead

Here’s a list of features being considered by our team:

  • Enable multiple applications to be added to a single user account
  • Incorporate additional OpenTelemetry instrumentation (Metrics and Logs) to visualize on the dashboard
    • NextView is currently collecting observability metrics and allows for default visualization via Prometheus. To access metrics, users can spin up the NextView custom collector via Docker: docker-compose up which will automatically route all metrics data to Prometheus at the default endpoint of localhost:9090
    • Incorporate metrics visualization in our own dashboard moving forward
  • Enable user to select time zone
  • Enhance security through change password functionality
  • Add comprehensive testing suite
  • Add a dark mode feature

Contributors

License

Distributed under the MIT License. See LICENSE for more information.

nextview's People

Contributors

scott-brasko avatar kinskiwu avatar eza16 avatar sjk06 avatar evramdawd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.