contrib/hashicorp/vault

Those integration are enabled by having the following import in the project’s orchestrion.tool.go file:

import (
	_ "github.com/DataDog/orchestrion"

	_ "gopkg.in/DataDog/dd-trace-go.v1/contrib/hashicorp/vault" // integration
	//...
)

Official package for interacting with a Vault server.

Config

Join Point
Struct literal api.Config
  • Pointer or Value
Advice
Replace the expression using the template:
// Using the following synthetic imports:
import (
	vaulttrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/hashicorp/vault"
)
{{- .AST.Type -}}{
	{{- $hasField := false -}}
	{{ range .AST.Elts }}
	{{- if eq .Key.Name "HttpClient" }}
	{{- $hasField = true -}}
	HttpClient: vaulttrace.WrapHTTPClient({{ .Value }}),
	{{- else -}}
	{{ . }},
	{{ end -}}
	{{ end }}
	{{- if not $hasField -}}
	HttpClient: vaulttrace.NewHTTPClient(),
	{{- end }}
}