Support sample rate and global sampling configuration for Datadog in ConfigMap
This commit is contained in:
parent
e09313075a
commit
d7be5db7de
4 changed files with 54 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue