Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial integration of DogStatsD #585

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

JDeuce
Copy link

@JDeuce JDeuce commented May 13, 2024

godogstats package is implemented to bridge lyft/gostats with dogstatsd.

There is a new statsd sink implemented which will output the stats using dogstatsd protocl over UDP which allows tags.

Thus, a new mogrification feature is also added which lets us mogrify the stat from internal metric names, into a different name + tags, similar to what is done in the prom-stats-exporter example

Note: there is some runtime cost associated with mogrifying the metrics but it should be minimal due to the existing in memory flushing architecture.

including something called mogrifiers

Signed-off-by: JDeuce <jjaques@gmail.com>
Signed-off-by: JDeuce <jjaques@gmail.com>
Signed-off-by: JDeuce <jjaques@gmail.com>
Signed-off-by: JDeuce <jjaques@gmail.com>
@ysawa0 ysawa0 self-assigned this May 15, 2024
@ChuckCrawford
Copy link
Contributor

I apologize for making a design comment on an already implemented PR but what if instead of continuing to build support for specific company / vendor formats we instead implemented vendor-neutral OTEL Metrics ?

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comment otherwise LGTM.

Comment on lines +47 to 58
} else if s.UseDogStatsd {
var err error
sink, err := godogstats.NewSink(
godogstats.WithStatsdHost(s.StatsdHost),
godogstats.WithStatsdPort(s.StatsdPort),
godogstats.WithMogrifierFromEnv(s.UseDogStatsdMogrifiers))
if err != nil {
logger.Fatalf("Failed to create statsd sink: %v", err)
}
logger.Info("Stats initialized for dogstatsd")
store = gostats.NewStore(sink, false)
} else if s.UseStatsd {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make it an error if someone sets both dogstatsd and statsd to true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants