> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# StatsD in Standalone AppSignal Agent

The standalone AppSignal Agent runs a StatsD server over UDP on `localhost` port 8125 by default. You can use this to ingest metrics from other components of your infrastructure. Any metrics added can be used as [custom metrics](/metrics/custom) within AppSignal.

<Tip>
  If you are running several AppSignal-instrumented applications at a time in
  the same server, [the `enable_statsd` configuration
  option](/standalone-agent/configuration/options#option-enable_statsd)
  should be disabled for all but one of them, or [the `statsd_port`
  configuration
  option](/standalone-agent/configuration/options#option-statsd_port)
  should be used to expose each StatsD server on a different port.
</Tip>

## Supported metrics

The following StatsD metrics are currently supported:

* gauge
* counter
* timers

Other, unsupported metric types, will be ignored.

## Tagging

The StatsD server supports the DogStatsD extension, which means tags for metrics are supported.

## Example

The following example in Ruby demonstrates how this works using the [`statsd-instrument` gem](https://rubygems.org/gems/statsd-instrument).

<CodeGroup>
  ```ruby Ruby theme={null}
  require 'statsd-instrument'

  StatsD.backend = StatsD::Instrument::Backends::UDPBackend.new("localhost:8125", :datadog)

  # Gauge
  StatsD.gauge 'gauge', 2.0
  StatsD.gauge 'gauge_with_tags', 3.0, tags: ['hostname:frontend1'], sample_rate: 0.9

  # Counter
  10.times do
    StatsD.increment 'counter'
    StatsD.increment 'counter_with_key_value_tags', tags: ['hostname:frontend1']
    StatsD.increment 'counter_with_only_key_tags', tags: ['important']
  end

  # Timing
  10.times do
    StatsD.measure 'timing', 2.55
    StatsD.measure 'timing_with_tags', 3.55, tags: ['hostname:frontend1']
  end
  ```
</CodeGroup>

This is just to demonstrate, it is far more useful to use this from other languages that are not directly supported by AppSignal. You could use this to collect metrics from a PHP or .NET app for example.

There are numerous tools available that can extract StatsD metrics from the JVM or various databases and web servers. We're curious to see what use cases you find, do [let us know](mailto:support@appsignal.com)!
