options.md
September 29, 2025 ยท View on GitHub
Options
Service
Type: string
Service is the global service name that will be used to identify the program in the Instana backend.
AgentHost
Type: string
AgentHost is the Instana host agent host name.
AgentPort
Type: int
AgentPort is the Instana host agent port.
Note
AgentHost and AgentPort options have no effect in serverless environments. To specify the serverless acceptor endpoint, define the INSTANA_ENDPOINT_URL env var.
See Serverless Monitoring for more details.
MaxBufferedSpans
Type: int
MaxBufferedSpans is the maximum number of spans to buffer.
ForceTransmissionStartingAt
Type: int
ForceTransmissionStartingAt is the number of spans to collect before flushing the buffer to the agent.
LogLevel
Type: int
LogLevel is the initial logging level for the logger used by Instana tracer. The valid log levels are logger.{Error,Warn,Info,Debug}Level provided by the https://github.com/instana/go-sensor/logger package.
Note
This setting is only used to initialize the default logger and has no effect if a custom logger is set via instana.SetLogger()
EnableAutoProfile
Type: bool
EnableAutoProfile enables automatic continuous process profiling when set to true.
MaxBufferedProfiles
Type: int
MaxBufferedProfiles is the maximum number of profiles to buffer.
IncludeProfilerFrames
Type: bool
IncludeProfilerFrames is whether to include profiler calls into the profile or not.
Tracer
Type: TracerOptions
Tracer contains tracer-specific configuration used by all tracers. Key options include:
- Disable: A map of span categories to disable. Currently, only the "logging" category is supported. See Disabling Log Spans for details.
- DropAllLogs: Turns log events on all spans into no-ops when set to true.
- MaxLogsPerSpan: Maximum number of log records that can be attached to a span.
- Secrets: A secrets matcher used to filter out sensitive data from HTTP requests, database connection strings, etc.
- CollectableHTTPHeaders: A list of HTTP headers to be collected from requests.
AgentClient
Type: AgentClient
AgentClient client to communicate with the agent. In most cases, there is no need to provide it. If it is nil the default implementation will be used.
Recorder
Type: SpanRecorder
Recorder records and manages spans. When this option is not set, instana.NewRecorder() will be used.
MaxLogsPerSpan
Type: int
MaxLogsPerSpan defines the maximum number of log records that can be attached to a span. If a span contains more logs than this limit, the excess logs will be dropped. Default value is 2. If set to 0 default value will be used.
Go Tracer only captures log spans with severity warn or higher.
Note
It is recommended to use the default value unless there's a specific need to retain more logs per span.
README | Tracing HTTP Outgoing Requests | Tracing SQL Driver Databases | Tracing Other Go Packages | Instrumenting Code Manually