Skip to content

Commit 936bcb7

Browse files
jmacdMrAlias
andauthored
Use a non-standard port for the DD example (#242)
Co-authored-by: Tyler Yahn <[email protected]>
1 parent 2b93770 commit 936bcb7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

exporters/metric/datadog/datadog.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func NewExporter(opts Options) (*Exporter, error) {
5454
// Options contains options for configuring the exporter.
5555
type Options struct {
5656
// StatsAddr specifies the host[:port] address for DogStatsD. It defaults
57-
// to localhost:8125.
57+
// to DefaultStatsAddrUDP.
5858
StatsAddr string
5959

6060
// Tags specifies a set of global tags to attach to each metric.

exporters/metric/datadog/example_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@ type TestUDPServer struct {
3939
}
4040

4141
func ExampleExporter() {
42+
const testHostPort = ":8159"
4243
selector := simple.NewWithSketchDistribution(ddsketch.NewDefaultConfig())
4344
exp, err := datadog.NewExporter(datadog.Options{
45+
StatsAddr: testHostPort,
4446
Tags: []string{"env:dev"},
4547
StatsDOptions: []statsd.Option{statsd.WithoutTelemetry()},
4648
})
4749
if err != nil {
4850
panic(err)
4951
}
50-
s, err := getTestServer(datadog.DefaultStatsAddrUDP)
52+
s, err := getTestServer(testHostPort)
5153
if err != nil {
5254
panic(err)
5355
}

0 commit comments

Comments
 (0)