ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - adamkittelson/dogstatsd-elixir: An Elixir client for DogStatsd https://www.datadoghq.com/
An Elixir client for DogStatsd  https://www.datadoghq.com/ - adamkittelson/dogstatsd-elixir
Visit Site

GitHub - adamkittelson/dogstatsd-elixir: An Elixir client for DogStatsd  https://www.datadoghq.com/

GitHub - adamkittelson/dogstatsd-elixir: An Elixir client for DogStatsd https://www.datadoghq.com/

dogstatsd-elixir

A client for DogStatsd, an extension of the StatsD metric server for Datadog.

Build Status Coverage Status

Quick Start Guide

First install the library:

  1. Add dogstatsd to your mix.exs dependencies:

    def deps do
      [
        {:dogstatsd, "0.0.3"}
      ]
    end
    
  2. Add :dogstatsd to your application dependencies:

    def application do
      [applications: [:dogstatsd]]
    end
    

Then start instrumenting your code:

# Require the dogstatsd module.
require DogStatsd

# Configure DogStatsd.
{:ok, statsd} = DogStatsd.new("localhost", 8125)

# Increment a counter.
DogStatsd.increment(statsd, "page.views")

# Record a gauge 50% of the time.
DogStatsd.gauge(statsd, "users.online", 123, %{sample_rate: 0.5})

# Sample a histogram
DogStatsd.histogram(statsd, "file.upload.size", 1234)

# Time a block of code
DogStatsd.time(statsd, "page.render") do
  render_page('home.html')
end

# Send several metrics at the same time
# All metrics will be buffered and sent in one packet when the block completes
DogStatsd.batch(statsd, fn(s) ->
  s.increment(statsd, "page.views")
  s.gauge(statsd, "users.online", 123)
end)

# Tag a metric.
DogStatsd.histogram(statsd, "query.time", 10, %{tags: ["version:1"]})

You can also post events to your stream. You can tag them, set priority and even aggregate them with other events.

Aggregation in the stream is made on hostname/event_type/source_type/aggregation_key.

# Post a simple message
DogStatsd.event(statsd, "There might be a storm tomorrow", "A friend warned me earlier.")

# Cry for help
DogStatsd.event(statsd, "SO MUCH SNOW", "Started yesterday and it won't stop !!", %{alert_type: "error", tags: ["urgent", "endoftheworld"]})

Feedback

To suggest a feature, report a bug, or general discussion, head over here.

Change Log

  • 0.0.1
    • Initial release.

Credits

dogstatsd-elixir is a port of the Ruby DogStatsd client

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory