Skip to content

Commit

Permalink
Some cleanups in docs (#739)
Browse files Browse the repository at this point in the history
## Description of the changes
Some small improvements for v2 docs

## Checklist
- [X] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [X] I have signed all commits

---------

Signed-off-by: Jonah Kowall <[email protected]>
  • Loading branch information
jkowall authored Sep 16, 2024
1 parent cee94fe commit e879666
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 91 deletions.
13 changes: 1 addition & 12 deletions content/docs/next-release-v2/badger.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,7 @@ hasparent: true

[Badger](https://github.com/dgraph-io/badger) is an embedded local storage, only available
with **all-in-one** distribution. By default, it acts as ephemeral storage using a temporary file system.
This can be overridden by using the `--badger.ephemeral=false` option.

```sh
docker run \
-e SPAN_STORAGE_TYPE=badger \
-e BADGER_EPHEMERAL=false \
-e BADGER_DIRECTORY_VALUE=/badger/data \
-e BADGER_DIRECTORY_KEY=/badger/key \
-v <storage_dir_on_host>:/badger \
-p 16686:16686 \
jaegertracing/all-in-one:{{< currentVersion >}}
```
For [additional configuration](https://github.com/jaegertracing/jaeger/blob/main/cmd/jaeger/config-badger.yaml)

* [Upgrade Badger v1 to v3](https://github.com/jaegertracing/jaeger/blob/main/plugin/storage/badger/docs/upgrade-v1-to-v3.md)
* [Badger file permissions as non-root service](https://github.com/jaegertracing/jaeger/blob/main/plugin/storage/badger/docs/storage-file-non-root-permission.md)
18 changes: 1 addition & 17 deletions content/docs/next-release-v2/cassandra.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,8 @@ Cassandra also has the following officially supported resources available from t
- [Kubernetes Operator](https://github.com/k8ssandra/cass-operator) from DataStax

#### Configuration
##### Minimal
```sh
docker run \
-e SPAN_STORAGE_TYPE=cassandra \
-e CASSANDRA_SERVERS=<...> \
jaegertracing/jaeger-collector:{{< currentVersion >}}
```

Note: White space characters are allowed in `CASSANDRA_SERVERS`. For Example: Servers can be passed as `CASSANDRA_SERVERS="1.2.3.4, 5.6.7.8" for better readability.

##### All options
To view the full list of configuration options, you can run the following command:
```sh
docker run \
-e SPAN_STORAGE_TYPE=cassandra \
jaegertracing/jaeger-collector:{{< currentVersion >}} \
--help
```
Configuration example for [Jaeger writing to Cassandra](https://github.com/jaegertracing/jaeger/blob/main/cmd/jaeger/config-cassandra.yaml).

#### Schema script

Expand Down
16 changes: 1 addition & 15 deletions content/docs/next-release-v2/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,8 @@ ElasticSearch also has the following officially supported resources available fr
- [Kubernetes Operator](https://github.com/openshift/elasticsearch-operator) from RedHat

#### Configuration
##### Minimal
```sh
docker run \
-e SPAN_STORAGE_TYPE=elasticsearch \
-e ES_SERVER_URLS=<...> \
jaegertracing/jaeger-collector:{{< currentVersion >}}
```

##### All options
To view the full list of configuration options, you can run the following command:
```sh
docker run \
-e SPAN_STORAGE_TYPE=elasticsearch \
jaegertracing/jaeger-collector:{{< currentVersion >}} \
--help
```
Here is [example configuration](https://github.com/jaegertracing/jaeger/blob/main/cmd/jaeger/config-elasticsearch.yaml) for ElasticSearch.

#### Shards and Replicas for Elasticsearch indices

Expand Down
4 changes: 2 additions & 2 deletions content/docs/next-release-v2/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ weight: 7

## Why is the Dependencies page empty?

The Dependencies page shows a graph of services traced by Jaeger and connections between them. When you are using `all-in-one` binary with in-memory storage, the graph is calculated on-demand from all the traces stored in memory. However, if you are using real distributed storage like Cassandra or OpenSearch/Elasticsearch, it is too expensive to scan all the data in the database to build the service graph. Instead, the Jaeger project provides "big data" jobs that can be used to extract the service graph data from traces:
The Dependencies page shows a graph of services traced by Jaeger and connections between them. When you are using in-memory storage, the graph is calculated on-demand from all the traces stored in memory. However, if you are using real distributed storage like Cassandra, Elasticsearch, or OpenSearch it is too expensive to scan all the data in the database to build the service graph. Instead, the Jaeger project provides "big data" jobs that can be used to extract the service graph data from traces:

* https://github.com/jaegertracing/spark-dependencies - the older Spark job that can be run periodically
* https://github.com/jaegertracing/jaeger-analytics - the new (experimental) streaming Flink jobs that run continuously and builds the service graph in smaller time intervals
Expand All @@ -18,7 +18,7 @@ Please refer to the [Troubleshooting](../troubleshooting/) guide.

## What is the recommended storage backend?

The Jaeger team recommends OpenSearch/Elasticsearch as the storage backend over Cassandra, for the following reasons:
The Jaeger team recommends Elasticsearch or OpenSearch as the storage backend over Cassandra, for the following reasons:

* Cassandra is a key-value database, so it is more efficient for retrieving traces by trace ID, but it does not provide the same powerful search capabilities as OpenSearch. Effectively, the Jaeger backend implements the search functionality on the client side, on top of k-v storage, which is limited and may produce inconsistent results (see [issue-166][issue-166] for more details). OpenSearch does not suffer from these issues, resulting in better usability. OpenSearch can also be queried directly, e.g. from Kibana dashboards, and provide useful analytics and aggregations.

Expand Down
4 changes: 2 additions & 2 deletions content/docs/next-release-v2/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The Jaeger SDKs are no longer supported, and all users must migrate to OpenTelem

**jaeger** is a single binary which can serve multiple purposes. It has a configuration embedded which provides full functionality for testing with an in memory storage component. If you would like to change the configuration you may create a YAML configuration file.

Run the `jaeger-all-in-one(.exe)` executable from the [binary distribution archives][download]:
Run the `jaeger(.exe)` executable from the [binary distribution archives][download]:

```bash
jaeger
Expand Down Expand Up @@ -116,7 +116,7 @@ Then navigate to `http://localhost:8080`.

## Migrating from Zipkin

**jaeger-collector** service exposes Zipkin compatible REST API `/api/v1/spans` which accepts both Thrift and JSON. Also there is `/api/v2/spans` for JSON and Proto.
The **jaeger collector role** service exposes Zipkin compatible REST API `/api/v1/spans` which accepts both Thrift and JSON. Also there is `/api/v2/spans` for JSON and Proto.
By default it's disabled. It can be enabled with `--collector.zipkin.host-port=:9411`.

Zipkin [Thrift](https://github.com/jaegertracing/jaeger-idl/blob/master/thrift/zipkincore.thrift) IDL and Zipkin [Proto](https://github.com/jaegertracing/jaeger-idl/blob/master/proto/zipkin.proto) IDL files can be found in [jaegertracing/jaeger-idl](https://github.com/jaegertracing/jaeger-idl) repository.
Expand Down
26 changes: 6 additions & 20 deletions content/docs/next-release-v2/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ hasparent: true
* Supported Kafka versions: 0.9+

Kafka can be used as an intermediary buffer between collector and an actual storage.
**jaeger-collector** is configured with `SPAN_STORAGE_TYPE=kafka` that makes it write all received spans
into a Kafka topic. [**jaeger-ingester**](#ingester) is used to read from
Kafka and store spans in another storage backend (Elasticsearch or Cassandra).
**jaeger** can be configured to both act as the `collector` for Kafka data before adding it to a Kafka topic and also as a `ingester` to get data from Kafka and forward it to another storage backend.

Writing to Kafka is particularly useful for building post-processing data pipelines.

Expand All @@ -19,23 +17,11 @@ Kafka also has the following officially supported resources available from the c
- [Strimzi Kubernetes Operator](https://strimzi.io/)

#### Configuration
##### Minimal
```sh
docker run \
-e SPAN_STORAGE_TYPE=kafka \
-e KAFKA_PRODUCER_BROKERS=<...> \
-e KAFKA_TOPIC=<...> \
jaegertracing/jaeger-collector:{{< currentVersion >}}
```

##### All options
To view the full list of configuration options, you can run the following command:
```sh
docker run \
-e SPAN_STORAGE_TYPE=kafka \
jaegertracing/jaeger-collector:{{< currentVersion >}} \
--help
```
##### Collector
In order to collect tracing data and add it to a Kafka topic this [configuration](https://github.com/jaegertracing/jaeger/blob/main/cmd/jaeger/config-kafka-collector.yaml) is what should be used.

##### Ingester
In order to write tracing data which is added to a Kafka topic this [configuration](https://github.com/jaegertracing/jaeger/blob/main/cmd/jaeger/config-kafka-ingester.yaml) is what should be used.

#### Topic & partitions
Unless your Kafka cluster is configured to automatically create topics, you will need to create it ahead of time. You can refer to [the Kafka quickstart documentation](https://kafka.apache.org/documentation/#quickstart_createtopic) to learn how.
Expand Down
17 changes: 2 additions & 15 deletions content/docs/next-release-v2/opensearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,9 @@ OpenSearch also has the following officially supported resources available from
- [Kubernetes Operator](https://github.com/opensearch-project/opensearch-k8s-operator)

#### Configuration
##### Minimal
```sh
docker run \
-e SPAN_STORAGE_TYPE=elasticsearch \
-e ES_SERVER_URLS=<...> \
jaegertracing/jaeger-collector:{{< currentVersion >}}
```

##### All options
To view the full list of configuration options, you can run the following command:
```sh
docker run \
-e SPAN_STORAGE_TYPE=elasticsearch \
jaegertracing/jaeger-collector:{{< currentVersion >}} \
--help
```
Here is [example configuration](https://github.com/jaegertracing/jaeger/blob/main/cmd/jaeger/config-opensearch.yaml) for OpenSearch.


#### Shards and Replicas for OpenSearch indices

Expand Down
99 changes: 99 additions & 0 deletions content/docs/next-release-v2/sampling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
title: Sampling
hasparent: true
---

Sampling is essential when handling large volumes of traces. Ideally, discarding less interesting data and keeping the data needed to diagnose issues. Other capabilities like calculating metrics from traces can help reduce the volume of spans collected and stored.

Jaeger supports multiple types of sampling strategies which leverage OpenTelemetry. The `jaeger` binary supports specific configurations.

## Head Based Sampling
Head based sampling is when the sampling decision is made when the first spans are seen by `jaeger`. The support of Head based sampling comes from OpenTelemetry. The topic is covered in the [OpenTelemetry documentation on head based sampling](https://opentelemetry.io/docs/concepts/sampling/#head-sampling).

Example configuration for [various head based sampling strategies](https://github.com/jaegertracing/jaeger/blob/main/cmd/jaeger/sampling-strategies.json).

## Tail Based Sampling
Tail based sampling allows for the sampling decisions to be made after the trace is complete and all spans have been collected. Ideally this provides more granular control over which traces and kept and which are discarded. The downside to this is that more memory and processing power will be used by `jaeger` binaries.

This [configuration allows for the sampling of everything observed](https://github.com/jaegertracing/jaeger/blob/main/cmd/jaeger/config-tail-sampling-always-sample.yaml) by `jaeger` with debug logging to diagnose problems.

The second configuration of `jaeger` [samples for a specific service name](https://github.com/jaegertracing/jaeger/blob/main/cmd/jaeger/config-tail-sampling-service-name-policy.yaml).

## Remote Sampling

If your client SDKs are configured to use remote sampling configuration (see [Remote Sampling API][remote-sampling-api]) then sampling rates can be centrally controlled. In this setup a sampling strategy configuration is served to the client SDK that describes endpoints and their sampling probabilities. This configuration can be generated by `jaeger` in two different ways: [periodically loaded from a file](#file-based-sampling-configuration) or [dynamically calculated based on traffic](#adaptive-sampling). The method of generation is controlled by the environment variable `SAMPLING_CONFIG_TYPE` which can be set to either `file` (default) or `adaptive`.

[remote-sampling-api]: ../apis#remote-sampling-configuration-stable

### File-based Sampling Configuration

`jaeger` can be instantiated with the `--sampling.strategies-file` option that points to a file containing sampling strategies to be served to Jaeger clients. The option's value can contain a path to a JSON file, which will be automatically reloaded if its contents change, or an HTTP URL from where the file will be periodically retrieved, with reload frequency controlled by the `--sampling.strategies-reload-interval` option.

If no configuration is provided, **jaeger-collector**s will return the default probabilistic sampling policy with probability 0.001 (0.1%) for all services.

Example `strategies.json`:
```json
{
"service_strategies": [
{
"service": "foo",
"type": "probabilistic",
"param": 0.8,
"operation_strategies": [
{
"operation": "op1",
"type": "probabilistic",
"param": 0.2
},
{
"operation": "op2",
"type": "probabilistic",
"param": 0.4
}
]
},
{
"service": "bar",
"type": "ratelimiting",
"param": 5
}
],
"default_strategy": {
"type": "probabilistic",
"param": 0.5,
"operation_strategies": [
{
"operation": "/health",
"type": "probabilistic",
"param": 0.0
},
{
"operation": "/metrics",
"type": "probabilistic",
"param": 0.0
}
]
}
}
```

`service_strategies` element defines service specific sampling strategies and `operation_strategies` defines operation specific sampling strategies. There are 2 types of strategies possible: `probabilistic` and `ratelimiting` which are described [above](#client-sampling-configuration) (NOTE: `ratelimiting` is not supported for `operation_strategies`). `default_strategy` defines the catch-all sampling strategy that is propagated if the service is not included as part of `service_strategies`.

In the above example:

* All operations of service `foo` are sampled with probability 0.8 except for operations `op1` and `op2` which are probabilistically sampled with probabilities 0.2 and 0.4 respectively.
* All operations for service `bar` are rate-limited at 5 traces per second.
* Any other service will be sampled with probability 0.5 defined by the `default_strategy`.
* The `default_strategy` also includes shared per-operation strategies. In this example we disable tracing on `/health` and `/metrics` endpoints for all services by using probability 0. These per-operation strategies will apply to any new service not listed in the config, as well as to the `foo` and `bar` services unless they define their own strategies for these two operations.

### Adaptive Sampling

Since Jaeger v1.27.

Adaptive sampling works in **jaeger-collector** by observing the spans received from services and recalculating sampling probabilities for each service/endpoint combination to ensure that the volume of collected traces matches `--sampling.target-samples-per-second`. When a new service or endpoint is detected, it is initially sampled with `--sampling.initial-sampling-probability` until enough data is collected to calculate the rate appropriate for the traffic going through the endpoint.

Adaptive sampling requires a storage backend to store the observed traffic data and computed probabilities. At the moment `memory` (for all-in-one deployment), `cassandra`, `badger`, `elasticsearch` and `opensearch` are supported as sampling storage backends.

By default adaptive sampling will attempt to use the backend specified by `SPAN_STORAGE_TYPE` to store data. However, a second type of backend can also be specified by using `SAMPLING_STORAGE_TYPE`. For instance, `SPAN_STORAGE_TYPE=elasticsearch SAMPLING_STORAGE_TYPE=cassandra ./jaeger-collector` will run **jaeger-collector** in a mode where it attempts to store its span data in the configured elasticsearch cluster and its adaptive sampling data in the configured cassandra cluster. Note that this feature can not be used to store span and adaptive sampling data in two different backends of the same type.

Read [this blog post](https://medium.com/jaegertracing/adaptive-sampling-in-jaeger-50f336f4334) for more details on adaptive sampling engine.
10 changes: 2 additions & 8 deletions content/docs/next-release-v2/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ children:
url: metrics.md
---

Jaeger requires a persistent storage backend. Cassandra and Elasticsearch/OpenSearch are the primary supported distributed storage backends. Additional backends are [discussed here](https://github.com/jaegertracing/jaeger/issues/638).
Jaeger requires a persistent storage backend. Cassandra, Elasticsearch, and OpenSearch are the primary supported distributed storage backends. Additional backends are [discussed here](https://github.com/jaegertracing/jaeger/issues/638).

The storage type can be passed via `SPAN_STORAGE_TYPE` environment variable. Valid values are `cassandra`, `elasticsearch`, `kafka` (only as a buffer), `badger` and `memory`.

Expand All @@ -32,13 +32,7 @@ Jaeger supports a gRPC-based [Remote Storage API][storage.proto] that allows ext

To use a remote storage as Jaeger storage backend, use `grpc` as the storage type and specify the remote gRPC server address. For more information, please refer to [jaeger/plugin/storage/grpc](https://github.com/jaegertracing/jaeger/tree/master/plugin/storage/grpc).

Example:
```sh
docker run \
-e SPAN_STORAGE_TYPE=grpc \
-e GRPC_STORAGE_SERVER=<...> \
jaegertracing/all-in-one:{{< currentVersion >}}
```
Example config for `jaeger` [can be found here](https://github.com/jaegertracing/jaeger/blob/main/cmd/jaeger/config-remote-storage.yaml).

Known remote storage backends:

Expand Down

0 comments on commit e879666

Please sign in to comment.