npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@opentelemetry/api-events

v0.53.0

Published

Public events API for OpenTelemetry

Downloads

7,153

Readme

OpenTelemetry API for JavaScript

NPM Published Version Apache License

This package provides everything needed to interact with the unstable OpenTelemetry Events API, including all TypeScript interfaces, enums, and no-op implementations. It is intended for use both on the server and in the browser.

Beta Software - Use at your own risk

The events API is considered alpha software and there is no guarantee of stability or long-term support. When the API is stabilized, it will be made available and supported long-term in the @opentelemetry/api package and this package will be deprecated.

Quick Start

Purposefully left blank until SDK is available.

Version Compatibility

Because the npm installer and node module resolution algorithm could potentially allow two or more copies of any given package to exist within the same node_modules structure, the OpenTelemetry API takes advantage of a variable on the global object to store the global API. When an API method in the API package is called, it checks if this global API exists and proxies calls to it if and only if it is a compatible API version. This means if a package has a dependency on an OpenTelemetry API version which is not compatible with the API used by the end user, the package will receive a no-op implementation of the API.

Advanced Use

API Methods

If you are writing an instrumentation library, or prefer to call the API methods directly rather than using the register method on the Tracer/Meter/Logger Provider, OpenTelemetry provides direct access to the underlying API methods through the @opentelemetry/api-events package. API entry points are defined as global singleton objects trace, metrics, logs, events, propagation, and context which contain methods used to initialize SDK implementations and acquire resources from the API.

const api = require("@opentelemetry/api-events");

/* A specific implementation of EventLoggerProvider comes from an SDK */
const eventLoggerProvider = createEventLoggerProvider();

/* Initialize EventLoggerProvider */
api.events.setGlobalEventLoggerProvider(eventLoggerProvider);
/* returns eventLoggerProvider (no-op if a working provider has not been initialized) */
api.events.getEventLoggerProvider();
/* returns an event logger from the registered global event logger provider (no-op if a working provider has not been initialized) */
const eventLogger = api.events.getEventLogger(name, version);

// logging an event in an instrumentation library
eventLogger.emit({ name: 'event-name' });

Useful links

License

Apache 2.0 - See LICENSE for more information.