Skip to content

Commit

Permalink
Updated README with description of generator implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderYastrebov committed Jun 29, 2016
1 parent c5d8357 commit 4596893
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions README.md
Expand Up @@ -83,23 +83,37 @@ entity.setLastModifiedBy(trace.getValue());

### Generators

When starting a new trace, *Tracer* will create a time-based UUID by default. You can override this on a per-trace level by adding the following to your setup:
When starting a new trace, *Tracer* will create trace value by means of pre-configured generator.
You can override this on a per-trace level by adding the following to your setup:

```java
Tracer tracer = Tracer.builder()
.trace("X-Trace-ID", new CustomGenerator())
.build();
```

For legacy reasons we use a different generator internally, the `FlowIDGenerator`. It basically renders a UUID as a base64-encoded byte array, e.g. `REcCvlqMSReeo7adheiYFA`.
There are several generator implementations included.

There is also `PhraseGenerator` provided which generates over 10^9 different phrases like:
#### UUIDGenerator

This is the default generator implementation.
It creates 36 characters long, random-based UUID string as a trace value.

#### FlowIDGenerator

This generator was created for historical reasons.
It basically renders a UUID as a base64-encoded byte array, e.g. `REcCvlqMSReeo7adheiYFA`.
The length of generated value is 22 characters.

#### PhraseGenerator

Phrase generator provides over 10^9 different phrases like:

tender_goodall_likes_evil_panini
nostalgic_boyd_helps_agitated_noyce
pensive_allen_tells_fervent_einstein

The generated phrase is 22 to 61 characters long.
The generated phrase is 22 to 61 character long.

### Listeners

Expand Down

0 comments on commit 4596893

Please sign in to comment.