Socket
Socket
Sign inDemoInstall

supergraph-demo-opentelemetry

Package Overview
Dependencies
11
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

supergraph-demo-opentelemetry

Open Telemetry instrumentation for Apollo Server and Apollo Gateway


Version published
Maintainers
1
Created

Readme

Source

supergraph-demo-opentelemetry

Helper library for Open Telemetry instrumentation and distributed tracing in Apollo Federation using Apollo Gateway and Apollo Server.

See Apollo Federation Open Telemetry Docs for details on Open Telemetry support in Apollo Federation.

See apollographql/supergraph-demo for a working demo using this library:

opentelemetry

Basic Usage

See working example in the apollographql/supergraph-demo.

Apollo Gateway

Add this before you even import apollo-server, express, or http. Otherwise, your trace data will be incomplete.

new ApolloOpenTelemetry({
  type: 'router',
  name: 'router',
  exporter: {
    type: 'zipkin', // console, zipkin, collector, ...
    host: 'localhost', // default: localhost
    port: '9411', // default: exporter specific
  }
}).setupInstrumentation();

Apollo Gateway does trace context propagation so the subgraphs in a Apollo Federation can do distributed tracing.

Apollo Server

Add this before you even import apollo-server, express, or http. Otherwise, your trace data will be incomplete.

new ApolloOpenTelemetry({
  type: 'subgraph',
  name: 'inventory',
  exporter: {
    type: 'zipkin', // console, zipkin, collector, ...
    host: 'localhost', // default: localhost
    port: '9411', // default: exporter specific
  }
}).setupInstrumentation();

Learn More

Apollo Federation Open Telemetry Docs

FAQs

Package last updated on 07 Sep 2022

Did you know?

Socket

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc