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

thundra-trace-chart-css

v1.1.1

Published

thundra-trace-chart react component

Downloads

1

Readme

Thundra-Trace-Chart

npm package

thundra-trace-chart is a React component to render open-tracing compatible traces and spans in a similar way to popular tools like Jeager and Zipkin. This component is using the project zipkin-lens in its roots.

Alt thundra trace chart

This component is under development and may not be the best solution for a custom use case. So you may want to fork it, or we would be happy to accept your PR's.

For npm audit logs to save use this command; npm audit --no-unicode --no-color > "npm-audit-log-$(date +%s).txt"

tl;dr

  • Install by executing npm install --save thundra-trace-chart or yarn add thundra-trace-chart.
  • Import by adding import ThundraTraceChart from 'thundra-trace-chart'.
  • Use by adding <ThundraTraceChart {...someProps} />.

Demo

Minimal demo page is included in sample directory. You just need to clone the repo and run npm i then finally run npm start to see the demo on your machine.

Online demo will be available soon!

Installation

Add Thundra-Trace-Chart to your project by executing npm install --save thundra-trace-chart or yarn add thundra-trace-chart.

Usage

Here's an example of basic usage:

import React, { Component } from 'react';
import ThundraTraceChart from 'thundra-trace-chart';

class MyApp extends Component {

  sampleTrace = () => {
    let trace = [
      {
        traceId: '4e81414c-2bff-439f-9e5c-9e6699b4e24b',
        parentId: '',
        id: '9400a8a9-9650-4312-9514-d4bbc1114a97',
        name: 'user-get-lambda-java-es',
        timestamp: 1557761782905000,
        duration: 281000,
        serviceName: 'AWS-Lambda',
        tags: {
          error: true
        }
      }
    ]

    return trace;
  }

  render() {
    return (
      <div>
        <ThundraTraceChart
          traceId="4e81414c-2bff-439f-9e5c-9e6699b4e24b"
          traceSummary={this.sampleTrace()}
        />
      </div>
    );
  }
}

User guide

Props

|Prop name|Prop type|Default|Description| |----|----|----|----| |traceId|string|required|Common trace id to all spans.| |traceSummary|array of objects|required|Array of objects, that each object contains vital information to render a single span.| |spanDetails|object|{ }|Set of key value pairs. Keys are id values of each object in the traceSummary array. Values are the React elements to render when spans clicked and span details are shown.| |spanHighlights|array of string|[ ]|Array of span ids from trace summary array. When provided, these traces will rendered to be more distinctive than other spans.| |activeSpanIds|array of string|[ ]|Array of span ids from trace summary array. When provided, details of these spans will be rendered as open. You can not use this prop with spanHighlights together.| |showHeader|boolean|true|Shows a header to top of the chart showing traceId, duration etc.| |showMiniTrace|boolean|true|Shows a mini trace chart on top. Useful to see if you have many spans.| |showTraceChartHeader|boolean|true|Shows a header over the spans. Useful to set width of Service Name or Span Info columns.| |showSpanDetail|boolean|true|Opens spans towards the below to show more detailed info about that span.| |showSpanDetailTitle|boolean|true|Render a title when span details is shown.| |serviceNameColumnTitle|string|Service Name|Sets custom title for Service Name column.| |spanInfoColumnTitle|string|Span Info|Sets custom title for Span Info column.| |onSpanClicked|function(spanId)|( )|When implemented, this function is called with the recently clicked span's id.|

Trace Object

Each of the trace object provided to traceSummary array has its own special structure.

|Key name|Type|Description| |----|----|----| |traceId|string|Common trace id to all spans.| |parentId|string|Parent span id of the span.| |id|string|Unique id of the span.| |serviceName|string|Name to be showed under Service Name column.| |name|string|Info to be showed under Span Info column.| |timestamp|number|Time info in microseconds to show when span is started.| |duration|number|Duration of the span.| |color|string|Color string as a valid hexcode.| |tags|object|Any extra info to provided to the span, i.e: error|

License

ASL 2.0.