top

Example of using the graphiteNop feature in action:

package mylib

import (
    "github.com/marpaia/graphite-golang"
    "log"
)

func init() {

    // load your configuration file / mechanism
    config := newConfig()

    // try to connect a graphite server
    if config.GraphiteEnabled {
        Graphite, err = graphite.NewGraphite(config.Graphite.Host, config.Graphite.Port)
    } else {
        Graphite = graphite.NewGraphiteNop(config.Graphite.Host, config.Graphite.Port)
    }
    // if you couldn't connect to graphite, use a nop
    if err != nil {
        Graphite = graphite.NewGraphiteNop(config.Graphite.Host, config.Graphite.Port)
    }

    log.Printf("Loaded Graphite connection: %#v", Graphite)
    Graphite.SimpleSend("stats.graphite_loaded", 1)
}

func doWork() {
    // this will work just fine, regardless of if you're working with a graphite
    // nop or not
    Graphite.SimpleSend("stats.doing_work", 1)
}

Imported by 49 package(s) ΒΆ

  1. github.com/BuJo/goneo/web
  2. github.com/IRCody/snap-plugin-publisher-graphite/graphite
  3. github.com/JensRantil/http-pinger
  4. github.com/ProTip/cw-engine/cwengine
  5. github.com/ProTip/mysql-engine
  6. github.com/aalpern/locust2graphite
  7. github.com/akashihi/graphite-haproxy
  8. github.com/akashihi/graphite-memcached
  9. github.com/akashihi/graphite-mongo
  10. github.com/akashihi/graphite-mysql
  11. github.com/akashihi/graphite-nginx
  12. github.com/akashihi/graphite-phpfpm
  13. github.com/akashihi/graphite-redis
  14. github.com/akashihi/graphite-squid
  15. github.com/andyxning/heapster/metrics/sinks/graphite
  16. github.com/bluebreezecf/heapster/metrics/sinks/graphite
  17. github.com/burmanm/heapster/metrics/sinks/graphite
  18. github.com/cblomart/vsphere-graphite
  19. github.com/chrissnell/crabby
  20. github.com/diocles/cm160-graphite
  21. github.com/divan/locust2graphite
  22. github.com/eholzbach/temp
  23. github.com/eliothedeman/bangarang/escalation/grafana-graphite-annotation
  24. github.com/fluxio/metricd/plugins
  25. github.com/hizel/pingd
  26. github.com/intelsdi-x/snap-plugin-publisher-graphite/graphite
  27. github.com/johntdyer/autoscale-grapher
  28. github.com/kubernetes/heapster/metrics/sinks/graphite
  29. github.com/latencia/mosquitto-stats
  30. github.com/latencia/mtr-collect
  31. github.com/lenfree/vcenter-metrics/metrics
  32. github.com/loggi/pglog-carbonizer
  33. github.com/loggi/pglog-carbonizer/pglog_carbonizer
  34. github.com/mavlyutov/golagraphite
  35. github.com/mavlyutov/golagraphite/golagraphite
  36. github.com/miolini/rabbitmq-graphite-tool
  37. github.com/orofarne/hmetrics2-graphite
  38. github.com/patdowney/stopgap/metrics
  39. github.com/protip/cw-engine/cwengine
  40. github.com/protip/mysql-engine
  41. github.com/samitpal/goProbe/metric_export
  42. github.com/samitpal/goProbe/push_metric/provider
  43. github.com/skx/overseer
  44. github.com/skx/puppet-summary
  45. github.com/skyrings/skyring-common/monitoring/graphitemanager
  46. github.com/ventu-io/probe/server/reporting/handler
  47. github.com/victorcete/redis-scouter
  48. github.com/vimeo/graphite-aggregation-backfiller
  49. github.com/voxmedia/varniphite