basic repl usage

36 views
Skip to first unread message

David Smith

unread,
Jun 29, 2016, 7:26:52 AM6/29/16
to Riemann Users
I had a go at connecting to the repl, all went well but I quickly got stuck with 'what do I do now'. I couldn't find any guide on the internet as to how to do much with the repl.
  1. Is it possible to view incoming events in the repl?
  2. I need to get some basic understanding of cores, if I eval `(config/clear!)` then `(config/apply!)` my client (clojure) starts throwing errors with java.io.IOException: no channels available at com.aphyr.riemann.client.TcpTransport.sendMessage(TcpTransport.java:289) Presumably clearing the core stops the transport mechanism or is it just that the client isn't re-connecting properly?
Thanks.

Kyle Kingsbury

unread,
Jun 29, 2016, 9:38:32 AM6/29/16
to rieman...@googlegroups.com

For the first, no, though you could build a mechanism for it. Maybe use riemann.pubsub. Reading riemann/config.clj will probably help with the second question. In general, Riemann isn't really designed for repl use--I mean, you *can*, but editing riemann.config and using hot code reloading is probably a nicer user experience for any nontrivial work.

--
You received this message because you are subscribed to the Google Groups "Riemann Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to riemann-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Smith

unread,
Jun 29, 2016, 9:57:48 AM6/29/16
to rieman...@googlegroups.com
Thanks. I spent some time looking through config.clj but I don't quite understand. Presumably when I do clear! I basically remove everything that was in my rieman.config which includes the TCP server. If that is the case, how come my repl doesn't shut down as well?  Are these servers services?

--
You received this message because you are subscribed to a topic in the Google Groups "Riemann Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/riemann-users/_kWoSf9gVjU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to riemann-user...@googlegroups.com.

Aphyr

unread,
Jun 29, 2016, 10:30:32 AM6/29/16
to rieman...@googlegroups.com
On 06/29/2016 08:57 AM, David Smith wrote:
> Thanks. I spent some time looking through config.clj but I don't quite
> understand. Presumably when I do clear! I basically remove everything that was
> in my rieman.config which includes the TCP server. If that is the case, how come
> my repl doesn't shut down as well? Are these servers services?

Yes, servers are generally services. If you're not... intimately familiar with
Riemann internals, the REPL really isn't going to be very useful. It's not
something you ever need to use Riemann--in fact, aside from trying it out once,
I've *never* used it, and I wrote most of the darn thing. ;-)

--Kyle

David Smith

unread,
Jun 29, 2016, 10:35:02 AM6/29/16
to rieman...@googlegroups.com
OK, so what is your workflow for adding new things to the config? Do you use the test stuff a lot? I just thought it would be nice to write streams/functions in the repl and test them by putting events into the streams manually I guess. Then you can paste into the config. Initially I'm going to need to change the config quite a bit as we build it up and not having much (if any) knowledge of Riemann at this point I will make plenty of mistakes. It doesn't seem very good to just update the config and hope for  the best.

Aphyr

unread,
Jun 29, 2016, 10:36:47 AM6/29/16
to rieman...@googlegroups.com
On 06/29/2016 09:35 AM, David Smith wrote:
> OK, so what is your workflow for adding new things to the config? Do you use the
> test stuff a lot? I just thought it would be nice to write streams/functions in
> the repl and test them by putting events into the streams manually I guess. Then
> you can paste into the config. Initially I'm going to need to change the config
> quite a bit as we build it up and not having much (if any) knowledge of Riemann
> at this point I will make plenty of mistakes. It doesn't seem very good to just
> update the config and hope for the best.

Yep, I use riemann.test, and you can also forward traffic from your prod server
to a staging server, and test your config changes on staging before deploying to
prod. The usual traffic splitting/mirroring techniques apply too.

--Kyle

Aphyr

unread,
Jun 29, 2016, 10:38:18 AM6/29/16
to rieman...@googlegroups.com
On 06/29/2016 09:36 AM, Aphyr wrote:
> On 06/29/2016 09:35 AM, David Smith wrote:
>> OK, so what is your workflow for adding new things to the config? Do you use the
>> test stuff a lot? I just thought it would be nice to write streams/functions in
>> the repl and test them by putting events into the streams manually I guess. Then
>> you can paste into the config. Initially I'm going to need to change the config
>> quite a bit as we build it up and not having much (if any) knowledge of Riemann
>> at this point I will make plenty of mistakes. It doesn't seem very good to just
>> update the config and hope for the best.

Maybe I should also mention that experimenting with new streams in Riemann is
generally safe: most streams are side-effect free, which means you can introduce
new streams, tail the logs until you're satisfied with their effects, then hook
up the side effects at the leaves.

--Kyle

David Smith

unread,
Jun 29, 2016, 10:40:11 AM6/29/16
to rieman...@googlegroups.com
OK thanks. I'm looking forward to getting further into this, it's already made a difference to our way of thinking about logging and stats and has allowed us to do some really cool stuff using a manifold to provide a sort of interface around events and namespaced keywords for service names.



--Kyle

Reply all
Reply to author
Forward
0 new messages