Giter Club home page Giter Club logo

reporter's Introduction

reporter: event, errors and metric reporting component

Build Status Clojars Project

The reporter component makes it easy to wire-in support for the following in your components:

  • Event reporting to riemann
  • Metric reporting with metrics with support for JMX, Riemann and Console output
  • Error captures to sentry
  • Expose prometheus metrics via HTTP
  • Send metrics to PushGateway

Reporter provides a component in order to be declared as a dependency in other components.

Usage

Clojars Project

Changelog

1.0.2

  • Reporter's sentry config supports the following keys :dsn, :environment, :release, :tags
    • sentry-options are deprecated

1.0.0

  • Migrating from exoscale/raven to io.sentry/sentry-clj
    • SENTRY_ env vars are no longer automatically forwarded
  • raven-options renamed to sentry-options within spootnik.reporter.impl/Reporter signature

0.2.0

  • Allow arbitray values for counter

0.1.60

  • Use :ca-cert config key instead of :authority

0.1.44

  • Mark global reporter as :redef

0.1.43

  • Bump prometheus simpleclient to 0.8.0

0.1.42

  • Add embedded HTTP server for prometheus metrics

0.1.41

  • A reporter instance is now available in the spootnik.reporter namespace.

0.1.40

  • Prometheus output
  • Log exceptions in capture! even if the sentry dsn is not configured.

0.1.39

  • Fix 0.1.38

0.1.38

  • Fix stop! to accept a context rather than an alias

0.1.37

  • Updated Clojure to 1.10.0
  • Updated Component to 0.4.0

0.1.36

  • Updated raven dependency to 0.4.6

0.1.35

  • Add slf4j as a destination (#28)
  • Extract build-metrics-reporter from build-metrics-reporters (#26)
  • Replace when + not with when-not (#25)

0.1.34

  • Updated raven dependency to 0.4.5

0.1.33

  • Updated raven dependency to 0.4.4

0.1.32

  • Added support for multiple aleph options.

0.1.31

  • Updated raven dependency to 0.4.2
  • Added support for passing aleph connection pools to raven.

0.1.27

  • Updated raven dependency to 0.3.1

0.1.26

  • Allow multiple Riemann events
  • Sentry events now log the Sentry UUID
  • Switched to Raven 0.3.0

0.1.25

  • Fixed arity bug in forwarding tags to Raven

0.1.24

  • Added support for new raven (capture!) arity
  • Switched to raven 0.2.0

0.1.22

  • Dependency updates

0.1.15

  • Bump to metrics-clojure 2.8.0
  • No more reflection

0.1.13

  • Make uncaught exception handler optional.
  • Start a registry, even with no reporters configured.

Version 0.1.10

  • Improve default configuration

Version 0.1.9

  • When tags are provided ensure that they are as a seq

Version 0.1.8

  • Implement the protocol for nil

Version 0.1.7

  • Allow TLS connections in the riemann client

Version 0.1.6

  • Send raven captures for uncaught exceptions.

Configuring

Reporter exposes a schema if you wish to validate config, simply pull-in schema.core and either use spootnik.reporter/config-schema as an argument to schema.core/validate or use the handy function spootnik.reporter/config-validator.

Using

Start the component with

(spootnik.reporter/initialize! reporter-config)

Once started, the spootnik.reporter/reporter variable will contain your component. You can then use the following signatures:

(defprotocol RiemannSink
  (send! [this e]))

(defprotocol SentrySink
  (capture! [this e]))

(defprotocol PushGatewaySink
  (gauge! [this e])
  (counter! [this e]))

(defprotocol MetricHolder
  (instrument! [this prefix])
  (build! [this type alias] [this type alias f])
  (inc! [this alias] [this alias v])
  (dec! [this alias] [this alias v])
  (mark! [this alias])
  (update! [this alias v])
  (time-fn! [this alias f])
  (start! [this alias])
  (stop! [this alias]))

The spootnik.reporter namespace contains helper functions to interact with the reporter instance.

Redistribution

Copyright © 2016 Pierre-Yves Ritschard [email protected], MIT/ISC License.

reporter's People

Contributors

arthuraliiev avatar bcachet avatar chrisglass avatar fumesover avatar giorgio-v avatar greut avatar ifesdjeen avatar igrishaev avatar jeremyvdw avatar mcorbin avatar mpenet avatar mping avatar mping-exo avatar pyr avatar sfriesel avatar tgrondier avatar vincentbernat avatar wdullaer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reporter's Issues

Ability to register metrics

If we don't register the metrics beforehand, they appear only when they are incremented. If they are rarely incremented, the metric may be absent and this can be handled correctly or not by the supervision system. A way to register metrics on start (and automatically remove them on stop) would be great.

Ability to query metrics

Hey!

During testing, it may be convenient to be able to query collected metrics. Just giving access to the metric registry would do the trick. It would also allow to use the ring middleware from metrics.

Request: reconciliate log output and sentry event id

It would be super lovely to have the Sentry Event ID into the logs.

now

{"@timestamp":"2018-05-23T16:42:45.090+02:00","@Version":1,"message":"captured exception","logger_name":"spootnik.reporter",

proposed

"message", "captured exception (eventid: 7b1fbbc69a3b40398676ac59920d7a06)", ...

So taking that a doing a search in sentry brings us to the right place.

https://sentry.internal.exoscale.ch/exoscale/api-gateway/issues/796/events/77430/

Thanks!

Add support for Integrant

Hi,
I’d like to float the idea of adding Integrant support to this project. It seems like a nice addition to me, but of course I’d like to know your thoughts on this.

Details are a bit fuzzy at this moment and I can provide them if you think the idea has any merit.

Please let me know. :)

riemann: no channels available

once in a while, this pops up.

class java.io.IOException: no channels available
    atcom.aphyr.riemann.client.TcpTransport.sendMessage(TcpTransport.java:289)
    atcom.aphyr.riemann.client.TcpTransport.sendMessage(TcpTransport.java:259)
    atcom.aphyr.riemann.client.RiemannClient.sendMessage(RiemannClient.java:110)
    atcom.aphyr.riemann.client.RiemannClient.sendEvents(RiemannClient.java:125)
    atspootnik.reporter$riemann_send.invokeStatic(reporter.clj:115)
    atspootnik.reporter$riemann_send.invoke(reporter.clj:112)
    atspootnik.reporter$riemann_events_BANG_.invokeStatic(reporter.clj:122)
    atspootnik.reporter$riemann_events_BANG_.invoke(reporter.clj:117)
    atspootnik.reporter.Reporter.send_BANG_(reporter.clj:277)
    atspootnik.reporter$fn__15439$G__15435__15442.invoke(reporter.clj:31)
    atspootnik.reporter$fn__15439$G__15434__15446.invoke(reporter.clj:31)
    atclojure.lang.AFn.applyToHelper(AFn.java:156)
    atclojure.lang.AFn.applyTo(AFn.java:144)
    atclojure.core$apply.invokeStatic(core.clj:659)
    atclojure.core$apply.invoke(core.clj:652)
    atobwald.report$send_BANG_.invokeStatic(report.clj:29)
    atobwald.report$send_BANG_.doInvoke(report.clj:29)
    atclojure.lang.RestFn.invoke(RestFn.java:408)
    atobwald.pool$report_stats.invokeStatic(pool.clj:49)
    atobwald.pool$report_stats.invoke(pool.clj:44)
    ataleph.flow$instrumented_pool$reify__17851.adjustment(flow.clj:67)
    atio.aleph.dirigiste.Pool.startControlLoop(Pool.java:321)
    atio.aleph.dirigiste.Pool.access$500(Pool.java:8)
    atio.aleph.dirigiste.Pool$1.run(Pool.java:381)
    atjava.lang.Thread.run(Thread.java:748)

SentryID: 6e631f2a8ae643d7a468cff48c798a9d

Don't automatically catch exceptions when enabling Sentry support

Hey!

When enabling Sentry support, uncaught exceptions are automatically intercepted. This is surprising for a library to take over exceptions and an application may want to do things differently and invoke capture! manually. Let the user opt-out (or opt-in) on exception catching.

metrics to riemann dies silently

config

reporter:
  metrics:
    reporters:
      console:
        interval: 5
      riemann:
        interval: 5
        opts:
          ttl: 600
          host-name: "testing-yoan"
          tags:
          - graph
  riemann:
    host: "RIEMANN_HOST"
    port: 5554
    protocol: tls
    defaults:
      ttl: 600
      host: "testing-yoan"
      tags:
      - graph
    tls:
      authority: ca.pem
      cert: cert.pem
      pkey: key.pk8

output

INFO [2018-07-25 10:25:54,575] main - spootnik.reporter building metrics reporters {:riemann {:interval 5, :opts {:ttl 600, :host-name testing-yoan, :tags [graph]}}}                                                                                                        
INFO [2018-07-25 10:25:56,423] main - obwald.main system started

as long as no metrics are present, it seems fine.

DEBUG [2018-07-25 10:25:59,596] metrics-riemann-reporter-1-thread-1 - 
DEBUG [2018-07-25 10:30:57,183] metrics-riemann-reporter-2-thread-1 - com.codahale.metrics.riemann.RiemannReporter Reporting metrics: for 1532
507457 at 1532507457183                                                         
DEBUG [2018-07-25 10:30:57,184] metrics-riemann-reporter-2-thread-1 - com.codahale.metrics.riemann.RiemannReporter Completed at 1532507457184

after the first one, it dies silently.

INFO [2018-07-25 10:25:57,226] manifold-pool-2-1 - spootnik.reporter time-fn! compute.command.listZones
com.codahale.metrics.riemann.RiemannReporter Reporting metrics: for 1532507159 at 1532507159596

Reporters should not be mandatory

Again,

Currently, metric registry is only created if reporter are provided. However, we may want to collect metrics without reporters. For example, the metrics could be used through some ring middleware. Or they could be queried during tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.