Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AliDatadog authored and wdhif committed May 7, 2024
1 parent 0ef253f commit 8c18762
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 5 additions & 4 deletions statsd/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,10 @@ func WithTelemetryAddr(addr string) Option {
// WithoutOriginDetection disables the client origin detection.
// When enabled, the client tries to discover its container ID and sends it to the Agent
// to enrich the metrics with container tags.
// If the container id is not found and the client is running in a private cgroup namespace, the client
// sends the base cgroup controller inode.
// Origin detection can also be disabled by configuring the environment variabe DD_ORIGIN_DETECTION_ENABLED=false
// The client tries to read the container ID by parsing the file /proc/self/cgroup, this is not supported on Windows.
// The client prioritizes the value passed via DD_ENTITY_ID (if set) over the container ID.
//
// More on this here: https://docs.datadoghq.com/developers/dogstatsd/?tab=kubernetes#origin-detection-over-udp
func WithoutOriginDetection() Option {
Expand All @@ -389,9 +390,9 @@ func WithoutOriginDetection() Option {
// This feature requires Datadog Agent version >=6.35.0 && <7.0.0 or Agent versions >=7.35.0.
// When enabled, the client tries to discover its container ID and sends it to the Agent
// to enrich the metrics with container tags.
// Origin detection can be disabled by configuring the environment variabe DD_ORIGIN_DETECTION_ENABLED=false
// The client tries to read the container ID by parsing the file /proc/self/cgroup, this is not supported on Windows.
// The client prioritizes the value passed via DD_ENTITY_ID (if set) over the container ID.
// If the container id is not found and the client is running in a private cgroup namespace, the client
// sends the base cgroup controller inode.
// Origin detection can be disabled by configuring the environment variable DD_ORIGIN_DETECTION_ENABLED=false
//
// More on this here: https://docs.datadoghq.com/developers/dogstatsd/?tab=kubernetes#origin-detection-over-udp
func WithOriginDetection() Option {
Expand Down
3 changes: 0 additions & 3 deletions statsd/statsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,6 @@ func (c *Client) Close() error {
// - o.originDetection is explicitly set to false, which is true by default
func isOriginDetectionEnabled(o *Options) bool {
if !o.originDetection || o.containerID != "" {
// originDetection is explicitly disabled
// or DD_ENTITY_ID was found
// or a user-defined container ID was provided
return false
}

Expand Down

0 comments on commit 8c18762

Please sign in to comment.