gqlopencensus

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2019 License: Unlicense Imports: 4 Imported by: 2

Documentation

Overview

Example
package main

import (
	"log"
	"net/http"

	"github.com/99designs/gqlgen-contrib/gqlopencensus"
	"github.com/99designs/gqlgen/graphql"
	"github.com/99designs/gqlgen/handler"
)

var es graphql.ExecutableSchema

func main() {
	// NOTE: requires setting of Exporter
	//   trace.RegisterExporter(exporter)

	handler := handler.GraphQL(
		es,
		handler.Tracer(gqlopencensus.New()),
	)
	http.Handle("/query", handler)

	if err := http.ListenAndServe(":8080", nil); err != nil {
		log.Fatal(err)
	}
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) graphql.Tracer

New returns Tracer for OpenCensus. see https://go.opencensus.io/trace

Types

type Option

type Option func(cfg *config)

Option is anything that can configure Tracer.

func WithDataDog

func WithDataDog() Option

WithDataDog provides DataDog specific span attrs. see github.com/DataDog/opencensus-go-exporter-datadog

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL