-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add StatsD receiver #290
Comments
I'm interested in picking this up. |
I have the skeleton of a @jmacd do you have any thoughts regarding implementation strategy here? Should we look to leverage the official DataDog implementation for the DogStatsD server? |
We should talk about what we're trying to achieve, first. I don't know the DD agent code well enough to know if it's meant for re-use in this way. I'm assuming there are at least two ways this will be used.
Which application are you thinking of? I admit being more interested in (1) because it will provide benefit to a larger community of users than (2). |
By the way, is there a branch with your skeleton that I could look at? Thanks! |
Here's the branch. There's nothing useful in there regarding DogStatsD, this was more me getting familiar with OT. It builds and I can enable it via config file, but it doesn't do anything yet 😄 That's a good point about the existing code being built in a reusable way, I'm not familiar enough either yet. What you outlined in 1 is what I have in mind. Ingest DogStatsD, convert to OT metrics to be further processed by existing OT pipeline functionalities/other plugins. Regarding protocol, should we aim to support all 3 mentioned (UDP, TCP, and Unix socket?). It seems the existing DogStatsD portion of the agent only supports UDP. |
I'm glad you're more interested in (1)! I think that DataDog should get involved if they're interested in exporting from otel-collector into their system (@mikezvi take note). UDP is great. I am familiar with uses of the datadog agent that use UNIX socketpairs, but that can be addressed later if needed (it's trivial). I've seen documentation about statstd-over-TCP but never seen it used with DD. |
Sounds good, thanks for the help. I'll take a swing at listening on a UDP port and processing incoming data in DogStatsD format out to OT Metrics. |
@sonofachamp I don't think we want to import the entire datadog agent. Either statsd should be separated out into its own library that multiple agents use or we implement from scratch. (btw, can it just be called statsdreceiver but have an option to support dd-style tags?). A number of others are interested in having statsd support as well. May be easier to have a high level design doc to work out any issues before going into implementation. I'll forward this thread to them. |
That makes sense. Should DogStatsD be supported through a "mode" of a more generic Where should I create a design doc for this? |
Ah, yeah if you plan on doing their whole protocol rather than just a slightly enhanced statsd it probably makes sense to make a dd-specific receiver. You could start here with what the config file would look like and any other high level decisions that need to be made. |
I don't believe anyone is asking for the "Additional" features that DataDog has implemented. I would strongly support a "statsdreceiver" that recognizes DataDog-style tags. I think we should also support the "d"-type statsd message that DataDog has added to indicate a distribution. @jrcamp What did you mean about the "whole protocol"? We're talking about statds protocols, not the protocol DD uses to report to itself from the agent, I think. I am less interested in designing and implementing the kind of statsd rewriter that occurs in the https://github.com/prometheus/statsd_exporter. |
Related note: I implemented the OTel-Go contrib dogstatsd exporter, which does not take a dependency on the DD-go statsd client. It's a lot faster. |
That's originally what I thought we were talking about which is why I suggested making it a generic statsd receiver with DD tag support. However @sonofachamp linked to https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent#dive-into-dogstatsd which includes things like events and service checks. |
We're primarily interested in the Tagging aspects DogStatsD provides, and if we think it's fine to support the tagging functionality under a |
Yes, I 💯 agree that we can create one receiver that supports both "plain" statsd and "dog" statsd. I'd like to focus on the dogstatsd support first, because transforming plain statsd messages into labeled metrics is a substantial and separate problem. I'm also keen on writing a new specification, since there isn't one for statsd. I would call it "OpenStatsD", and it would have an option for properly escaped labels (which IMO is a major problem w/ the de-facto syntax given to us by dogstatsd). So, let's focus on receiving (dog)statsd data and making it possible to re-export that data. If/when DataDog becomes interested in exporting from the collector, they can contribute a DD exporter to the collector. |
I'm thinking something as simple as: receivers:
statsd:
# By default a UDP listener
endpoint: "host:port" # default "localhost:8125"
# The format of the incoming UDP packets
encoding: "dogstatsd" # no default until "statsd" is supported and that becomes default? Another options could be to make "dogstatsd" be the default From an implementation standpoint it seems we can simply parse the incoming StatsD messages directly out to the relevant OpenTelemetry metric types. I can't see any immediate value in interpreting the incoming messages as StatsD types and then mapping StatsD types to OpenTelemetry metrics. From the Metrics spec I see the pre-aggregated types support counters and gauges, so those seem like natural mappings for the StatsD Gauge and Counter types. Metric Type mappings:
I'm less certain about the Timer, Histogram, Set, Meter, and Distribution types outside of it looks like they will be supported through raw measurements. The DogStatsD docs say Timers are not directly supported, but Histograms are basically an alias for Timers. I'm digging more into the |
Do you think that OT Histogram (https://github.com/open-telemetry/opentelemetry-proto/blob/master/opentelemetry/proto/metrics/v1/metrics.proto#L295) can be used for Datadog Histograms? There may be some data conversion necessary depending on how the counts and Exemplar.value are interpreted, but it seems like a pretty close fit. |
Oh yeah, great point @bsherrod, thanks! I'm a bit confused about the relationship between |
@sonofachamp You're running into some issues that are currently under review in the metrics SIG. I'm working on a document that will address the correct default translation to and from dogstatsd. I think it would be best if you focused for now on the receiver configuration and the basic code path. I will have a document on the topic of standard translation to-and-from both dogstatds and prometheus for the next SIG meeting. |
The config stanza above looks great! |
Here it the above-mentioned document: open-telemetry/oteps#118 |
Here's a summary of my takeaways from yesterdays discussion @jmacd, please correct me if I misunderstood anything. There are a couple of potential routes we could take regarding aggregation:
In the short term we can focus the initial development of this plugin to encompass the UDP listening functionality and parsing StatsD messages into the well defined OT metrics types while OT metrics are being further discussed and iterated on. We've also scoped the initial StatsD supported types down to: Counters ( @bsherrod What are your thoughts as I know you're interested in this plugin. Related resources: |
See also #332 |
@jmacd @bogdandrutu I discussed with the team and also checked other receivers (signalFX), which is similar to StatsD receiver (getting metrics in certain format). We did not see the aggregation.
|
@jmacd @bogdandrutu any comments on this? |
Hi @lubingfeng, sorry for the long delay. I am interested in helping you unblock this. As you may know, I'm interested in using the OTel-Go SDK to act as a processing pipeline component inside the OTel-Collector. To that end, I drafted a PR that would add "transient descriptor" support to the SDK. This support is not required for the API or SDK specification, but would be an added benefit for users wanting to re-use the OTel-Go SDK for metrics processing. Here: jmacd/opentelemetry-go#59 The use of the transient Accumulator developed in that PR means that each Statsd data point can be turned into a metric event and that you can simply encode OTLP using the OTel-Go SDK's OTLP exporter to format OTLP, then emit it directly into a collector pipeline by flushing it once per second, for example. This approach could be beneficial in a number of situations. Also I'd like to establish a timeline for getting this package and the other receivers to use OTLP natively, instead of OpenCensus data points. Using the OTel-Go SDK as I've proposed would help with that point. @lubingfeng I'd be happy to meet and discuss this. |
@jmacd Thank you for the helps! so basically we need to make changes on statsd receiver to do two things, correct me if i'm wrong.
base on this i have several questions if you don't mind.
|
Yes, with the "transient descriptor" support that I mentioned.
This would be determined by the push controller in
This would be handled automatically by the SDK (as well as for any other built-in aggregators).
Yes.
Yes. This seems like it could be a significant win. Ideally this could be done as a general-purpose OTel-Collector pipeline stage, but it seems appropriate to experiment with this approach in one SDK at first. I am most interested in trying out statsd support this way. |
@jmacd I would like to have a meeting with you this Thursday 10/8 or Friday 10/9 to discuss what's next. Let me know how I can send you the meeting inviete.
|
…nsfer counter to int only. (#1361) - Add sample rate support for counter If we receive `counterName:10|c|@0.1`, we will transfer the value to `10/0.1 = 100` to the following process - Transfer gauge to double only After discussion, we plan to transfer gauge to double only no matter what we receive `gaugeName:86|g` will be transferred to 86.0 as Double_Gauge only - Transfer counter to int only After discussion, we plan to transfer counter to int only no matter what we receive `counterName:86|c` will be transferred to 86 as Int only **Link to tracking Issue:** - #290 **Testing:** - Added unit tests
Statsdrevever exists now, closing. |
…290) Bumps [github.com/onsi/ginkgo](https://github.com/onsi/ginkgo) from 1.16.4 to 1.16.5. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](onsi/ginkgo@v1.16.4...v1.16.5) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add a receiver that listens for incoming DogStatsD messages and translates them into OT Metrics.
The text was updated successfully, but these errors were encountered: