diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2017-04-24 13:54:40 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2017-04-24 13:54:40 +0200 |
commit | 4d828e1a3195e55365c865aa3a78af9668742643 (patch) | |
tree | 07fff2683933c96297a8ba577bbdc89888da16e1 /kamon-examples/kamon-fluentd-example | |
parent | 469c11dc1ddb140f407a33f48033e533bf60611c (diff) | |
download | Kamon-4d828e1a3195e55365c865aa3a78af9668742643.tar.gz Kamon-4d828e1a3195e55365c865aa3a78af9668742643.tar.bz2 Kamon-4d828e1a3195e55365c865aa3a78af9668742643.zip |
Prepare for the major cleanup
Moved all the original files from src/main to src/legacy-main, same with test files. Also
removed the autoweave module, examples and bench as I'm planning to have them in separate
repositories.
Diffstat (limited to 'kamon-examples/kamon-fluentd-example')
6 files changed, 0 insertions, 202 deletions
diff --git a/kamon-examples/kamon-fluentd-example/README.md b/kamon-examples/kamon-fluentd-example/README.md deleted file mode 100644 index 0dc6a250..00000000 --- a/kamon-examples/kamon-fluentd-example/README.md +++ /dev/null @@ -1,31 +0,0 @@ -kamon-fluentd-example ------------------------------- - -An example Spray application with Kamon monitoring reporting to Fluentd Server. - -Prerequisites ---------------- -* fluentd: - ```sh - you@host:kamon-fluentd-example $ gem install fluentd - ``` - -* install kamon snapshots to local: - ```sh - you@host:kamon-fluentd-example $ cd ../../ - you@host:Kamon $ sbt "+ publishLocal" - ... snip... - [info] published ivy to /Users/___/.ivy2/local/io.kamon/kamon-akka-remote_2.11/0.5.2-021ffd253e104342e6b4c75ae42717b51e3b6b26/ivys/ivy.xml - [success] Total time: 248 s, completed 2015/10/04 0:27:53 - [info] Setting version to 2.10.4 - [info] Reapplying settings... - [info] Set current project to kamon (in build file:/Users/___/kamon-io/Kamon/) - ``` - -* edit build.sbt. edit `kamonV` variable with installed snapshot version (`0.5.2-021ffd253e104342e6b4c75ae42717b51e3b6b26` in the above example). - -How to run ------------- -1. just do it: `sbt aspectj-runner:run` -2. you'll see kamon-log-reporter outputs on console. -3. you'll also see kamon metrics sent to fluentd on files named `target/fluentd_out.****` diff --git a/kamon-examples/kamon-fluentd-example/build.sbt b/kamon-examples/kamon-fluentd-example/build.sbt deleted file mode 100644 index a240fad3..00000000 --- a/kamon-examples/kamon-fluentd-example/build.sbt +++ /dev/null @@ -1,31 +0,0 @@ -import sbt._ -import sbt.Keys._ - -name := "kamon-fluentd-example" - -version := "1.0" - -scalaVersion := "2.11.6" - -resolvers += "Kamon repo" at "http://repo.kamon.io" - -resolvers += "spray repo" at "http://repo.spray.io" - -libraryDependencies ++= { - val akkaV = "2.3.5" - val sprayV = "1.3.1" - val kamonV = "EDIT_HERE" - Seq( - "io.spray" %% "spray-can" % sprayV, - "io.spray" %% "spray-routing" % sprayV, - "io.kamon" %% "kamon-core" % kamonV, - "io.kamon" %% "kamon-system-metrics" % kamonV, - "io.kamon" %% "kamon-akka" % kamonV, - "io.kamon" %% "kamon-scala" % kamonV, - "io.kamon" %% "kamon-spray" % kamonV, - "io.kamon" %% "kamon-fluentd" % kamonV, - "io.kamon" %% "kamon-log-reporter" % kamonV, - "org.aspectj" % "aspectjweaver" % "1.8.4" - ) -} - diff --git a/kamon-examples/kamon-fluentd-example/project/build.properties b/kamon-examples/kamon-fluentd-example/project/build.properties deleted file mode 100644 index df58110a..00000000 --- a/kamon-examples/kamon-fluentd-example/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=0.13.6
\ No newline at end of file diff --git a/kamon-examples/kamon-fluentd-example/project/plugins.sbt b/kamon-examples/kamon-fluentd-example/project/plugins.sbt deleted file mode 100644 index ab3750e2..00000000 --- a/kamon-examples/kamon-fluentd-example/project/plugins.sbt +++ /dev/null @@ -1,6 +0,0 @@ -resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/" - -resolvers += "Kamon Releases" at "http://repo.kamon.io" - -addSbtPlugin("io.kamon" % "aspectj-runner" % "0.1.2") - diff --git a/kamon-examples/kamon-fluentd-example/src/main/resources/application.conf b/kamon-examples/kamon-fluentd-example/src/main/resources/application.conf deleted file mode 100644 index bb69abd3..00000000 --- a/kamon-examples/kamon-fluentd-example/src/main/resources/application.conf +++ /dev/null @@ -1,73 +0,0 @@ -# ===================================== # -# Kamon-Fluentd Reference Configuration # -# ===================================== # - -kamon { - metric.filters { - akka-actor { - includes = ["**"], - } - - akka-dispatcher { - includes = ["**"] - } - - akka-router { - includes = ["**"] - } - } - - fluentd { - # Hostname and port of fluentd server to which kamon fluentd sends metrics. - hostname = "localhost" - port = 24224 - - # tag prefix of metrics data which is sent to fluentd server - tag = "kamon.fluentd" - - # Interval between metrics data flushes to fluentd server. - # It's value must be equal or greater than the kamon.metric.tick-interval setting. - flush-interval = 10 seconds - - # Your app name - application-name = "kamon-fluentd-example" - - # Subscription patterns used to select which metrics will be pushed to Fluentd. Note that first, metrics - # collection for your desired entities must be activated under the kamon.metrics.filters settings. - subscriptions { - histogram = [ "**" ] - min-max-counter = [ "**" ] - gauge = [ "**" ] - counter = [ "**" ] - trace = [ "**" ] - trace-segment = [ "**" ] - akka-actor = [ "**" ] - akka-dispatcher = [ "**" ] - akka-router = [ "**" ] - system-metric = [ "**" ] - http-server = [ "**" ] - } - - # statistic values to be reported for histogram type metrics - # (i.e. Histogram, MinMaxCounter, Gauge). - histogram-stats { - # stats values: - # "count", "min", "max", "average", "percentiles" are supported. - # you can use "*" for wildcards. - subscription = [ "count", "min", "max", "average", "percentiles" ], - - # percentile points: - # this will be used when you set "percentiles" in "subscription" above. - # In this example, kamon-fluentd reports 50th 90th, 99th and 99.9th percentiles. - percentiles = [50.0, 90.0, 99.0, 99.9] - } - } - - modules { - kamon-fluentd { - auto-start = yes - requires-aspectj = no - extension-class = "kamon.fluentd.Fluentd" - } - } -}
\ No newline at end of file diff --git a/kamon-examples/kamon-fluentd-example/src/main/scala/KamonFluentdExample.scala b/kamon-examples/kamon-fluentd-example/src/main/scala/KamonFluentdExample.scala deleted file mode 100644 index bb1d0f7b..00000000 --- a/kamon-examples/kamon-fluentd-example/src/main/scala/KamonFluentdExample.scala +++ /dev/null @@ -1,60 +0,0 @@ -/* ========================================================================================= - * Copyright © 2013-2015 the kamon project <http://kamon.io/> - * - * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file - * except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - * ========================================================================================= - */ - -import akka.actor.ActorSystem -import kamon.Kamon -import spray.routing.SimpleRoutingApp -import xerial.fluentd.{ FluentdConfig, FluentdStandalone } - -import scala.util.Properties - -object KamonFluentdExample extends App with SimpleRoutingApp { - // Start fluentd server only for this sample app - // In real usecase, you will spawn fluentd server independently. - val fluentdServer = FluentdStandalone.start(FluentdConfig(configuration = - """ - |<source> - | type forward - | port 24224 - |</source> - |<match **> - | type file - | path target/fluentd-out - |</match> - """.stripMargin)) - sys.addShutdownHook { - fluentdServer.stop - } - - // start Kamon - Kamon.start() - - implicit val system = ActorSystem("kamon-fluentd-example") - - // server endpoint - val interface = "0.0.0.0" - val port = Properties.envOrElse("PORT", "8080").toInt - - // resource endpoints - startServer(interface = interface, port = port) { - path("hello") { - get { - complete { - <h1>Hello! Kamon Fluentd Example!</h1> - } - } - } - } -} |