In Entwicklung Letztes Updateated:
Teilen:
Cloudways bietet verwaltetes Cloud-Hosting für Unternehmen jeder Größe zum Hosten einer Website oder komplexer Webanwendungen.

Haben Sie jemals eine ahnungslose Situation mit einem Anwendungsabsturz erlebt?

Hat Ihr Kunde Sie über den Ausfall von Diensten benachrichtigt?

Dies muss eine schwierige Situation sein. Im Laufe der Jahre hat sich NodeJS zu einem beliebten Produkt entwickelt JavaScript-Framework for rapid micro-service and API development. With workloads running on NodeJS, it becomes crucial to have the right monitoring for essential metrics.

Let’s explore the following Node.JS monitoring tools that will help you monitor the application and server performance and other metrics.

PM2

PM2 has been the most famous tool used by Rookie and expert developers to ensure that their applications are always live. PM2 is used for running live production workloads and monitoring them from CLI or web interface. You can install this as an NPM module.

PM2 is an enterprise-ready solution, that provides the following features out of the box.

  • Verwaltung mehrerer NodeJS-Anwendungen auf einem einzigen Server
  • Anwendung und Fehler Protokollverwaltung
  • Web interface integration for monitoring application health and metrics
  • Auto-Clustering für NodeJS-Anwendungen
  • Hot-Reload der Anwendung.
  • Unterstützung für Startskripte
  • Protokollieren Sie das Streaming auf einer Weboberfläche

Erste Schritte mit PM2

Stellen Sie sicher, dass Sie PM2 installiert haben NPM installed. To validate the installation and version of NPM, use the below command.

npm --version

Dieser Befehl sollte Ihnen die Version von NPM anzeigen, wenn es installiert ist.

Installieren Sie PM2 mit dem folgenden Befehl:

npm install -g pm2

Die globale Flagge -g will install and make the module available globally as a command. To start any application using PM2, Go to the folder containing the NodeJS project and run the below command:

pm2 start <start-filename> --name myapp

Der obige Befehl startet eine NodeJs-Anwendung unter Verwendung der im ersten Argument angegebenen Datei. Außerdem wird die Anwendung mit dem Namen benannt myapp. Bei der Ausführung der NodeJS-Anwendung mit pm2stellt sicher, dass der Dienst nicht ausfällt, und versucht in diesem Fall, die Anwendung automatisch neu zu starten.

To enable live monitoring on the web interface, you need to register hier. Once your keys are generated, you will be able to see the instructions on connecting PM2 on your server to the web interface.

Sematext

Sematext offers full-stack monitoring. Full-stack means you have complete visibility of your infrastructure and application availability & performance, metrics, logs, frontend user experience, health and performance of your APIs, SSL certificates usw.

Sematext has over 100 integrations, including NodeJS. Here are some of them:

  • Webserver - Nginx, Apache
  • Datenbank – MySQL, MariaDB, PostgreSQL, Redis
  • Container – Kubernetes, Docker, Rancher
  • Andere Sprachen – PHP, Scala, Python, Gehen, Java
  • AWS – EC2, ELB, S3, Aurora

Und vieles mehr…

KnotenJS monitorIng. hilft monitor latency, request rate, garbage collection, anomalies, workers, events, heartbeat, and more. You can visualize the data on a beautiful, readymade dashboard or create a custom one if needed.

Get notified when things are not okay through Slack, WebHooks, PageDuty, MS Teams, etc. Sematext offers an all-in-one comprehensive monitoring and logs analyzing solution. You can check the Demo das erleben platForm.

Better Uptime

Better Uptime ist modern monitoring service that combines Uptime monitoring-, Incident-Management- und Statusseiten in einem beautifulsorgfältig gestaltetes Produkt.

Die Einrichtung dauert 3 Minuten. Danach erhalten Sie einen Anruf, eine E-Mail oder Slack alert, whenever your Node.js app doesn’t work correctly or stops working completely. The main features are:

  • HTTP(s), Ping, API, SSL- und TLD-Ablauf, Cron-Job-Prüfungen
  • Unbegrenzte Anrufbenachrichtigungen
  • Einfache Bereitschaftsplanung
  • Screenshots und Fehlerprotokolle von Vorfällen
  • Slack, Mannschaften, Heroku, AWS und über 100 weitere Integrationen

Appmetrics

Appmetrics ist ein Open-Source-Projekt, das von IBM verwaltet und verwaltet wird. Das Projekt konzentriert sich auf die Bereitstellung der Barebones zum Sammeln hervorragender Anwendungsmetriken, die auf verschiedene Aktivitäten wie Datentransaktion, Netzwerkgeschwindigkeit, Datenbankabfrageleistung, CPU- und Speicherauslastung, Speicherbereinigung und andere verteilt sind.

Zusammenführen mit einem Plugin wie Appmetrics-Dash could provide an excellent web interface to monitor your applications.

You can use Appmetrics as a middleware to build your monitorAnwendungen.

Raygun

Raygun ist eine platform to manage and monitor application performance for multiple programming languages, including NodeJS. It helps you debug the issues in real time with crash logs, analyze the application code, and find the right point of error from the code itself.

Einige der Funktionen sind unten aufgeführt.

  • Bietet Live- und präzise Fehlerberichte
  • Unterstützt Full-Stack-Fehlerberichte
  • Real-time user session monitorIng.
  • Serverleistung monitoring and bottleneck detection realtime

Raygun is worth investing the time and money for mission-critical applications. It provides insights that can translate into great ROI.

Express Status Monitor

Express Status MonitorIng. is an open-source tool dedicated monitoring ExpressJS. It is a known fact that ExpressJS is the most popular web framework used in NodeJS.

As you can see in the above snapshot, you can monitor response time, request frequency, status code, CPU/memory utilization, and average load.

ClinicJS

Klinik.js is a library available to integrate with NodeJS applications to monitor and get critical performance parameters out of it. It is a combination of three main tools – Arzt, Bubbleprofi und Flamme. Each of these tools is used for different metrics monitoring.

ClinicJS Doktor

  • Sammeln Sie Gesundheits- und Heuristikkennzahlen
  • Inject probes in the application automatically
  • Stellen Sie eine grafische Oberfläche bereit, um die Anwendungsleistung und Live-Metriken anzuzeigen
  • Generate recommendations for optimizing applications

ClinicJS Bubbleprofi

  • Grundfläche bubble graphs describing internal application execution
  • Hilft Ihnen, die Fehler zu lokalisieren, indem Sie Diagramme zur Funktionsausführung anzeigen
  • Collects metrics using asynchronous hooks
  • Provides latency information between function calls

KlinikJS Flamme 

  • gewidmetated CPU metrics monitorIng.
  • Graphical UI for live monitoring CPU performance of the application
  • Generates flame graphs helping to identify maximum values hit by metrics
  • Bietet Einblick in die CPU-verbrauchenden Aktivitäten Ihrer Anwendung

Kommerzieller Support ist verfügbar, wenn Sie für Ihr Unternehmen benötigen.

AppSignal

AppSignal ist ein kommerzielles Produkt, das die automatische Instrumentierung für Node.js HTTP-Aufruf, Express, Next.js und Postgress bietet.

Um loszulegen, müssen Sie einen leichten AppSignal-Agenten auf dem Server installieren, der die erforderlichen Metriken sammelt. Auf hoher Ebene bewirkt es Folgendes.

  • Monitor Performance – find and fix the code or infrastructure, slowing down the application availability and performance.
  • Metriken - Visualisieren Sie im Dashboard, worauf es Ihnen ankommt.
  • Anomalie erkennen - Sie werden benachrichtigt, wenn die Dinge nicht Ihren Erwartungen entsprechen.
  • Monitor Server – don’t get another server monitoring software. You get all the standard resources metrics like CPU, Disk, Memory, Network, etc.

Prometheus + Grafana

Die Idee ist, zwei leistungsstarke Software zu kombinieren - Prometheus und Grafana.

Prometheus hat einen Client für Nodejs namens Abschlussball-Client, auf dem NodeJS-Server installiert, um die Metriken zu erfassen. Sie können Grafana dann auf demselben Server oder auf derselben Fernbedienung installieren, um die Metriken von Prometheus zur Visualisierung abzurufen.

Sie können entweder create a Grafana dashboard from scratch based on the requirement or leverage the following two.

Dazu müssen Sie beide Tools kennen. Wenn Sie Hilfe beim Prometheus-Lernen benötigen, lesen Sie dies Udemy natürlich.

Schlussfolgerung

Monitoring is often ignored yet very critical for application availability. With the cost of development being a crucial factor, tools that analyze code, monitor the performance, and provide an Einblick in Fehler, are sure of great worth. They save time and effort and help you meet SLAs by delivering a faster resolution to the client.

Teilen:
  • Abhishek Kothari
    Autor
    Abhishek ist ein Webentwickler mit vielfältigen Fähigkeiten in verschiedenen Webentwicklungstechnologien. Im Laufe seiner beruflichen Laufbahn hat er an zahlreichen Unternehmen mitgewirktrise-Anwendungen und verstand die technologische Architektur und…

Danke an unsere Sponsoren

Weitere großartige Lektüre zum Thema Entwicklung

Treiben Sie Ihr Geschäft an

Einige der Tools und Services, die Ihrem Unternehmen helfen grow.