All Projects → soundtrackyourbrand → Absinthe Metrics

soundtrackyourbrand / Absinthe Metrics

Licence: mit
Pluggable metrics for Absinthe based GraphQL backends

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Absinthe Metrics

Gtm
Simple, seamless, lightweight time tracking for Git
Stars: ✭ 857 (+2420.59%)
Mutual labels:  metrics
Prometheus Net
.NET library to instrument your code with Prometheus metrics
Stars: ✭ 944 (+2676.47%)
Mutual labels:  metrics
Go Grpc Prometheus
Prometheus monitoring for your gRPC Go servers.
Stars: ✭ 965 (+2738.24%)
Mutual labels:  metrics
Appmetrics
Node Application Metrics provides a foundational infrastructure for collecting resource and performance monitoring data for Node.js-based applications.
Stars: ✭ 864 (+2441.18%)
Mutual labels:  metrics
Vsphere2metrics
VMware vSphere Performance Metrics Integration with Graphite & InfluxDB
Stars: ✭ 28 (-17.65%)
Mutual labels:  metrics
Unifiedmetrics
Fully-featured metrics collection agent for Minecraft servers. Supports Prometheus and InfluxDB. Dashboard included out-of-box.
Stars: ✭ 29 (-14.71%)
Mutual labels:  metrics
Fathom
Fathom Lite. Simple, privacy-focused website analytics. Built with Golang & Preact.
Stars: ✭ 6,989 (+20455.88%)
Mutual labels:  metrics
I Codecnes
i-Code CNES is a static code analysis tool to help developpers write code compliant with CNES coding rules.
Stars: ✭ 33 (-2.94%)
Mutual labels:  metrics
Sensu Plugins Network Checks
This plugin provides native network instrumentation for monitoring and metrics collection, including: hardware, TCP response, RBLs, whois, port status, and more.
Stars: ✭ 28 (-17.65%)
Mutual labels:  metrics
Pgwatch2
PostgreSQL metrics monitor/dashboard
Stars: ✭ 960 (+2723.53%)
Mutual labels:  metrics
Analytics
Simple, open-source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics.
Stars: ✭ 9,469 (+27750%)
Mutual labels:  metrics
Sensu Plugins Process Checks
This plugin provides native process instrumentation for monitoring and metrics collection, including: process status, uptime, thread count, and others.
Stars: ✭ 20 (-41.18%)
Mutual labels:  metrics
Iperf3 exporter
Simple server that probes iPerf3 endpoints and exports results via HTTP for Prometheus consumption
Stars: ✭ 30 (-11.76%)
Mutual labels:  metrics
Pirate
Realtime metrics server written in Go
Stars: ✭ 11 (-67.65%)
Mutual labels:  metrics
Nginx Lua Prometheus
Prometheus metric library for Nginx written in Lua
Stars: ✭ 964 (+2735.29%)
Mutual labels:  metrics
Metrics Jvm Extras
A set of additional metrics complementing Dropwizards metrics-jvm.
Stars: ✭ 10 (-70.59%)
Mutual labels:  metrics
Ruby Gem Downloads Badge
Clean and simple gem downloads count badge, courtesy of http://shields.io/. You can checkout the application directly at the following URL:
Stars: ✭ 29 (-14.71%)
Mutual labels:  metrics
Core
Package core is a service container that elegantly bootstrap and coordinate twelve-factor apps in Go.
Stars: ✭ 34 (+0%)
Mutual labels:  metrics
Iota Prom Exporter
Iota Exporter for Prometheus Metrics
Stars: ✭ 33 (-2.94%)
Mutual labels:  metrics
Ipsec exporter
Prometheus exporter for IPsec metrics.
Stars: ✭ 30 (-11.76%)
Mutual labels:  metrics

AbsintheMetrics

Build Status

AbsintheMetrics provides time (or counter) based metrics for your Absinthe resolvers to allow you to keep track of where your queries are spending their time.

Usage is fairly straight forward,

defmodule MyApp.Instrumenter do
	use AbsintheMetrics,
			adapter: AbsintheMetrics.Backend.PrometheusHistogram,
			# See prometheus.ex for more examples
			arguments: [buckets: {:exponential, 250, 1.5, 7}]
end

defmodule MyApp.Schema do
  use Absinthe.Schema
  def middleware(middlewares, field, object) do
	  MyApp.Instrumenter.instrument(middlewares, field, object)
  end
end

# in application.ex

defmodule MyApp do
  def start(_type, _args) do
    # initialize all available metrics in your schema
	  MyApp.Instrumenter.install(MyApp.Schema)
		# ...
  end
end

How metrics are gathered depends on the backend, but for PrometheusHistogram the format is #{object}_#{field}_duration_microseconds or query_field_duration_microseconds for root queries.

Adding backends

Adding additional backends is pretty straight forward, you just need to implement the AbsintheMetrics behaviour,

defmodule LogBackend do
  @behaviour AbsintheMetrics
  require Logger

	# Called during application start to allow you to register
	# fields with your TSDB
  def field(object, field, _args \\ []) do
    Logger.info("install field #{object}_#{field}")
  end

	# Called every time a value is observed
	# status can be :ok or :error
  def instrument(object, field, {status, _result}, time) do
    metric = "#{object}_#{field}"
    case status do
      :error -> Logger.warn("#{metric} failed (took: #{inspect time})")
      :ok -> Logger.info("#{metric} took: #{inspect time}")
    end
  end
end

Installation

If available in Hex, the package can be installed by adding absinthe_metrics to your list of dependencies in mix.exs:

def deps do
  [
    {:absinthe_metrics, "~> 0.9.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/absinthe_metrics.

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].