Tracing over several components

#1

Hi,

I would like to add a log component to my services. The main goal is to be able to log events from any component connected to the same realm in order to be able to see what happens when the user starts an action: i.e. I want to see what they entered in the web UI, then which RPC is called then what the method does. For a developer, it should be easy to follow a chain of log events as the data flows through the system.

For that, I need to attach some kind of “ID” to each such chain of events and I’m thinking about the best way to do this. The most simple solution would be to create this ID on the client and pass it to every RPC call which sounds like a “too simple” solution - it just touches too much code.

But my feeling is that Autobahn needs to track results of RPC calls somehow, so it needs to have a similar mechanism and I was wondering whether I could tap into that somehow. Note that the ID doesn’t need to stay the same. If all log events created in a method can be grouped by the same ID, then eventually there will be an event “RPC was called” with the old ID plus the new one, so I could follow the chain.

I saw “discloseMe” in the code but I couldn’t find an example where it is used and, especially on the receiver’s end.

Regards,

A. Digulla

0 Likes

#2

Every RPC call, every subscription, every publish is associated with an unique id. Although transmitted in the WAMP messages, autobahn doesn’t expose an API to access those ids as far as I know. The discloseMe or discloseCaller options, do exactly what they state. If set to true, a callee can inspect the identity of a caller with the CallDetails object passed to it. See RegisterOptions on how you can instruct autobahn to make those informations available to you. The whole thing is not documented very well.

···

Am Samstag, 14. Februar 2015 14:55:02 UTC+1 schrieb Aaron Digulla:

Hi,

I would like to add a log component to my services. The main goal is to be able to log events from any component connected to the same realm in order to be able to see what happens when the user starts an action: i.e. I want to see what they entered in the web UI, then which RPC is called then what the method does. For a developer, it should be easy to follow a chain of log events as the data flows through the system.

For that, I need to attach some kind of “ID” to each such chain of events and I’m thinking about the best way to do this. The most simple solution would be to create this ID on the client and pass it to every RPC call which sounds like a “too simple” solution - it just touches too much code.

But my feeling is that Autobahn needs to track results of RPC calls somehow, so it needs to have a similar mechanism and I was wondering whether I could tap into that somehow. Note that the ID doesn’t need to stay the same. If all log events created in a method can be grouped by the same ID, then eventually there will be an event “RPC was called” with the old ID plus the new one, so I could follow the chain.

I saw “discloseMe” in the code but I couldn’t find an example where it is used and, especially on the receiver’s end.

Regards,

A. Digulla

0 Likes

#3

I think a better approach was to install a hook in the system which attaches logs the ID generated during publish and receive. Received IDs should go into a thread-local variable. When a new ID is generated, the logging system should log both IDs.

Then I could configure the logging system to log to a central place. There, I could search for the two IDs and generate full traces of business cases (i.e. with all log messages involved on all systems).

Is there a way to configure such a hook in WAMP of Autobahn?

···

On Saturday, February 14, 2015 at 3:58:53 PM UTC+1, Paranaix wrote:

Every RPC call, every subscription, every publish is associated with an unique id. Although transmitted in the WAMP messages, autobahn doesn’t expose an API to access those ids as far as I know. The discloseMe or discloseCaller options, do exactly what they state. If set to true, a callee can inspect the identity of a caller with the CallDetails object passed to it. See RegisterOptions on how you can instruct autobahn to make those informations available to you. The whole thing is not documented very well.

Am Samstag, 14. Februar 2015 14:55:02 UTC+1 schrieb Aaron Digulla:

Hi,

I would like to add a log component to my services. The main goal is to be able to log events from any component connected to the same realm in order to be able to see what happens when the user starts an action: i.e. I want to see what they entered in the web UI, then which RPC is called then what the method does. For a developer, it should be easy to follow a chain of log events as the data flows through the system.

For that, I need to attach some kind of “ID” to each such chain of events and I’m thinking about the best way to do this. The most simple solution would be to create this ID on the client and pass it to every RPC call which sounds like a “too simple” solution - it just touches too much code.

But my feeling is that Autobahn needs to track results of RPC calls somehow, so it needs to have a similar mechanism and I was wondering whether I could tap into that somehow. Note that the ID doesn’t need to stay the same. If all log events created in a method can be grouped by the same ID, then eventually there will be an event “RPC was called” with the old ID plus the new one, so I could follow the chain.

I saw “discloseMe” in the code but I couldn’t find an example where it is used and, especially on the receiver’s end.

Regards,

A. Digulla

0 Likes

#4

No, because the right place to do such things is the router, not the clients/endpoints.

Cheers,
/Tobias

···

Am 31.07.2016 um 12:29 schrieb Aaron Digulla:

I think a better approach was to install a hook in the system which
attaches logs the ID generated during publish and receive. Received IDs
should go into a thread-local variable. When a new ID is generated, the
logging system should log both IDs.

Then I could configure the logging system to log to a central place. There,
I could search for the two IDs and generate full traces of business cases
(i.e. with all log messages involved on all systems).

Is there a way to configure such a hook in WAMP of Autobahn?

0 Likes

#5

Any pointers how I could configure crossbar.io to do what I want?

Regards,

Aaron

···

On Monday, August 1, 2016 at 8:47:02 AM UTC+2, Tobias Oberstein wrote:

Am 31.07.2016 um 12:29 schrieb Aaron Digulla:

I think a better approach was to install a hook in the system which

attaches logs the ID generated during publish and receive. Received IDs

should go into a thread-local variable. When a new ID is generated, the

logging system should log both IDs.

Then I could configure the logging system to log to a central place. There,

I could search for the two IDs and generate full traces of business cases

(i.e. with all log messages involved on all systems).

Is there a way to configure such a hook in WAMP of Autobahn?

No, because the right place to do such things is the router, not the
clients/endpoints.

0 Likes