opentelemetry-js/examples/redis
Daniel Dyla 18c6aa4f19 Named Tracers / Tracer Registry (#582)
* feat: spike of named tracer registry

* chore: mysql/mongo tracer registry support

* fix: lint

* chore: add getTracer back

* chore: change default tracer name to empty string

* fix: lint

* chore: update examples for registry

* chore(tracer-registry): make name required

* chore: lint

* chore: update examples for required tracer name

* chore: remove unused tracer delegate

* chore: remove references to basic tracer

* chore: remove references to NodeTracer

* chore: update xhr for tracer registry

* chore: update tracer names to match package names

* chore: add version script to all packages

* chore: update plugins to use version script

* chore: add jsdoc to noop tracer registry

* chore: update ioredis for tracer registry

* chore: update pg pool for tracer registry

* fix: lint

* chore: fix tests

* chore: lint

* chore: lint

Co-authored-by: Mayur Kale <mayurkale@google.com>
2020-01-09 08:29:38 -08:00
..
images feat: add redis plugin example (#534) 2019-11-27 08:28:03 -08:00
README.md feat: add redis plugin example (#534) 2019-11-27 08:28:03 -08:00
client.js Named Tracers / Tracer Registry (#582) 2020-01-09 08:29:38 -08:00
express-tracer-handlers.js feat: add redis plugin example (#534) 2019-11-27 08:28:03 -08:00
package.json chore: 0.3.2 (patch) release proposal (#659) 2020-01-03 12:27:10 -08:00
server.js Named Tracers / Tracer Registry (#582) 2020-01-09 08:29:38 -08:00
setup-redis.js feat: add redis plugin example (#534) 2019-11-27 08:28:03 -08:00
setup.js Named Tracers / Tracer Registry (#582) 2020-01-09 08:29:38 -08:00

README.md

Overview

OpenTelemetry Redis Instrumentation allows the user to automatically collect trace data and export them to the backend of choice (we can use Zipkin or Jaeger for this example), to give observability to distributed systems.

This is a simple example that demonstrates tracing calls to a Redis cache via an Express API. The example shows key aspects of tracing such as

  • Root Span (on Client)
  • Child Span (on Client)
  • Child Span from a Remote Parent (on Server)
  • SpanContext Propagation (from Client to Server)
  • Span Events
  • Span Attributes

Installation

$ # from this directory
$ npm install

Setup Zipkin Tracing or Setup Jaeger Tracing

Run the Application

Zipkin

  • Start redis via docker

    # from this directory
    npm run docker:start
    
  • Run the server

    # from this directory
    $ npm run zipkin:server
    
  • Run the client

    # from this directory
    npm run zipkin:client
    
  • Cleanup docker

    # from this directory
    npm run docker:stop
    

Zipkin UI

zipkin:server script should output the traceid in the terminal (e.g traceid: 4815c3d576d930189725f1f1d1bdfcc6). Go to Zipkin with your browser http://localhost:9411/zipkin/traces/(your-trace-id) (e.g http://localhost:9411/zipkin/traces/4815c3d576d930189725f1f1d1bdfcc6)

Jaeger

  • Start redis via docker

    # from this directory
    npm run docker:start
    
  • Run the server

    # from this directory
    $ npm run jaeger:server
    
  • Run the client

    # from this directory
    npm run jaeger:client
    
  • Cleanup docker

    # from this directory
    npm run docker:stop
    

Jaeger UI

jaeger:server script should output the traceid in the terminal (e.g traceid: 4815c3d576d930189725f1f1d1bdfcc6). Go to Jaeger with your browser http://localhost:16686/trace/(your-trace-id) (e.g http://localhost:16686/trace/4815c3d576d930189725f1f1d1bdfcc6)

LICENSE

Apache License 2.0