Skip to content

stats: add config and docs for dog statsd sink#325

Merged
htuch merged 7 commits intoenvoyproxy:masterfrom
taiki45:dog-statsd
Dec 7, 2017
Merged

stats: add config and docs for dog statsd sink#325
htuch merged 7 commits intoenvoyproxy:masterfrom
taiki45:dog-statsd

Conversation

@taiki45
Copy link
Copy Markdown
Member

@taiki45 taiki45 commented Dec 5, 2017

For envoyproxy/envoy#2158.

Signed-off-by: Taiki Ono taiks.4559@gmail.com

Review Note:
I'm not a fluent English speaker.

Signed-off-by: Taiki Ono <taiks.4559@gmail.com>
// Stats configuration proto schema for built-in *envoy.dog_statsd* sink.
// The sink emits stats with `DogStatsD <https://docs.datadoghq.com/guides/dogstatsd/>`_
// compatible tags. Tags are configurable via :ref:`StatsConfig <envoy_api_msg_StatsConfig>`.
message DogStatsdSink {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We probably should have a api/stats directory and move the pluggable stats to their own protos there. Same goes for api/trace. Doesn't have to be done in this PR, but if there is agreement amongst maintainers, we can file an issue.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

+1. Probably in api/stats or api/stats_sink?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1, do you mind just doing that in this PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure. Done in 2acb78b. If it's OK, I'll do the same thing for api/trace in another PR.

Signed-off-by: Taiki Ono <taiks.4559@gmail.com>
Copy link
Copy Markdown
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.

nice, very cool.

// Stats configuration proto schema for built-in *envoy.dog_statsd* sink.
// The sink emits stats with `DogStatsD <https://docs.datadoghq.com/guides/dogstatsd/>`_
// compatible tags. Tags are configurable via :ref:`StatsConfig <envoy_api_msg_StatsConfig>`.
message DogStatsdSink {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1, do you mind just doing that in this PR?

// The sink emits stats with `DogStatsD <https://docs.datadoghq.com/guides/dogstatsd/>`_
// compatible tags. Tags are configurable via :ref:`StatsConfig <envoy_api_msg_StatsConfig>`.
message DogStatsdSink {
// The UDP address of a running DogStatsD compliant listener. If specified,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does datadog support TCP also?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Signed-off-by: Taiki Ono <taiks.4559@gmail.com>
Since both messages are related with each other, need to gather into one
place.

Signed-off-by: Taiki Ono <taiks.4559@gmail.com>
// can be found in :ref:`Stats sinks<envoy_api_file_api/stats.proto>` or
// `well_known_names.h
// <https://github.com/envoyproxy/envoy/blob/master/source/common/config/well_known_names.h>`_
// in the Envoy repository.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can move this proto as well into stats.proto.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Got it. Do you think StatsConfig can move into stats.proto as well?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah I would move it also.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done 7ee4f1e.

api/stats.proto Outdated
message DogStatsdSink {
// The UDP address of a running DogStatsD compliant listener. If specified,
// statistics will be flushed to this address.
Address address = 1 [(validate.rules).message.required = true];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Out of curiosity, can DogStatsD do TCP as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We can flush DogStatsD messages via TCP as well as UDP. statsd_exporter which suports DogStatsD extension listens both TCP and UDP port. But original datadog's dd-agent doesn't listen TCP port: https://github.com/DataDog/dd-agent/wiki/Agent-Architecture#supervision-privileges-and-network-ports

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would consider making this a oneof, so that this can grow in future to include TCP..

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

+1 3c8e694

Signed-off-by: Taiki Ono <taiks.4559@gmail.com>
api/stats.proto Outdated
@@ -0,0 +1,150 @@
// [#protodoc-title: Stats sinks]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: not just sinks now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right. 0fbe7b3

api/stats.proto Outdated
message DogStatsdSink {
// The UDP address of a running DogStatsD compliant listener. If specified,
// statistics will be flushed to this address.
Address address = 1 [(validate.rules).message.required = true];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would consider making this a oneof, so that this can grow in future to include TCP..

Signed-off-by: Taiki Ono <taiks.4559@gmail.com>
For future extensibility.

Signed-off-by: Taiki Ono <taiks.4559@gmail.com>
@htuch
Copy link
Copy Markdown
Member

htuch commented Dec 6, 2017

Thanks @taiki45, LGTM. Will let @mattklein123 merge if he's happy with the final docs.

@taiki45
Copy link
Copy Markdown
Member Author

taiki45 commented Dec 6, 2017

@htuch Thank you for reviewing this!

@htuch htuch merged commit ae65079 into envoyproxy:master Dec 7, 2017
@mattklein123
Copy link
Copy Markdown
Member

LGTM, thank you! Sorry for the late review.

@taiki45 taiki45 deleted the dog-statsd branch December 8, 2017 09:53
@taiki45
Copy link
Copy Markdown
Member Author

taiki45 commented Dec 8, 2017

No problem, thanks!

htuch pushed a commit that referenced this pull request Mar 15, 2018
This is a follow-up PR of #325.
I mistook to add an unnecessary field here. What actually we need is just making dog_statsd_specifier oneof field, not adding tcp_cluster_name field.

We can safely drop this field because users has ended up with
initializing errors if they had specified this field.

[critical][main] source/server/server.cc:71] error initializing configuration '/envoy.yaml': Address must be a socket or pipe
This field has
never been used in envoy repo: https://github.com/envoyproxy/envoy/blob/7d03b231c7e8e086956096f6ca961f82c684ed0b/source/server/config/stats/dog_statsd.cc#L19-L23

Signed-off-by: Taiki Ono <taiki-ono@cookpad.com>
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.

3 participants