Skip to content
This repository was archived by the owner on Nov 7, 2022. It is now read-only.

Commit 5a51f7c

Browse files
authored
Update README for intelligent sampling and batching (#382)
* Update README for intelligent sampling and batching
1 parent 806f49e commit 5a51f7c

2 files changed

Lines changed: 108 additions & 18 deletions

File tree

README.md

Lines changed: 53 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
- [Building binaries](#agent-building-binaries)
2020
- [Usage](#agent-usage)
2121
- [OpenCensus Collector](#opencensus-collector)
22+
- [Global Tags](#global-tags)
23+
- [Intelligent Sampling](#tail-sampling)
2224
- [Usage](#collector-usage)
2325

2426
## Introduction
@@ -167,23 +169,6 @@ exporters:
167169
endpoint: "http://127.0.0.1:9411/api/v2/spans"
168170
```
169171
170-
### <a name="config-global"></a> Global
171-
172-
The collector also takes some global configurations that modify its behavior for all receivers / exporters. One of the configurations
173-
available is to add Attributes or Tags to all spans passing through this collector. These additional tags can be configured to either overwrite
174-
attributes if they already exists on the span, or respect the original values. An example of this is provided below.
175-
```yaml
176-
global:
177-
attributes:
178-
overwrite: true
179-
values:
180-
# values are key value pairs where the value can be an int, float, bool, or string
181-
some_string: "hello world"
182-
some_int: 1234
183-
some_float: 3.14159
184-
some_bool: false
185-
```
186-
187172
### <a name="config-diagnostics"></a>Diagnostics
188173
189174
zPages is provided for monitoring. Today, the OpenCensus Agent is configured with zPages running by default on port ``55679``.
@@ -307,6 +292,56 @@ The collector also serves as a control plane for agents/clients by supplying
307292
them updated configuration (e.g. trace sampling policies), and reporting
308293
agent/client health information/inventory metadata to downstream exporters.
309294

295+
### <a name="global-tags"></a> Global Tags
296+
297+
The collector also takes some global configurations that modify its behavior for all receivers / exporters. One of the configurations
298+
available is to add Attributes or Tags to all spans passing through this collector. These additional tags can be configured to either overwrite
299+
attributes if they already exists on the span, or respect the original values. An example of this is provided below.
300+
```yaml
301+
global:
302+
attributes:
303+
overwrite: true
304+
values:
305+
# values are key value pairs where the value can be an int, float, bool, or string
306+
some_string: "hello world"
307+
some_int: 1234
308+
some_float: 3.14159
309+
some_bool: false
310+
```
311+
312+
### <a name="tail-sampling"></a>Intelligent Sampling
313+
314+
```yaml
315+
sampling:
316+
mode: tail
317+
# amount of time from seeing the first span in a trace until making the sampling decision
318+
decision-wait: 10s
319+
# maximum number of traces kept in the memory
320+
num-traces: 10000
321+
policies:
322+
# user-defined policy name
323+
my-string-tag-filter:
324+
# exporters the policy applies to
325+
exporters:
326+
- jaeger
327+
- omnition
328+
policy: string-tag-filter
329+
configuration:
330+
tag: tag1
331+
values:
332+
- value1
333+
- value2
334+
my-numeric-tag-filter:
335+
exporters:
336+
- jaeger
337+
- omnition
338+
policy: numeric-tag-filter
339+
configuration:
340+
tag: tag1
341+
min-value: 0
342+
max-value: 100
343+
```
344+
310345
### <a name="collector-usage"></a>Usage
311346

312347
> It is recommended that you use the latest [release](https://github.com/census-instrumentation/opencensus-service/releases).
@@ -364,7 +399,7 @@ receivers:
364399
queued-exporters:
365400
jaeger-sender-test: # A friendly name for the exporter
366401
# num-workers is the number of queue workers that will be dequeuing batches and sending them out (default is 10)
367-
num-workers: 2
402+
num-workers: 2
368403
369404
# queue-size is the maximum number of batches allowed in the queue at a given time (default is 5000)
370405
queue-size: 100

exporter/exporterparser/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,67 @@ A variety of exporters are available to the OpenCensus Service (both Agent and C
22

33
## Collector
44

5+
### Intelligent Sampling
6+
7+
The Collector features intelligent (tail-based) sampling. In addition to different configuration
8+
options it features a variety of different policies.
9+
```yaml
10+
sampling:
11+
mode: tail
12+
# amount of time from seeing the first span in a trace until making the sampling decision
13+
decision-wait: 10s
14+
# maximum number of traces kept in the memory
15+
num-traces: 10000
16+
policies:
17+
# user-defined policy name
18+
my-rate-limiting:
19+
# exporters the policy applies to
20+
exporters:
21+
- jaeger
22+
- omnition
23+
policy: rate-limiting
24+
configuration:
25+
spans-per-second: 1000
26+
my-string-tag-filter:
27+
exporters:
28+
- jaeger
29+
- omnition
30+
policy: string-tag-filter
31+
configuration:
32+
tag: tag1
33+
values:
34+
- value1
35+
- value2
36+
my-numeric-tag-filter:
37+
exporters:
38+
- jaeger
39+
- omnition
40+
policy: numeric-tag-filter
41+
configuration:
42+
tag: tag1
43+
min-value: 0
44+
max-value: 100
45+
my-always-sample:
46+
exporters:
47+
- jaeger
48+
- omnition
49+
policy: always-sample
50+
```
51+
52+
### Queued Exporters
53+
554
In addition to the normal `exporters`, the OpenCensus Collector supports a special configuration.
655
`queued-exporters` offer bounded buffer retry logic for multiple destinations.
756

857
```yaml
958
queued-exporters:
1059
omnition: # A friendly name for the processor
60+
batching:
61+
enable: false
62+
# sets the time, in seconds, after which a batch will be sent regardless of size
63+
timeout: 1
64+
# number of spans which after hit, will trigger it to be sent
65+
send-batch-size: 8192
1166
# num-workers is the number of queue workers that will be dequeuing batches and sending them out (default is 10)
1267
num-workers: 2
1368
# queue-size is the maximum number of batches allowed in the queue at a given time (default is 5000)

0 commit comments

Comments
 (0)