All Projects → DataDog → Datadog Go

DataDog / Datadog Go

Licence: mit
go dogstatsd client library for datadog

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Datadog Go

heroku-datadog-drain-golang
Funnel metrics from multiple Heroku apps into DataDog using statsd.
Stars: ✭ 34 (-85.71%)
Mutual labels:  statsd, datadog
Java Dogstatsd Client
a java statsd client library
Stars: ✭ 140 (-41.18%)
Mutual labels:  statsd, datadog
dog-statsd
🐶 DataDog StatsD Client
Stars: ✭ 38 (-84.03%)
Mutual labels:  statsd, datadog
statsd.cr
A statsd client library for Crystal.
Stars: ✭ 32 (-86.55%)
Mutual labels:  statsd, datadog
Graylog Plugin Metrics Reporter
Graylog Metrics Reporter Plugins
Stars: ✭ 71 (-70.17%)
Mutual labels:  statsd, datadog
Promitor
Bringing Azure Monitor metrics where you need them.
Stars: ✭ 140 (-41.18%)
Mutual labels:  statsd
Redis Timeseries
Future development of redis-timeseries is at github.com/RedisLabsModules/redis-timeseries.
Stars: ✭ 197 (-17.23%)
Mutual labels:  statsd
Dd Trace Dotnet
.NET Tracer for Datadog APM
Stars: ✭ 125 (-47.48%)
Mutual labels:  datadog
Dd Trace Rb
Datadog Tracing Ruby Client
Stars: ✭ 118 (-50.42%)
Mutual labels:  datadog
Statix
Fast and reliable Elixir client for StatsD-compatible servers
Stars: ✭ 228 (-4.2%)
Mutual labels:  statsd
Dd Trace Py
Datadog Python APM Client
Stars: ✭ 220 (-7.56%)
Mutual labels:  datadog
Remora
Kafka consumer lag-checking application for monitoring, written in Scala and Akka HTTP; a wrap around the Kafka consumer group command. Integrations with Cloudwatch and Datadog. Authentication recently added
Stars: ✭ 183 (-23.11%)
Mutual labels:  datadog
Documentation
The source for Datadog's documentation site.
Stars: ✭ 147 (-38.24%)
Mutual labels:  datadog
Dd Trace Php
Datadog Tracing PHP Client
Stars: ✭ 203 (-14.71%)
Mutual labels:  datadog
Ansible Datadog
Ansible role for Datadog Agent
Stars: ✭ 223 (-6.3%)
Mutual labels:  datadog
Statsd Vis
Standalone StatsD server with built-in visualization
Stars: ✭ 124 (-47.9%)
Mutual labels:  statsd
Node Statsd Client
Node.js client for statsd
Stars: ✭ 170 (-28.57%)
Mutual labels:  statsd
Dd Trace Js
JavaScript APM Tracer
Stars: ✭ 212 (-10.92%)
Mutual labels:  datadog
Stats
Go package for abstracting stats collection
Stars: ✭ 164 (-31.09%)
Mutual labels:  datadog
Go Statsd Client
statsd client for Go
Stars: ✭ 163 (-31.51%)
Mutual labels:  statsd

Build Status

Datadog Go

Godoc license

datadog-go is a library that provides a DogStatsD client in Golang.

Go 1.12+ is officially supported. Older versions might work but are not tested.

The following documentation is available:

Installation

Get the code with:

$ go get github.com/DataDog/datadog-go/statsd

Then create a new DogStatsD client:

package main

import (
    "log"
    "github.com/DataDog/datadog-go/statsd"
)

func main() {
    statsd, err := statsd.New("127.0.0.1:8125")
    if err != nil {
        log.Fatal(err)
    }
}

Find a list of all the available options for your DogStatsD Client in the Datadog-go godoc documentation or in Datadog public DogStatsD documentation.

Supported environment variables

  • If the addr parameter is empty, the client uses the DD_AGENT_HOST and (optionally) the DD_DOGSTATSD_PORT environment variables to build a target address.
  • If the DD_ENTITY_ID environment variable is found, its value is injected as a global dd.internal.entity_id tag. The Datadog Agent uses this tag to insert container tags into the metrics. To avoid overwriting this global tag, only append to the c.Tags slice.

To enable origin detection and set the DD_ENTITY_ID environment variable, add the following lines to your application manifest:

env:
  - name: DD_ENTITY_ID
    valueFrom:
      fieldRef:
        fieldPath: metadata.uid
  • DD_ENV, DD_SERVICE, and DD_VERSION can be used by the statsd client to set {env, service, version} as global tags for all data emitted.

Unix Domain Sockets Client

Agent v6+ accepts packets through a Unix Socket datagram connection. Details about the advantages of using UDS over UDP are available in the DogStatsD Unix Socket documentation. You can use this protocol by giving a unix:///path/to/dsd.socket address argument to the New constructor.

Usage

In order to use DogStatsD metrics, events, and Service Checks, the Agent must be running and available.

Metrics

After the client is created, you can start sending custom metrics to Datadog. See the dedicated Metric Submission: DogStatsD documentation to see how to submit all supported metric types to Datadog with working code examples:

Metric names must only contain ASCII alphanumerics, underscores, and periods. The client will not replace nor check for invalid characters.

Some options are suppported when submitting metrics, like applying a sample rate to your metrics or tagging your metrics with your custom tags. Find all the available functions to report metrics in the Datadog Go client GoDoc documentation.

Events

After the client is created, you can start sending events to your Datadog Event Stream. See the dedicated Event Submission: DogStatsD documentation to see how to submit an event to your Datadog Event Stream.

Service Checks

After the client is created, you can start sending Service Checks to Datadog. See the dedicated Service Check Submission: DogStatsD documentation to see how to submit a Service Check to Datadog.

Performance / Metric drops

Monitoring this client

This client automatically injects telemetry about itself in the DogStatsD stream. Those metrics will not be counted as custom and will not be billed. This feature can be disabled using the WithoutTelemetry option.

See Telemetry documentation to learn more about it.

Tweaking kernel options

In very high throughput environments it is possible to improve performance by changing the values of some kernel options.

Unix Domain Sockets

  • sysctl -w net.unix.max_dgram_qlen=X - Set datagram queue size to X (default value is usually 10).
  • sysctl -w net.core.wmem_max=X - Set the max size of the send buffer for all the host sockets.

Maximum packets size in high-throughput scenarios

In order to have the most efficient use of this library in high-throughput scenarios, default values for the maximum packets size have already been set to have the best usage of the underlying network. However, if you perfectly know your network and you know that a different value for the maximum packets size should be used, you can set it with the option WithMaxBytesPerPayload. Example:

package main

import (
    "log"
    "github.com/DataDog/datadog-go/statsd"
)

func main() {
    statsd, err := statsd.New("127.0.0.1:8125", WithMaxBytesPerPayload(4096))
    if err != nil {
        log.Fatal(err)
    }
}

Development

Run the tests with:

$ go test

License

datadog-go is released under the MIT license.

Credits

Original code by ooyala.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].