stats: add config and docs for dog statsd sink#325
Conversation
Signed-off-by: Taiki Ono <taiks.4559@gmail.com>
api/bootstrap.proto
Outdated
| // 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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
+1. Probably in api/stats or api/stats_sink?
There was a problem hiding this comment.
+1, do you mind just doing that in this PR?
There was a problem hiding this comment.
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>
api/bootstrap.proto
Outdated
| // 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 { |
There was a problem hiding this comment.
+1, do you mind just doing that in this PR?
api/bootstrap.proto
Outdated
| // 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, |
There was a problem hiding this comment.
Does datadog support TCP also?
There was a problem hiding this comment.
It seems dd-agent (the datadog's agent) doesn't support TCP: https://github.com/DataDog/dd-agent/wiki/Agent-Architecture#supervision-privileges-and-network-ports
statsd_exporter does: https://github.com/prometheus/statsd_exporter#building-and-running
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>
api/bootstrap.proto
Outdated
| // 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. |
There was a problem hiding this comment.
We can move this proto as well into stats.proto.
There was a problem hiding this comment.
Got it. Do you think StatsConfig can move into stats.proto as well?
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]; |
There was a problem hiding this comment.
Out of curiosity, can DogStatsD do TCP as well?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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>
api/stats.proto
Outdated
| @@ -0,0 +1,150 @@ | |||
| // [#protodoc-title: Stats sinks] | |||
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]; |
There was a problem hiding this comment.
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>
|
Thanks @taiki45, LGTM. Will let @mattklein123 merge if he's happy with the final docs. |
|
@htuch Thank you for reviewing this! |
|
LGTM, thank you! Sorry for the late review. |
|
No problem, thanks! |
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>
For envoyproxy/envoy#2158.
Signed-off-by: Taiki Ono taiks.4559@gmail.com
Review Note:
I'm not a fluent English speaker.