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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@orieken/cucumber-otel-formatter

v0.1.8

Published

OpenTelemetry formatter for CucumberJS

Downloads

8

Readme

@orieken/cucumber-otel-formatter

@orieken/cucumber-otel-reporter is a custom CucumberJS reporter built in TypeScript to enhance test observability by sending test results as both tracing data and metrics directly to OpenTelemetry and Prometheus. This reporter captures information for each test scenario and sends it to pre-configured OTLP and Prometheus endpoints, allowing for real-time monitoring of test success rates, durations, and failures.

Features

  • OpenTelemetry Integration: Sends trace data for each test scenario, including the test status (passed, failed, or pending), duration, and custom attributes.
  • Prometheus Metrics Collection: Tracks scenario counts and durations as metrics, accessible to a Prometheus server for easy aggregation and analysis.
  • Configurable Endpoints: Allows users to specify OTLP and Prometheus endpoints via a JSON configuration file.

Installation

```bash npm install @orieken/cucumber-otel-reporter ```

Configuration

Create a JSON configuration file (e.g., `otel-config.json`) with the required endpoints and service name. Example:

```json { "otelServiceUrl": "http://localhost:50052/v1/traces", "prometheusMetricsUrl": "http://localhost:50080/metrics", "serviceName": "CucumberOtelTestService" } ```

Configuration Options

  • `otelServiceUrl`: URL for the OpenTelemetry trace endpoint (e.g., OTLP HTTP endpoint on port `50052`).
  • `prometheusMetricsUrl`: URL for the Prometheus metrics endpoint (e.g., Prometheus server on port `50080`).
  • `serviceName`: Custom name for the service used in trace data and metrics.

Usage

Run CucumberJS with the custom formatter and point it to the configuration file:

```bash npx cucumber-js --require-module ts-node/register --format @orieken/cucumber-otel-reporter ./path/to/otel-config.json ```

Metrics Exposed

  1. Total Scenarios Run: Tracks the count of scenarios based on their status (passed, failed, pending).
  2. Scenario Duration: Records the duration of each scenario in seconds.

Trace Attributes

Each trace captures:

  • Scenario Name: The name of the Cucumber scenario.
  • Status: The test status (passed, failed, pending).
  • Duration: Duration in seconds.
  • Test Run Name: Optional name of the test run, if provided by the Cucumber test run.

Example

Given a test scenario in CucumberJS, this reporter will:

  1. Capture the test status and duration for each scenario.
  2. Send trace data to the specified OTLP endpoint in OpenTelemetry.
  3. Send Prometheus-compatible metrics to the specified Prometheus metrics endpoint.

This allows for real-time monitoring and analysis, enabling better insights into test performance and reliability.

Requirements

Ensure your system meets the following requirements:

  • OpenTelemetry: Your endpoint should support OTLP HTTP for traces (default is `http://localhost:50052`).
  • Prometheus: Prometheus server should be accessible to scrape metrics from the configured URL (default is `http://localhost:50080`).

License

MIT License