-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[contrib] add orchestrion integration configuration
- Loading branch information
1 parent
7a7b85f
commit 3094530
Showing
53 changed files
with
3,841 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed | ||
# under the Apache License Version 2.0. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
# Copyright 2023-present Datadog, Inc. | ||
--- | ||
# yaml-language-server: $schema=https://datadoghq.dev/orchestrion/schema.json | ||
meta: | ||
name: gopkg.in/DataDog/dd-trace-go.v1/contrib/99designs/gqlgen | ||
description: gqlgen is a Go library for building GraphQL servers without any fuss. | ||
|
||
aspects: | ||
- id: New | ||
join-point: | ||
one-of: | ||
- function-call: github.com/99designs/gqlgen/graphql/handler.New | ||
- function-call: github.com/99designs/gqlgen/graphql/handler.NewDefaultServer | ||
advice: | ||
- wrap-expression: | ||
imports: | ||
handler: github.com/99designs/gqlgen/graphql/handler | ||
gqlgentrace: gopkg.in/DataDog/dd-trace-go.v1/contrib/99designs/gqlgen | ||
template: |- | ||
func(s *handler.Server) *handler.Server { | ||
s.Use(gqlgentrace.NewTracer()) | ||
return s | ||
}({{ . }}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed | ||
# under the Apache License Version 2.0. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
# Copyright 2023-present Datadog, Inc. | ||
--- | ||
# yaml-language-server: $schema=https://datadoghq.dev/orchestrion/schema.json | ||
meta: | ||
name: gopkg.in/DataDog/dd-trace-go.v1/contrib/IBM/sarama.v1 | ||
description: Sarama is a Go library for Apache Kafka | ||
|
||
aspects: | ||
- id: NewConsumer | ||
join-point: | ||
one-of: | ||
- function-call: github.com/IBM/sarama.NewConsumer | ||
- function-call: github.com/IBM/sarama.NewConsumerClient | ||
advice: | ||
- wrap-expression: | ||
imports: | ||
saramatrace: gopkg.in/DataDog/dd-trace-go.v1/contrib/IBM/sarama.v1 | ||
sarama: github.com/IBM/sarama | ||
template: |- | ||
func(c sarama.Consumer, err error) (sarama.Consumer, error) { | ||
if c != nil { | ||
c = saramatrace.WrapConsumer(c) | ||
} | ||
return c, err | ||
}({{ . }}) | ||
- id: NewSyncProducer | ||
join-point: | ||
one-of: | ||
- function-call: github.com/IBM/sarama.NewSyncProducer | ||
- function-call: github.com/IBM/sarama.NewSyncProducerFromClient | ||
advice: | ||
- wrap-expression: | ||
imports: | ||
saramatrace: gopkg.in/DataDog/dd-trace-go.v1/contrib/IBM/sarama.v1 | ||
sarama: github.com/IBM/sarama | ||
template: |- | ||
{{- $cfg := .Function.ArgumentOfType "sarama.Config" -}} | ||
func(p sarama.SyncProducer, err error) (sarama.SyncProducer, error) { | ||
if p != nil { | ||
p = saramatrace.WrapSyncProducer( | ||
{{- if $cfg -}} | ||
{{ $cfg }}, | ||
{{- else -}} | ||
nil, | ||
{{- end -}} | ||
p, | ||
) | ||
} | ||
return p, err | ||
}({{ . }}) | ||
- id: NewAsyncProducer | ||
join-point: | ||
one-of: | ||
- function-call: github.com/IBM/sarama.NewAsyncProducer | ||
- function-call: github.com/IBM/sarama.NewAsyncProducerFromClient | ||
advice: | ||
- wrap-expression: | ||
imports: | ||
saramatrace: gopkg.in/DataDog/dd-trace-go.v1/contrib/IBM/sarama.v1 | ||
sarama: github.com/IBM/sarama | ||
template: |- | ||
{{- $cfg := .Function.ArgumentOfType "sarama.Config" -}} | ||
func(p sarama.AsyncProducer, err error) (sarama.AsyncProducer, error) { | ||
if p != nil { | ||
p = saramatrace.WrapAsyncProducer( | ||
{{- if $cfg -}} | ||
{{ $cfg }}, | ||
{{- else -}} | ||
nil, | ||
{{- end -}} | ||
p, | ||
) | ||
} | ||
return p, err | ||
}({{ . }}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed | ||
# under the Apache License Version 2.0. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
# Copyright 2023-present Datadog, Inc. | ||
--- | ||
# yaml-language-server: $schema=https://datadoghq.dev/orchestrion/schema.json | ||
meta: | ||
name: gopkg.in/DataDog/dd-trace-go.v1/contrib/Shopify/sarama | ||
description: Sarama is a Go library for Apache Kafka | ||
|
||
aspects: | ||
- id: NewConsumer | ||
join-point: | ||
one-of: | ||
- function-call: github.com/Shopify/sarama.NewConsumer | ||
- function-call: github.com/Shopify/sarama.NewConsumerClient | ||
advice: | ||
- wrap-expression: | ||
imports: | ||
saramatrace: gopkg.in/DataDog/dd-trace-go.v1/contrib/Shopify/sarama | ||
sarama: github.com/Shopify/sarama | ||
template: |- | ||
func(c sarama.Consumer, err error) (sarama.Consumer, error) { | ||
if c != nil { | ||
c = saramatrace.WrapConsumer(c) | ||
} | ||
return c, err | ||
}({{ . }}) | ||
- id: NewSyncProducer | ||
join-point: | ||
one-of: | ||
- function-call: github.com/Shopify/sarama.NewSyncProducer | ||
- function-call: github.com/Shopify/sarama.NewSyncProducerFromClient | ||
advice: | ||
- wrap-expression: | ||
imports: | ||
saramatrace: gopkg.in/DataDog/dd-trace-go.v1/contrib/Shopify/sarama | ||
sarama: github.com/Shopify/sarama | ||
template: |- | ||
{{- $cfg := .Function.ArgumentOfType "sarama.Config" -}} | ||
func(p sarama.SyncProducer, err error) (sarama.SyncProducer, error) { | ||
if p != nil { | ||
p = saramatrace.WrapSyncProducer( | ||
{{- if $cfg -}} | ||
{{ $cfg }}, | ||
{{- else -}} | ||
nil, | ||
{{- end -}} | ||
p, | ||
) | ||
} | ||
return p, err | ||
}({{ . }}) | ||
- id: NewAsyncProducer | ||
join-point: | ||
one-of: | ||
- function-call: github.com/Shopify/sarama.NewAsyncProducer | ||
- function-call: github.com/Shopify/sarama.NewAsyncProducerFromClient | ||
advice: | ||
- wrap-expression: | ||
imports: | ||
saramatrace: gopkg.in/DataDog/dd-trace-go.v1/contrib/Shopify/sarama | ||
sarama: github.com/Shopify/sarama | ||
template: |- | ||
{{- $cfg := .Function.ArgumentOfType "sarama.Config" -}} | ||
func(p sarama.AsyncProducer, err error) (sarama.AsyncProducer, error) { | ||
if p != nil { | ||
p = saramatrace.WrapAsyncProducer( | ||
{{- if $cfg -}} | ||
{{ $cfg }}, | ||
{{- else -}} | ||
nil, | ||
{{- end -}} | ||
p, | ||
) | ||
} | ||
return p, err | ||
}({{ . }}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed | ||
# under the Apache License Version 2.0. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
# Copyright 2023-present Datadog, Inc. | ||
--- | ||
# yaml-language-server: $schema=https://datadoghq.dev/orchestrion/schema.json | ||
meta: | ||
name: gopkg.in/DataDog/dd-trace-go.v1/contrib/aws/aws-sdk-go-v2/aws | ||
description: The official AWS SDK for Go | ||
|
||
aspects: | ||
- id: Config | ||
join-point: | ||
struct-literal: | ||
type: github.com/aws/aws-sdk-go-v2/aws.Config | ||
match: value-only | ||
advice: | ||
- wrap-expression: | ||
imports: | ||
awstrace: gopkg.in/DataDog/dd-trace-go.v1/contrib/aws/aws-sdk-go-v2/aws | ||
aws: github.com/aws/aws-sdk-go-v2/aws | ||
template: |- | ||
func(cfg aws.Config) (aws.Config) { | ||
awstrace.AppendMiddleware(&cfg) | ||
return cfg | ||
}({{ . }}) | ||
- id: '*Config' | ||
join-point: | ||
one-of: | ||
- struct-literal: | ||
type: github.com/aws/aws-sdk-go-v2/aws.Config | ||
match: pointer-only | ||
- function-call: github.com/aws/aws-sdk-go-v2/aws.NewConfig | ||
advice: | ||
- wrap-expression: | ||
imports: | ||
awstrace: gopkg.in/DataDog/dd-trace-go.v1/contrib/aws/aws-sdk-go-v2/aws | ||
aws: github.com/aws/aws-sdk-go-v2/aws | ||
template: |- | ||
func(cfg *aws.Config) (*aws.Config) { | ||
awstrace.AppendMiddleware(cfg) | ||
return cfg | ||
}({{ . }}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed | ||
# under the Apache License Version 2.0. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
# Copyright 2023-present Datadog, Inc. | ||
--- | ||
# yaml-language-server: $schema=https://datadoghq.dev/orchestrion/schema.json | ||
meta: | ||
name: gopkg.in/DataDog/dd-trace-go.v1/contrib/aws/aws-sdk-go/aws | ||
description: The official AWS SDK for Go | ||
|
||
aspects: | ||
- id: session.NewSession | ||
join-point: | ||
function-call: github.com/aws/aws-sdk-go/aws/session.NewSession | ||
advice: | ||
- wrap-expression: | ||
imports: | ||
awstrace: gopkg.in/DataDog/dd-trace-go.v1/contrib/aws/aws-sdk-go/aws | ||
session: github.com/aws/aws-sdk-go/aws/session | ||
template: |- | ||
func(sess *session.Session, err error) (*session.Session, error) { | ||
if sess != nil { | ||
sess = awstrace.WrapSession(sess) | ||
} | ||
return sess, err | ||
}({{ . }}) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed | ||
# under the Apache License Version 2.0. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
# Copyright 2023-present Datadog, Inc. | ||
--- | ||
# yaml-language-server: $schema=https://datadoghq.dev/orchestrion/schema.json | ||
meta: | ||
name: gopkg.in/DataDog/dd-trace-go.v1/contrib/cloud.google.com/go/pubsub.v1 | ||
description: Package pubsub provides an easy way to publish and receive Google Cloud Pub/Sub messages, hiding the details of the underlying server RPCs | ||
|
||
aspects: | ||
## Trace Receive ## | ||
- id: Subscription.Receive | ||
join-point: | ||
function-body: | ||
function: | ||
- receiver: '*cloud.google.com/go/pubsub.Subscription' | ||
- name: Receive | ||
advice: | ||
- prepend-statements: | ||
imports: | ||
tracing: gopkg.in/DataDog/dd-trace-go.v1/contrib/cloud.google.com/go/pubsub.v1/internal/tracing | ||
template: |- | ||
{{- $subscription := .Function.Receiver -}} | ||
{{- $handler := .Function.Argument 1 -}} | ||
__dd_traceFn := tracing.TraceReceiveFunc({{ $subscription }}) | ||
__dd_wrapHandler := func(h func(ctx context.Context, msg *Message)) func(ctx context.Context, msg *Message) { | ||
return func(ctx context.Context, msg *Message) { | ||
__dd_traceMsg := &tracing.Message{ | ||
ID: msg.ID, | ||
Data: msg.Data, | ||
OrderingKey: msg.OrderingKey, | ||
Attributes: msg.Attributes, | ||
DeliveryAttempt: msg.DeliveryAttempt, | ||
PublishTime: msg.PublishTime, | ||
} | ||
ctx, closeSpan := __dd_traceFn(ctx, __dd_traceMsg) | ||
defer closeSpan() | ||
h(ctx, msg) | ||
} | ||
} | ||
{{ $handler }} = __dd_wrapHandler({{ $handler }}) | ||
## Trace Publish ## | ||
- id: PublishResult | ||
join-point: | ||
struct-definition: cloud.google.com/go/internal/pubsub.PublishResult | ||
advice: | ||
- inject-declarations: | ||
template: |- | ||
type DDCloseSpanFunc = func(serverID string, err error) | ||
- add-struct-field: | ||
name: DDCloseSpan | ||
type: DDCloseSpanFunc | ||
|
||
- id: Topic.Publish | ||
join-point: | ||
function-body: | ||
function: | ||
- receiver: '*cloud.google.com/go/pubsub.Topic' | ||
- name: Publish | ||
advice: | ||
- prepend-statements: | ||
imports: | ||
tracing: gopkg.in/DataDog/dd-trace-go.v1/contrib/cloud.google.com/go/pubsub.v1/internal/tracing | ||
template: |- | ||
{{- $topic := .Function.Receiver -}} | ||
{{- $ctx := .Function.Argument 0 -}} | ||
{{- $msg := .Function.Argument 1 -}} | ||
{{- $publishResult := .Function.Result 0 -}} | ||
__dd_traceMsg := &tracing.Message{ | ||
ID: {{ $msg }}.ID, | ||
Data: {{ $msg }}.Data, | ||
OrderingKey: {{ $msg }}.OrderingKey, | ||
Attributes: {{ $msg }}.Attributes, | ||
DeliveryAttempt: {{ $msg }}.DeliveryAttempt, | ||
PublishTime: {{ $msg }}.PublishTime, | ||
} | ||
__dd_ctx, __dd_closeSpan := tracing.TracePublish({{ $ctx }}, {{ $topic }}, __dd_traceMsg) | ||
{{ $ctx }} = __dd_ctx | ||
{{ $msg }}.Attributes = __dd_traceMsg.Attributes | ||
defer func() { | ||
{{ $publishResult }}.DDCloseSpan = __dd_closeSpan | ||
}() | ||
- id: PublishResult.Get | ||
join-point: | ||
function-body: | ||
function: | ||
- receiver: '*cloud.google.com/go/internal/pubsub.PublishResult' | ||
- name: Get | ||
advice: | ||
- prepend-statements: | ||
template: |- | ||
{{- $publishResult := .Function.Receiver -}} | ||
{{- $serverID := .Function.Result 0 -}} | ||
{{- $err := .Function.Result 1 -}} | ||
defer func() { | ||
if {{ $publishResult }}.DDCloseSpan != nil { | ||
{{ $publishResult }}.DDCloseSpan({{ $serverID }}, {{ $err }}) | ||
} | ||
}() |
Oops, something went wrong.