Socket
Socket
Sign inDemoInstall

@opencensus/core

Package Overview
Dependencies
10
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @opencensus/core

OpenCensus is a toolkit for collecting application performance and behavior data.


Version published
Weekly downloads
1.2M
decreased by-49.24%
Maintainers
3
Install size
2.92 MB
Created
Weekly downloads
 

Package description

What is @opencensus/core?

The @opencensus/core package is a set of libraries for collecting, processing, and exporting telemetry data (metrics and traces) for analysis to improve the performance and reliability of applications. It is part of the OpenCensus project, which aims to provide a single, high-quality telemetry collection framework across multiple languages.

What are @opencensus/core's main functionalities?

Tracing

This feature allows the collection and export of trace data, which helps in understanding the flow of requests through various services and in identifying bottlenecks and latency issues.

const { Tracing } = require('@opencensus/core');
const tracing = Tracing.instance;

// Configure tracing
tracing.start({samplingRate: 1});

// Create a custom span
const rootSpan = tracing.tracer.startRootSpan({name: 'main'}, rootSpan => {
  // Do work within the span
  rootSpan.end(); // End the span
});

Metrics

This feature enables the collection and aggregation of metrics data, such as counts or latencies, which can be used for monitoring application performance and health.

const { Metrics, MeasureUnit } = require('@opencensus/core');
const metrics = Metrics.instance;

// Create a measure
const requestCountMeasure = metrics.createMeasureInt64('request_count', MeasureUnit.UNIT, 'Count of requests received');

// Create and register a view to aggregate the data
metrics.createView('request_count_view', requestCountMeasure, 'count', [], 'The count of requests', []);

// Record data
metrics.record([{measure: requestCountMeasure, value: 1}]);

Other packages similar to @opencensus/core

Readme

Source

OpenCensus Core Node.js

Gitter chat

OpenCensus for Node.js is an implementation of OpenCensus, a toolkit for collecting application performance and behavior monitoring data.

The library is in alpha stage and the API is subject to change.

Please join gitter for help or feedback on this project.

Keywords

FAQs

Last updated on 02 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc