Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aereal/hoist-gql-errors
hoist-gql-errors extracts GraphQL errors from the downstream response and record them as OpenTelemetry exception events.
https://github.com/aereal/hoist-gql-errors
datadog-error-tracking go graphql opentelemetry
Last synced: 3 months ago
JSON representation
hoist-gql-errors extracts GraphQL errors from the downstream response and record them as OpenTelemetry exception events.
- Host: GitHub
- URL: https://github.com/aereal/hoist-gql-errors
- Owner: aereal
- License: mit
- Created: 2022-12-21T12:34:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T17:03:50.000Z (3 months ago)
- Last Synced: 2024-10-26T00:35:39.688Z (3 months ago)
- Topics: datadog-error-tracking, go, graphql, opentelemetry
- Language: Go
- Homepage:
- Size: 69.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![status][ci-status-badge]][ci-status]
[![PkgGoDev][pkg-go-dev-badge]][pkg-go-dev]# 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][pkg-go-dev].
```go
import (
"net/http""github.com/aereal/hoist-gql-errors"
)func main() {
var handler http.Handler
var _ http.Handler = hoistgqlerrors.New()(handler)
}
```## Installation
```sh
go get github.com/aereal/hoist-gql-errors
```## License
See LICENSE file.
[pkg-go-dev]: https://pkg.go.dev/github.com/aereal/hoist-gql-errors
[pkg-go-dev-badge]: https://pkg.go.dev/badge/aereal/hoist-gql-errors
[ci-status-badge]: https://github.com/aereal/hoist-gql-errors/workflows/CI/badge.svg?branch=main
[ci-status]: https://github.com/aereal/hoist-gql-errors/actions/workflows/CI
[graphql]: https://graphql.org/
[opentelemetry]: https://opentelemetry.io/
[error tracking]: https://docs.datadoghq.com/tracing/error_tracking/
[otelhttp.Handler]: https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp#Handler