Skip to content

Commit b756b23

Browse files
committed
make README.md better
1 parent 2858729 commit b756b23

File tree

2 files changed

+44
-48
lines changed

2 files changed

+44
-48
lines changed

README.md

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
Distributed Tracing Wrapper Libraries.
1+
This repository provides distributed tracing wrapper libraries which we use in our company.
22

3-
# Aim of this libraries
3+
# Aim of these libraries
44

5-
- Provide unified/tested set of libraries
5+
- Provide unified/tested sets of libraries
66
- No need to load/maintain various `contrib` libraries
7-
- Provide high-level & simple interface over tracing standard APIs (e.g. OpenCensus)
8-
- No need to know detail of API
9-
- Provides simple interface
10-
- Hide complicated object lifecycle of APIs (hide error prone things from you)
7+
- Provide high-level & simple interfaces over tracing standard APIs (e.g. OpenCensus)
8+
- No need to know details of APIs
9+
- Provide simple interfaces
10+
- Hide complicated object lifecycles of APIs (hide error prone things from you)
1111

12-
# Non-goal of this libraries
12+
# Non-goal of these libraries
1313

14-
- Do not aim to provide `agent`, _you need to activate/call this library explicitly_
15-
- Do not prefer to use dynamic code rewriting / monkey patching to minimize risk
16-
- To use feature of this library, please explicitly call/enable them
17-
- Do not aim to support all libraries in the world (HTTP client library, logging library, ...)
18-
- Focus on use case in our company.
19-
- If you want to add library support, feel free to fork this.
14+
- Do not aim to provide `agent`, _you need to activate/call these libraries explicitly_
15+
- We do not prefer to use dynamic code rewriting / monkey patching
16+
- Do not aim to support all kinds of libraries in the world (HTTP client library, logging library, ...)
17+
- We focus on usecases or scenarios appearing in our work.
18+
- If you want to add any kinds of library support which is not supported by us, please feel free to fork this repository.
2019

2120
# How to start
2221

@@ -39,40 +38,37 @@ See [jvm/README](jvm/README.md).
3938
| Capture method invocation | | method annotation AOP | Play: ???? |
4039
| Dependency injection | | AutoConfiguration (Boot) | ???? |
4140

42-
Summary of each features are described below, but don't forget to see document of each language to see how to use/enable it.
41+
Summaries of each features are described below. Supplemental documents for each languages are provided to see how to use/enable them.
4342

44-
## Feature: Capture incoming HTTP request
43+
## Feature: Capture incoming HTTP requests
4544

46-
With this feature, this library automatically create trace/span for each incoming requests.
45+
A trace/span is automatically created for each incoming request.
4746

48-
## Feature: Capture & Propagate to outgoing HTTP request
47+
## Feature: Capture & Propagate to outgoing HTTP requests
4948

50-
With this feature:
51-
52-
- This library create span for each outgoing requests
53-
- So that you can know duration/summary of outgoing requests
49+
- The library creates one span for each outgoing request, which helps to know durations/summaries of your outgoing requests
5450
- This library adds `Trace ID` to outgoing HTTP requests
55-
- If destination service uses this library, we can trace request over services (-> "distributed" tracing)
51+
- If destination service uses this library, we can trace requests over services (-> "distributed" tracing)
5652

5753
## Feature: Capture database call
5854

59-
With this feature, this library yield spans for each database call.
55+
The library yields spans for each database call.
6056

6157
## Feature: Multi-thread
6258

63-
With this feature, this library wraps multi-thread (async) operations and propagate thread-bounded trace/span to threads.
59+
The library wraps multi-thread (async) operations and propagate thread-bounded trace/span to threads.
6460

6561
## Feature: Log correlation
6662

67-
With this feature, you can output `Trace ID` in logs. So that you can find related logs from/to traces.
63+
You can output `Trace ID` in logs to distinguish which trace/span logs are related.
6864

6965
## Feature: Capture any method invocation
7066

71-
With this feature, you can capture method call of your own class.
67+
You can capture method calls of your own classes.
7268

7369
## Feature: Dependency injection
7470

75-
With this feature, this library provides DI configuration so that you can get objects from DI context.
71+
The library provides DI configuration so that you can get objects from DI context.
7672

7773
## Note: Jakarta namespace support
7874

jvm/README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ Load following libraries:
77
- `com.m3.tracing:core`
88
- `com.m3.tracing:opencensus`(If you want to use OpenCensus)
99

10-
And there are framework/library integrations, describe later.
10+
Application framework integrations (e.g. integration with Spring Boot) are provided, which are described later.
1111

1212

1313
## Initialization
1414

1515
### Load SDK
1616

17-
You need to specify tracing SDK to use.
17+
You need to specify which tracing SDK to use.
1818

1919
To use OpenCensus, specify `com.m3.tracing.tracer.opencensus.M3OpenCensusTracer` into `M3_TRACER_FQCN` environment variable or `m3.tracer.fqcn` JVM system property.
2020

21-
By default, it uses `com.m3.tracing.tracer.logging.M3LoggingTracer` that just output trace information into SLF4J logs. It is useful for local test or stubbing but not useful for production.
21+
By default, the library uses `com.m3.tracing.tracer.logging.M3LoggingTracer` that just outputs trace information into SLF4J logs. This setting is useful for local testing or stubbing but not for production purposes.
2222

23-
See [M3TracerFactory](core/src/main/kotlin/com/m3/tracing/M3TracerFactory.kt) for detail of SDK loading mechanism.
23+
See [M3TracerFactory](core/src/main/kotlin/com/m3/tracing/M3TracerFactory.kt) for more details of SDK loading mechanisms.
2424

2525
### Configure SDK
2626

27-
To use OpenCensus, don't forget to look [opencensus/README](opencensus/README.md). You need to set sampling ration explicitly.
27+
To use OpenCensus, don't forget to look at [opencensus/README](opencensus/README.md). You need to set sampling ratio explicitly.
2828

2929
## Integrate with application framework
3030

@@ -34,48 +34,48 @@ Setup one or some of following integrations:
3434

3535
Load `com.m3.tracing:spring-boot` dependency.
3636

37-
It traces incoming HTTP request, outgoing HTTP request (with `RestTemplate`) and so on.
37+
It traces incoming HTTP requests, outgoing HTTP requests (with `RestTemplate`) and so on.
3838

39-
See [spring-boot/README](spring-boot/README.md) how to use it.
39+
See [spring-boot/README](spring-boot/README.md).
4040

4141
### Spring Framework without Spring Boot (`com.m3.tracing:spring-web`)
4242

4343
Load `com.m3.tracing:spring-web` dependency.
4444

45-
See [spring-web/README](spring-web/README.md) how to use it.
45+
See [spring-web/README](spring-web/README.md).
4646

4747
### Servlet without any web framework (`com.m3.tracing:servlet`)
4848

4949
Load `com.m3.tracing:serlvet` dependency.
5050

51-
See [servlet/README](servlet/README.md) how to use it.
51+
See [servlet/README](servlet/README.md).
5252

5353
## Integrate with libraries
5454

5555
### JDBC (trace SQLs of RDBMS)
5656

5757
You can use `com.m3.tracing:jdbc-p6spy` to capture SQLs via any JDBC driver.
5858

59-
See [jdbc-p6spy/README](jdbc-p6spy/README.md) how to use it.
59+
See [jdbc-p6spy/README](jdbc-p6spy/README.md).
6060

6161
### Apache HttpClient
6262

63-
You can use `com.m3.tracing:apache-httpclient` to trace outgoing HTTP request of Apache HttpClient.
63+
You can use `com.m3.tracing:apache-httpclient` to trace outgoing HTTP requests of Apache HttpClient.
6464

65-
See [apache-httpclient/README](apache-httpclient/README.md) how to use it.
65+
See [apache-httpclient/README](apache-httpclient/README.md).
6666

6767

6868
# Create span by manual
6969

7070
You can create span (element of trace) explicitly as like as:
7171

7272
```java
73-
// note: If you are using framework integration, may able to use DI (e.g. `@Autowired Tracer` in spring-boot)
73+
// note: If you are using framework integration, you might be able to use DI (e.g. `@Autowired Tracer` in spring-boot)
7474
private static final Tracer tracer = M3TracerFactory.get();
7575

7676
void yourMethod() {
7777
// You MUST close span to prevent memory leak.
78-
// Recommend to use try-with-resources (Java) or use (Kotlin).
78+
// We recommend using try-with-resources (Java) or use (Kotlin).
7979
try(TraceSpan span = tracer.startSpan("do_something")){
8080
// ... do anything you want ...
8181

@@ -84,24 +84,24 @@ void yourMethod() {
8484
}
8585
```
8686

87-
Also you can set custom tag to the span with `Span#set(tagName, value)` method.
87+
Also you can set custom tag to the span by `Span#set(tagName, value)` method.
8888

8989
## Caution for thread / asynchronous operation
9090

91-
If your application perform operation over threads (e.g. using [Executor](https://docs.oracle.com/javase/jp/8/docs/api/java/util/concurrent/Executor.html), [Akka](https://akka.io/), ...), you need to propagate tracing context across threads.
91+
If your application performs an operation over multiple threads (e.g. using [Executor](https://docs.oracle.com/javase/jp/8/docs/api/java/util/concurrent/Executor.html), [Akka](https://akka.io/), ...), you need to propagate the tracing context across threads.
9292

93-
Although this library hides context propagation matter as possible, but you need to write a code like this:
93+
Although this library hides context propagation matters as possible as it can, you need to write a code like this:
9494

9595
```java
9696
private static final Tracer tracer = M3TracerFactory.get();
9797

9898
void yourMethod() {
99-
// Parent thread should call getCurrentContext() before child thread's task.
99+
// The parent thread should call getCurrentContext() before child thread's task.
100100
final TraceContext traceContext = tracer.getCurrentContext();
101101
executor.execute(() -> {
102-
// In child thread, use traceContext.startSpan() to start span in the same context with parent
102+
// In the child thread, use traceContext.startSpan() to start span in the same context as parent's one
103103
try(TraceSpan span = traceContext.startSpan("do_something")){
104-
// ... do anything you want ...
104+
// ... do something you want ...
105105
}
106106
});
107107
}

0 commit comments

Comments
 (0)