Documentation ¶
Overview ¶
Package splunkgraphql provides OpenTelemetry instrumentation for the github.com/graph-gophers/graphql-go module.
Example ¶
package main import ( "net/http" "github.com/graph-gophers/graphql-go" "github.com/graph-gophers/graphql-go/relay" "github.com/signalfx/splunk-otel-go/instrumentation/github.com/graph-gophers/graphql-go/splunkgraphql" ) const schema = ` schema { query: Query } type Query { hello: String! } ` type resolver struct{} func (*resolver) Hello() string { return "Hello, world!" } func main() { tracer := graphql.Tracer(splunkgraphql.NewTracer()) s := graphql.MustParseSchema(schema, new(resolver), tracer) http.Handle("/query", &relay.Handler{Schema: s}) /* if err := http.ListenAndServe(":8080", nil); err != nil { panic(err) } ... */ }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option applies options to a configuration.
func WithAttributes ¶
WithAttributes returns an Option that appends attr to the attributes set for every span created.
func WithTracerProvider ¶
func WithTracerProvider(tp trace.TracerProvider) Option
WithTracerProvider returns an Option that sets the TracerProvider used for a configuration.
Click to show internal directories.
Click to hide internal directories.