github.com/mier85/go-sensor@v1.30.1-0.20220920111756-9bf41b3bc7e0/tracer_options.go (about)

     1  // (c) Copyright IBM Corp. 2021
     2  // (c) Copyright Instana Inc. 2017
     3  
     4  package instana
     5  
     6  // TracerOptions carry the tracer configuration
     7  type TracerOptions struct {
     8  	// DropAllLogs turns log events on all spans into no-ops
     9  	DropAllLogs bool
    10  	// MaxLogsPerSpan limits the number of log records in a span (if set to a non-zero
    11  	// value). If a span has more logs than this value, logs are dropped as
    12  	// necessary
    13  	MaxLogsPerSpan int
    14  	// Secrets is a secrets matcher used to filter out sensitive data from HTTP requests, database
    15  	// connection strings, etc. By default tracer does not filter any values. Package `secrets`
    16  	// provides a set of secret matchers supported by the host agent configuration.
    17  	//
    18  	// See https://www.instana.com/docs/setup_and_manage/host_agent/configuration/#secrets for details
    19  	Secrets Matcher
    20  	// CollectableHTTPHeaders is a case-insensitive list of HTTP headers to be collected from HTTP requests and sent to the agent
    21  	//
    22  	// See https://www.instana.com/docs/setup_and_manage/host_agent/configuration/#capture-custom-http-headers for details
    23  	CollectableHTTPHeaders []string
    24  }
    25  
    26  // DefaultTracerOptions returns the default set of options to configure a tracer
    27  func DefaultTracerOptions() TracerOptions {
    28  	return TracerOptions{
    29  		MaxLogsPerSpan: MaxLogsPerSpan,
    30  		Secrets:        DefaultSecretsMatcher(),
    31  	}
    32  }