-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some docs on using tracing #597
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Using Tracing in ACA-PY | ||
|
||
The aca-py agent supports message tracing, according to the [Tracing RFC](https://github.com/hyperledger/aries-rfcs/tree/master/features/0034-message-tracing). | ||
|
||
Tracing can be enabled globally, for all messages/events, or it can be enabled on an exchange-by-exchange basis. | ||
|
||
Tracing is configured globally for the agent. | ||
|
||
## ACA-PY Configuration | ||
|
||
The following options can be specified when starting the aca-py agent: | ||
|
||
``` | ||
--trace Generate tracing events. | ||
--trace-target <trace-target> | ||
Target for trace events ("log", "message", or http | ||
endpoint). | ||
--trace-tag <trace-tag> | ||
Tag to be included when logging events. | ||
--trace-label <trace-label> | ||
Label (agent name) used logging events. | ||
``` | ||
|
||
The `--trace` option enables tracing globally for the agent, the other options can configure the trace destination and content (default is `log`). | ||
|
||
Tracing can be enabled on an exchange-by-exchange basis, by including `{ ... "trace": True, ...}` in the JSON payload to the API call (for credential and proof exchanges). | ||
|
||
## Enabling Tracing in the Alice/Faber Demo | ||
|
||
The `run_demo` script supports the following parameters and environment variables. | ||
|
||
Environment variables: | ||
|
||
``` | ||
TRACE_ENABLED Flag to enable tracing | ||
|
||
TRACE_TARGET_URL Host:port of endpoint to log trace events (e.g. fluentd:8088) | ||
|
||
DOCKER_NET Docker network to join (must be used if EFK stack is running in docker) | ||
|
||
TRACE_TAG Tag to be included in all logged trace events | ||
``` | ||
|
||
Parameters: | ||
|
||
``` | ||
--trace-log Enables tracing to the standard log output | ||
(sets TRACE_ENABLED, TRACE_TARGET, TRACE_TAG) | ||
|
||
--trace-http Enables tracing to an HTTP endpoint (specified by TRACE_TARGET_URL) | ||
(sets TRACE_ENABLED, TRACE_TARGET, TRACE_TAG) | ||
``` | ||
|
||
When running the Faber controller, tracing can be enabled using the `T` menu option: | ||
|
||
```bash | ||
Faber | Connected | ||
(1) Issue Credential | ||
(2) Send Proof Request | ||
(3) Send Message | ||
(T) Toggle tracing on credential/proof exchange | ||
(X) Exit? | ||
[1/2/3/T/X] t | ||
|
||
>>> Credential/Proof Exchange Tracing is ON | ||
(1) Issue Credential | ||
(2) Send Proof Request | ||
(3) Send Message | ||
(T) Toggle tracing on credential/proof exchange | ||
(X) Exit? | ||
|
||
[1/2/3/T/X] t | ||
|
||
>>> Credential/Proof Exchange Tracing is OFF | ||
(1) Issue Credential | ||
(2) Send Proof Request | ||
(3) Send Message | ||
(T) Toggle tracing on credential/proof exchange | ||
(X) Exit? | ||
|
||
[1/2/3/T/X] | ||
``` | ||
|
||
When `Exchange Tracing` is `ON`, all exchanges will include tracing. | ||
|
||
## Logging Trace Events to an EFK Stack | ||
|
||
You can use the `EFK` stack in the [EFK sub-directory](./EFK-stack) as a target for trace events, just start the EFK stack using the docker-compose file and then in two separate bash shells, startup the demo as follows: | ||
|
||
```bash | ||
DOCKER_NET=efk-stack_efk_net TRACE_TARGET_URL=fluentd:8088 ./run_demo faber --trace-http | ||
``` | ||
|
||
```bash | ||
DOCKER_NET=efk-stack_efk_net TRACE_TARGET_URL=fluentd:8088 ./run_demo alice --trace-http | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The red operators because it expects bash syntax are a little distracting