All Projects → convoyinc → apollo-link-tracer

convoyinc / apollo-link-tracer

Licence: other
Trace your apollo queries and mutations with https://github.com/apollographql/apollo-link

Programming Languages

typescript
32286 projects
shell
77523 projects

Projects that are alternatives of or similar to apollo-link-tracer

Dd Trace Js
JavaScript APM Tracer
Stars: ✭ 212 (+960%)
Mutual labels:  datadog, apm
dd-trace-php
[DEPRECATED] Use https://github.com/dataDog/dd-trace-php instead
Stars: ✭ 18 (-10%)
Mutual labels:  datadog, trace
Dd Trace Py
Datadog Python APM Client
Stars: ✭ 220 (+1000%)
Mutual labels:  datadog, apm
Dd Trace Rb
Datadog Tracing Ruby Client
Stars: ✭ 118 (+490%)
Mutual labels:  datadog, apm
datadog-trace-agent
Datadog Trace Agent archive (pre-6.10.0)
Stars: ✭ 70 (+250%)
Mutual labels:  datadog, apm
Dd Trace Dotnet
.NET Tracer for Datadog APM
Stars: ✭ 125 (+525%)
Mutual labels:  datadog, apm
Dd Trace Go
A Go tracing package for Datadog APM
Stars: ✭ 244 (+1120%)
Mutual labels:  datadog, apm
Molten
php probe for zipkin and opentracing
Stars: ✭ 740 (+3600%)
Mutual labels:  apm, trace
apollo-link-defer
Interface for creating asynchronous links.
Stars: ✭ 16 (-20%)
Mutual labels:  apollo, apollo-link
Uatu
Android方法调用跟踪 ; 方法耗时统计 ; 方法调用参数以及返回值跟踪 ; 方法调用替换;方法hook
Stars: ✭ 93 (+365%)
Mutual labels:  apm, trace
Dd Opentracing Cpp
Datadog Opentracing C++ Client
Stars: ✭ 22 (+10%)
Mutual labels:  datadog, apm
apollo-link-fragment-argument
An Apollo Link to enable to parameterize fragments
Stars: ✭ 35 (+75%)
Mutual labels:  apollo, apollo-link
Rails performance
Monitor performance of you Rails applications
Stars: ✭ 345 (+1625%)
Mutual labels:  datadog, apm
Dd Trace Php
Datadog Tracing PHP Client
Stars: ✭ 203 (+915%)
Mutual labels:  datadog, apm
Datav
📊https://datav.io is a modern APM, provide observability for your business, application and infrastructure. It's also a lightweight alternative to Grafana.
Stars: ✭ 2,757 (+13685%)
Mutual labels:  datadog, apm
Dd Trace Java
Datadog APM client for Java
Stars: ✭ 228 (+1040%)
Mutual labels:  datadog, apm
Inspectit
inspectIT is the leading Open Source APM (Application Performance Management) tool for analyzing your Java (EE) applications.
Stars: ✭ 513 (+2465%)
Mutual labels:  apm, trace
Jaeger Ui
Web UI for Jaeger
Stars: ✭ 639 (+3095%)
Mutual labels:  apm, trace
trace-cocoa-sdk
Catch bugs before they reach production — get detailed crash reports and monitor how your app is performing across the entire install base.
Stars: ✭ 15 (-25%)
Mutual labels:  apm, trace
laika
Log, test, intercept and modify Apollo Client's operations
Stars: ✭ 99 (+395%)
Mutual labels:  apollo, apollo-link

Apollo Link Tracer

Trace your apollo queries and mutations with apollo-link.

Relies on @convoy/tracer.

Getting started

npm install apollo-link-tracer --save
import ApolloLinkTracer from 'apollo-link-tracer';
import { Reporter } from '@convoy/tracer';

const apiReporter = new Reporter({
  flushHandler: async (timings, traces) => {
    // Report traces to API
  },
});

new ApolloClient({
  link: ApolloLink.from([
    new ApolloLinkTracer({
      service: 'my-service',
      tracerConfig: {
        reporter: apiReporter,
        fullTraceSampleRate: 1,
      },
      name: 'apollo-link',
    }),

    new ApolloLink((operation, forward) => {
      const { tracer } = operation.getContext().tracer;
      const requestId = tracer.getTraceId();

      operation.setContext({
        headers: {
          'x-req-id': requestId,
        },
      });

      return forward(operation);
    }),

    new RetryLink(retryOptions),

    new ApolloLinkTracer({
      service: 'my-service',
      tracerConfig: {
        reporter: apiReporter,
        fullTraceSampleRate: 1,
      },
      name: 'apollo-link-retry',
    }),

    new HttpLink({ uri, fetch }),
  ]),
});

Applying apollo-link-tracer both before and after the retry link lets you separately measure each retry, but provides a single trace across all of them.

A Tracer object is added to the operation context, which can then be used to pass a trace id to the HTTP headers to support cross service tracing.

Advanced options

On a per GQL request basis you can alter how the trace is captured.

api.mutate({
  mutation,
  variables,
  context: {
    tracerConfig: {
      fullTraceSampleRate: 1 / 20,
    },
    traceService: 'my-service',
    traceName: 'apollo-link-mutate',
    traceResource: 'getSomething',
    avoidTrace: false, // If true, skips tracing
  },
});

Filtering Sensitive Variables

To avoid reporting the contents of sensitive variables, you can specify variable filters.

new ApolloLinkTracer({
  service: 'my-service',
  tracerConfig: {
    reporter: apiReporter,
    fullTraceSampleRate: 1,
  },
  name: 'apollo-link-retry',
  variableFilters: ['password', /secret.*sauce/],
}),

Variable filters can be either string matches or regular expressions. Any variables whose names match these filters will have their values filtered out, e.g.

{ username: 'bob', password: 'hunter2', secret_hot_sauce: 'sri racha'}

becomes

{ username: 'bob', password: '<filtered>', secret_hot_sauce: '<filtered>'}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].