Skip to content

Commit

Permalink
Remove function exposing statsd.Event
Browse files Browse the repository at this point in the history
We should not expose types from `github.com/DataDog/datadog-go/v5/statsd`.
  • Loading branch information
nhhagen committed Dec 3, 2024
1 parent 7974730 commit 0c1cbe2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
5 changes: 4 additions & 1 deletion metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,8 @@ func Event(e *statsd.Event) {

// SimpleEvent sends an event with the provided title and text.
func SimpleEvent(title, text string) {
Event(statsd.NewEvent(title, text))
err := statsdClient.SimpleEvent(title, text)
if err != nil {
errorHandler(fmt.Errorf("failed to send Event: %w", err))
}
}
9 changes: 0 additions & 9 deletions metrics/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ func WithTags(tags ...string) Option {
}
}

// WithStatsdOptions allows for passing all options that available for the
// statsd.Client
func WithStatsdOptions(options ...statsd.Option) Option {
return func(cfg *config) error {
cfg.statsdOptions = options
return nil
}
}

// WithErrorHandler allows for setting a custom ErrorHandler to be called on
// function that may error but does not return an error
func WithErrorHandler(handler errors.ErrorHandler) Option {
Expand Down

0 comments on commit 0c1cbe2

Please sign in to comment.