mirror of
https://github.com/wahyd4/ingress-nginx.git
synced 2026-08-09 05:16:27 +10:00
Support sample rate and global sampling configuration for Datadog in ConfigMap
This commit is contained in:
@@ -552,6 +552,17 @@ type Configuration struct {
|
||||
// Default: nginx.handle
|
||||
DatadogOperationNameOverride string `json:"datadog-operation-name-override"`
|
||||
|
||||
// DatadogPrioritySampling specifies to use client-side sampling
|
||||
// If true disables client-side sampling (thus ignoring sample_rate) and enables distributed
|
||||
// priority sampling, where traces are sampled based on a combination of user-assigned
|
||||
// Default: true
|
||||
DatadogPrioritySampling bool `json:"datadog-priority-sampling"`
|
||||
|
||||
// DatadogSampleRate specifies sample rate for any traces created.
|
||||
// This is effective only when datadog-priority-sampling is false
|
||||
// Default: 1.0
|
||||
DatadogSampleRate float32 `json:"datadog-sample-rate"`
|
||||
|
||||
// MainSnippet adds custom configuration to the main section of the nginx configuration
|
||||
MainSnippet string `json:"main-snippet"`
|
||||
|
||||
@@ -767,6 +778,8 @@ func NewDefault() Configuration {
|
||||
DatadogServiceName: "nginx",
|
||||
DatadogCollectorPort: 8126,
|
||||
DatadogOperationNameOverride: "nginx.handle",
|
||||
DatadogSampleRate: 1.0,
|
||||
DatadogPrioritySampling: true,
|
||||
LimitReqStatusCode: 503,
|
||||
LimitConnStatusCode: 503,
|
||||
SyslogPort: 514,
|
||||
|
||||
@@ -1075,7 +1075,9 @@ const datadogTmpl = `{
|
||||
"service": "{{ .DatadogServiceName }}",
|
||||
"agent_host": "{{ .DatadogCollectorHost }}",
|
||||
"agent_port": {{ .DatadogCollectorPort }},
|
||||
"operation_name_override": "{{ .DatadogOperationNameOverride }}"
|
||||
"operation_name_override": "{{ .DatadogOperationNameOverride }}",
|
||||
"sample_rate": {{ .DatadogSampleRate }},
|
||||
"dd.priority.sampling": {{ .DatadogPrioritySampling }}
|
||||
}`
|
||||
|
||||
func createOpentracingCfg(cfg ngx_config.Configuration) error {
|
||||
|
||||
Reference in New Issue
Block a user