Skip to content

hoist-gql-errors extracts GraphQL errors from the downstream response and record them as OpenTelemetry exception events.

License

Notifications You must be signed in to change notification settings

aereal/hoist-gql-errors

Repository files navigation

status PkgGoDev

hoist-gql-errors

hoist-gql-errors extracts GraphQL errors from the downstream response and record them as OpenTelemetry exception events.

It aims at that Datadog Error Tracking collects errors from OpenTelemetry traces.

Datadog Error Tracking needs error types, error messages, and error stacktraces on service entry spans (top-level spans).

In typical web applications, top-level spans mean spans that started on http.Handler. In addition, otelhttp.Handler will record no exceptions from downstream spans.

These facts mean that Datadog Error Tracking tracks no errors from the spans started by default setup with otelhttp.Handler.

hoist-gql-errors hoists (downstream) GraphQL errors and records them as service entry spans' errors, and then Datadog Error Tracking correctly collects them.

Synopsis

See examples on pkg.go.dev.

import (
  "net/http"

  "github.com/aereal/hoist-gql-errors"
)

func main() {
  var handler http.Handler
  var _ http.Handler = hoistgqlerrors.New()(handler)
}

Installation

go get github.com/aereal/hoist-gql-errors

License

See LICENSE file.

About

hoist-gql-errors extracts GraphQL errors from the downstream response and record them as OpenTelemetry exception events.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages