Skip to content

Commit

Permalink
Use a non-standard port for the DD example (#242)
Browse files Browse the repository at this point in the history
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
  • Loading branch information
jmacd and MrAlias authored Aug 20, 2020
1 parent 2b93770 commit 936bcb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exporters/metric/datadog/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewExporter(opts Options) (*Exporter, error) {
// Options contains options for configuring the exporter.
type Options struct {
// StatsAddr specifies the host[:port] address for DogStatsD. It defaults
// to localhost:8125.
// to DefaultStatsAddrUDP.
StatsAddr string

// Tags specifies a set of global tags to attach to each metric.
Expand Down
4 changes: 3 additions & 1 deletion exporters/metric/datadog/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,17 @@ type TestUDPServer struct {
}

func ExampleExporter() {
const testHostPort = ":8159"
selector := simple.NewWithSketchDistribution(ddsketch.NewDefaultConfig())
exp, err := datadog.NewExporter(datadog.Options{
StatsAddr: testHostPort,
Tags: []string{"env:dev"},
StatsDOptions: []statsd.Option{statsd.WithoutTelemetry()},
})
if err != nil {
panic(err)
}
s, err := getTestServer(datadog.DefaultStatsAddrUDP)
s, err := getTestServer(testHostPort)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 936bcb7

Please sign in to comment.