Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/msoedov/graphitex
Graphite client for Elixir
https://github.com/msoedov/graphitex
carbon elixir graphite graphite-client monitoring
Last synced: 19 days ago
JSON representation
Graphite client for Elixir
- Host: GitHub
- URL: https://github.com/msoedov/graphitex
- Owner: msoedov
- License: mit
- Created: 2017-04-12T23:37:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-25T22:50:00.000Z (over 6 years ago)
- Last Synced: 2024-10-12T19:03:08.901Z (22 days ago)
- Topics: carbon, elixir, graphite, graphite-client, monitoring
- Language: Elixir
- Size: 26.4 KB
- Stars: 4
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Graphite/Carbon client for Elixir. (Instrumenting / Monitoring)
- fucking-awesome-elixir - graphitex - Graphite/Carbon client for Elixir. (Instrumenting / Monitoring)
- awesome-elixir - graphitex - Graphite/Carbon client for Elixir. (Instrumenting / Monitoring)
README
# Graphitex
Graphite client for Elixir with zero dependencies
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/msoedov/graphitex/blob/master/LICENSE)
[![Hex Version](https://img.shields.io/hexpm/v/graphitex.svg)](https://hex.pm/packages/graphitex)
[![Build Status](https://travis-ci.org/msoedov/graphitex.svg?branch=master)](https://travis-ci.org/msoedov/graphitex)## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed as:
1. Add `graphitex` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:graphitex, "~> 0.1.0"}]
end
```2. Ensure `graphitex` is started before your application:
```elixir
def application do
[applications: [:graphitex]]
end```
3. Set up configuration in `config.config.exs`:```elixir
config :graphitex, host: '188.166.101.102', port: 2003```
4. API:```elixir
Graphitex.metric(4, "aws.cluster_one.avg_cpu")
# or
Graphitex.metric(4, ["aws", "cluster_one", "avg_cpu"])
# or
Graphitex.metric(41.0, [:aws, :cluster_one, :avg_cpu])
```by default `:os.system_time(:seconds)` used as timestamp, but you can pass `ts` as an argument
```elixir
Graphitex.metric(41, "aws.cluster_one.avg_cpu",:os.system_time(:seconds))```
likewise there is a shortcut```elixir
Graphitex.metric(41, "aws.cluster_one.avg_cpu", Graphitex.now)```
Insert batch:
```elixir
[{4, "client.transactions.east"},
{2, "client.transactions.west"},
{5, "client.transactions.north", Graphitex.now}
]
|> Graphitex.metric_batch(batch)```