# StatsD

> statsD is a network daemon that runs on the [Node.js](http://nodejs.org/) platform and listens for statistics, like counters and timers, sent over [UDP](http://en.wikipedia.org/wiki/User_Datagram_Protocol) or [TCP](http://en.wikipedia.org/wiki/Transmission_Control_Protocol) and sends aggregates to one or more pluggable backend services (e.g., [Graphite](http://graphite.readthedocs.org/)).\
> <https://github.com/statsd/statsd>

sfp supports emitting events to a statsD collector. You can activate the same by enabling the following environment variables

| Environment Variable             | Type    |                                                                                                                                               |
| -------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| SFPOWERSCRIPTS\_STATSD           | boolean | Activate sending metrics to a StatsD collector (such as a Datadog Agent) by setting this key to true                                          |
| SFPOWERSCRIPTS\_STATSD\_PORT     | string  | The port to send stats to, if not set, it is automatically set to 8125                                                                        |
| SFPOWERSCRIPTS\_STATSD\_HOST     | string  | The host to send stats to, if not set, it is send to 127.0.0.1                                                                                |
| SFPOWERSCRIPTS\_STATSD\_PROTOCOL | string  | :Use `tcp` option for TCP protocol, or `uds` for the Unix Domain Socket protocol or `stream` for the raw stream. Defaults to `udp` otherwise. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp/sfp-community/metrics/configuring-collectors/statsd.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
