Documentation
¶
Overview ¶
Package vault contains functions to construct or augment an http.Client that will integrate with the github.com/hashicorp/vault/api and collect traces to send to Datadog.
The easiest way to use this package is to create an http.Client with NewHTTPClient, and put it in the Vault API config that is passed to the
If you are already using your own http.Client with the Vault API, you can use the WrapHTTPClient function to wrap the client with the tracer code. Your http.Client will continue to work as before, but will also capture traces.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPClient ¶
NewHTTPClient returns an http.Client for use in the Vault API config Client. A set of options can be passed in for further configuration.
Example (WithOptions) ¶
NewHTTPClient can be called with additional options for further configuration.
Output:
func WrapHTTPClient ¶
WrapHTTPClient takes an existing http.Client and wraps the underlying transport with tracing.
Example ¶
If you already have an http.Client that you're using, you can add tracing to it with WrapHTTPClient.
Output:
Example (WithOptions) ¶
WrapHTTPClient can be called with additional options to configure the integration.
Output:
Types ¶
type Option ¶
type Option func(*config)
Option can be passed to NewHTTPClient and WrapHTTPClient to configure the integration.
func WithAnalytics ¶
WithAnalytics enables or disables Trace Analytics for all started spans.
func WithAnalyticsRate ¶
WithAnalyticsRate sets the sampling rate for Trace Analytics events correlated to started spans.
func WithServiceName ¶
WithServiceName sets the given service name for the http.Client.