-
Notifications
You must be signed in to change notification settings - Fork 680
Add Trace analytics page to doc website repo #1873
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
eebd6b3
Added cluster permissions to cluster permissions list.
carolxob e276ee2
Revert "Added cluster permissions to cluster permissions list."
carolxob 7a4cc2b
Adding new Trace Analytics page.
carolxob f825d9f
Add new trace analytics page.
carolxob 989a12c
Merge branch 'main' into data-prepper-trace
carolxob b3d2bf7
Incorporated technical review feedback.
carolxob 7d68c07
Minor edits.
carolxob e3cda3e
Added Trace tuning content before 'Pipeline configuration' section.
carolxob 4b2e4ff
Adjusted heading levels to Trace tuning content.
carolxob 7112c2b
Minor edits.
carolxob db7a508
Minor edits.
carolxob 2012373
Minor edits.
carolxob cd4a8bf
Minor changes to URL format.
carolxob 29994c3
Minor edits.
carolxob f7010cd
Minor edits, fixed image links.
carolxob 46d2bc6
Minor updates to phrasing.
carolxob 0e8b5d5
Update _data-prepper/trace-analytics.md
carolxob 3e85382
Update _data-prepper/trace-analytics.md
carolxob 6e74aec
Update _data-prepper/trace-analytics.md
carolxob 59eab9f
Update _data-prepper/trace-analytics.md
carolxob 26a9ecb
Update _data-prepper/trace-analytics.md
carolxob 64f2535
Update _data-prepper/trace-analytics.md
carolxob 57cb25a
Update _data-prepper/trace-analytics.md
carolxob 31ac4a0
Update _data-prepper/trace-analytics.md
carolxob 1f85f27
Update _data-prepper/trace-analytics.md
carolxob c5f295e
Minor edits based on tech review feedback.
carolxob 5278e0f
Minor updates to links.
carolxob 4ad57b0
Minor link updates.
carolxob 1c2e899
Minor edits to URLs.
carolxob 7cfa83f
Updated links.
carolxob cbfbc31
Commit test.
carolxob 29a05fc
Incorporated some feedback.
carolxob da0c69f
Update _data-prepper/trace-analytics.md
carolxob 0b43914
Update _data-prepper/trace-analytics.md
carolxob de232d1
Update _data-prepper/trace-analytics.md
carolxob ba1fb27
Update _data-prepper/trace-analytics.md
carolxob 4a38d10
Update _data-prepper/trace-analytics.md
carolxob dec8203
Update _data-prepper/trace-analytics.md
carolxob 5f72305
Update _data-prepper/trace-analytics.md
carolxob cd6781a
Update _data-prepper/trace-analytics.md
carolxob 27ffcbf
Update _data-prepper/trace-analytics.md
carolxob 1f08939
Update _data-prepper/trace-analytics.md
carolxob 22b3224
Minor edits.
carolxob 71624e2
Minor edits to get started.
carolxob edbab6d
Minor updates.
carolxob 22eb956
Incorporated technical review feedback.
carolxob 8a63531
Minor changes to phrasing.
carolxob 1f9e42a
Made some edits from editorial feedback.
carolxob a167a0a
Incorporated editorial feedback.
carolxob 8b2652f
Update _data-prepper/trace-analytics.md
carolxob fda16af
Update _data-prepper/trace-analytics.md
carolxob e30d0e8
Minor changes.
carolxob 4e7b194
Incorporated more editorial feedback.
carolxob 9fb15be
Incorporated more editorial feedback.
carolxob b804a3a
Incorporated more editorial feedback.
carolxob 2221a87
Additional feedback incorporated from editorial.
carolxob 0f862ee
Minor edits from editorial review feedback.
carolxob 75cf70c
Minor edits.
carolxob 69f0425
Fixed merge conflict.
carolxob b71da25
Fixed merge conflict...again.
carolxob 94a788c
Incorporated editorial feedback.
carolxob 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 hidden or 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
This file contains hidden or 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,312 @@ | ||
| --- | ||
| layout: default | ||
| title: Trace analytics | ||
| nav_order: 21 | ||
| --- | ||
|
|
||
| # Trace analytics | ||
|
|
||
| ## Introduction | ||
|
|
||
| Data Prepper ingests [Trace Analytics](https://opensearch.org/docs/latest/observability-plugin/trace/index/) into OpenSearch and Amazon OpenSearch Service. Data Prepper is a last mile server-side component which collects telemetry data from [AWS Distro OpenTelemetry collector](https://aws-otel.github.io/docs/getting-started/collector) or [OpenTelemetry collector](https://github.com/open-telemetry/opentelemetry-collector) and transforms it for OpenSearch. The transformed trace data is the visualized using the [Trace Analytics OpenSearch Dashboards plugin](https://opensearch.org/docs/latest/observability-plugin/trace/ta-dashboards/), which provides at-a-glance visibility into your application performance, along with the ability to drill down on individual traces. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| Here is how all the components work in trace analytics: | ||
|
|
||
|  | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| In your service environment, you need to run OpenTelemetry collector. You can run it as a sidecar or daemonset for EKS, a sidecar for ECS, or an agent on EC2. You should configure the collector to export trace data to Data Prepper. Then, you need to deploy Data Prepper as an intermediate component and configure it to send the enriched trace data to your OpenSearch cluster or Amazon OpenSearch Service domain. Finally, use OpenSearch Dashboards to visualize and detect problems in your distributed applications. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Trace analytics pipeline | ||
|
|
||
| To achieve trace analytics in Data Prepper, we have three pipelines: `otel-trace-pipeline`, `raw-trace-pipeline` and `service-map-pipeline`. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
|  | ||
|
|
||
|
|
||
| ### OpenTelemetry trace source | ||
|
|
||
| The [OpenTelemetry source](../data-prepper-plugins/otel-trace-source/README.md) accepts trace data from the OpenTelemetry collector. The source depends on [OpenTelemetry Protocol](https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/protocol). The source officially support transport over gRPC. The source also supports industry-standard encryption (TLS/HTTPS). | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Processor | ||
|
|
||
| We have two processor for the Trace Analytics feature, | ||
| * *otel_trace_raw* - This is a processor that receives collection of [Span](../../data-prepper-api/src/main/java/com/amazon/dataprepper/model/trace/Span.java) records sent from [otel-trace-source](../dataPrepper-plugins/otel-trace-source), does stateful processing on extracting and filling-in trace group related fields. | ||
| * *otel_trace_group* - This is a processor that fills in the missing trace group related fields in the collection of [Span](../../data-prepper-api/src/main/java/com/amazon/dataprepper/model/trace/Span.java) records by looking up the opensearch backend. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| * *service_map_stateful* - This processor performs the required preprocessing on the trace data and build metadata to display the service-map OpenSearch Dashboards dashboards. | ||
|
|
||
| ### OpenSearch sink | ||
|
|
||
| We have a generic sink that writes the data to OpenSearch as the destination. The [opensearch sink](../data-prepper-plugins/opensearch/README.md) has configuration options related to OpenSearch cluster like endpoint, SSL/Username, index name, index template, index state management, etc. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| For the trace analytics feature, the sink has specific configurations which enables the sink to use indices and index templates specific to this feature. Trace analytics specific OpenSearch indices are, | ||
|
|
||
| * *otel-v1-apm-span* - This index stores the output from [otel-trace-raw-processor](../data-prepper-plugins/otel-trace-raw-processor/README.md). | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| * *otel-v1-apm-service-map* - This index stores the output from the [service-map-processor](../data-prepper-plugins/service-map-stateful/README.md). | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Pipeline configuration | ||
|
|
||
| ### Trace analytics pipeline example | ||
|
|
||
| The following example demonstrates how to build a pipeline that supports the [Trace Analytics OpenSearch Dashboards plugin]({{site.url}}{{site.baseurl}}/observability-plugin/trace/ta-dashboards/). This pipeline takes data from the OpenTelemetry Collector and uses two other pipelines as sinks. These two separate pipelines index trace and the service map documents for the dashboard plugin. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| Starting from Data Prepper 2.0, Data Prepper no longer supports `otel_trace_raw_prepper` processor due to the Data Prepper internal data model evolution. | ||
| Instead, users should use `otel_trace_raw`. | ||
|
|
||
| ```yml | ||
| entry-pipeline: | ||
| delay: "100" | ||
| source: | ||
| otel_trace_source: | ||
| ssl: false | ||
| buffer: | ||
| bounded_blocking: | ||
| buffer_size: 10240 | ||
| batch_size: 160 | ||
| sink: | ||
| - pipeline: | ||
| name: "raw-pipeline" | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| - pipeline: | ||
| name: "service-map-pipeline" | ||
| raw-pipeline: | ||
|
carolxob marked this conversation as resolved.
|
||
| source: | ||
| pipeline: | ||
| name: "entry-pipeline" | ||
| buffer: | ||
| bounded_blocking: | ||
| buffer_size: 10240 | ||
| batch_size: 160 | ||
| processor: | ||
| - otel_trace_raw: | ||
| sink: | ||
| - opensearch: | ||
| hosts: ["https://localhost:9200"] | ||
| insecure: true | ||
| username: admin | ||
| password: admin | ||
| index_type: trace-analytics-raw | ||
| service-map-pipeline: | ||
| delay: "100" | ||
| source: | ||
| pipeline: | ||
| name: "entry-pipeline" | ||
| buffer: | ||
| bounded_blocking: | ||
| buffer_size: 10240 | ||
| batch_size: 160 | ||
| processor: | ||
| - service_map_stateful: | ||
| sink: | ||
| - opensearch: | ||
| hosts: ["https://localhost:9200"] | ||
| insecure: true | ||
| username: admin | ||
| password: admin | ||
| index_type: trace-analytics-service-map | ||
| ``` | ||
|
|
||
| To maintain similar ingestion throughput and latency, scale the `buffer_size` and `batch_size` by the estimated maximum batch size in the client request payload. | ||
| {: .tip} | ||
|
|
||
|
|
||
| #### Example: otel trace | ||
| Example `otel-trace-source` with SSL and Basic Authentication enabled. Note that you will have to change your `otel-collector-config.yaml` accordingly: | ||
|
|
||
| ```yaml | ||
| source: | ||
| otel_trace_source: | ||
| #record_type: event # Add this when using Data Prepper 1.x. This option is removed in 2.0 | ||
| ssl: true | ||
| sslKeyCertChainFile: "/full/path/to/certfile.crt" | ||
| sslKeyFile: "/full/path/to/keyfile.key" | ||
| authentication: | ||
| http_basic: | ||
| username: "my-user" | ||
| password: "my_s3cr3t" | ||
| ``` | ||
|
|
||
|
|
||
| #### Example: pipeline.yaml | ||
| Example `pipeline.yaml` without SSL and Basic Authentication for the `otel-trace-source`: | ||
|
|
||
| ```yaml | ||
| otel-trace-pipeline: | ||
|
carolxob marked this conversation as resolved.
|
||
| # workers is the number of threads processing data in each pipeline. | ||
| # We recommend same value for all pipelines. | ||
| # default value is 1, set a value based on the machine you are running Data Prepper | ||
| workers: 8 | ||
| # delay in milliseconds is how often the worker threads should process data. | ||
| # Recommend not to change this config as we want the otel-trace-pipeline to process as quick as possible | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| # default value is 3_000 ms | ||
| delay: "100" | ||
| source: | ||
| otel_trace_source: | ||
| #record_type: event # Add this when using Data Prepper 1.x. This option is removed in 2.0 | ||
| ssl: false # Change this to enable encryption in transit | ||
| authentication: | ||
| unauthenticated: | ||
| buffer: | ||
| bounded_blocking: | ||
| # buffer_size is the number of ExportTraceRequest from otel-collector the data prepper should hold in memeory. | ||
| # We recommend to keep the same buffer_size for all pipelines. | ||
| # Make sure you configure sufficient heap | ||
| # default value is 512 | ||
| buffer_size: 512 | ||
| # This is the maximum number of request each worker thread will process within the delay. | ||
| # Default is 8. | ||
| # Make sure buffer_size >= workers * batch_size | ||
| batch_size: 8 | ||
| sink: | ||
| - pipeline: | ||
| name: "raw-pipeline" | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| - pipeline: | ||
| name: "service-map-pipeline" | ||
| raw-pipeline: | ||
|
carolxob marked this conversation as resolved.
|
||
| # Configure same as the otel-trace-pipeline | ||
|
carolxob marked this conversation as resolved.
|
||
| workers: 8 | ||
| # We recommend using the default value for the raw-pipeline. | ||
| delay: "3000" | ||
| source: | ||
| pipeline: | ||
| name: "otel-trace-pipeline" | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| buffer: | ||
| bounded_blocking: | ||
| # Configure the same value as in otel-trace-pipeline | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| # Make sure you configure sufficient heap | ||
| # default value is 512 | ||
| buffer_size: 512 | ||
| # The raw processor does bulk request to your OpenSearch sink, so configure the batch_size higher. | ||
| # If you use the recommended otel-collector setup each ExportTraceRequest could contain max 50 spans. https://github.com/opensearch-project/data-prepper/tree/v0.7.x/deployment/aws | ||
| # With 64 as batch size each worker thread could process upto 3200 spans (64 * 50) | ||
| batch_size: 64 | ||
| processor: | ||
| - otel_trace_raw: | ||
| - otel_trace_group: | ||
| hosts: [ "https://localhost:9200" ] | ||
| # Change to your credentials | ||
| username: "admin" | ||
| password: "admin" | ||
| # Add a certificate file if you are accessing an OpenSearch cluster with a self-signed certificate | ||
| #cert: /path/to/cert | ||
| # If you are connecting to an Amazon OpenSearch Service domain without | ||
| # Fine-Grained Access Control, enable these settings. Comment out the | ||
| # username and password above. | ||
| #aws_sigv4: true | ||
| #aws_region: us-east-1 | ||
| sink: | ||
| - opensearch: | ||
| hosts: [ "https://localhost:9200" ] | ||
| index_type: trace-analytics-raw | ||
| # Change to your credentials | ||
| username: "admin" | ||
| password: "admin" | ||
| # Add a certificate file if you are accessing an OpenSearch cluster with a self-signed certificate | ||
| #cert: /path/to/cert | ||
| # If you are connecting to an Amazon OpenSearch Service domain without | ||
| # Fine-Grained Access Control, enable these settings. Comment out the | ||
| # username and password above. | ||
| #aws_sigv4: true | ||
| #aws_region: us-east-1 | ||
| service-map-pipeline: | ||
| workers: 8 | ||
| delay: "100" | ||
| source: | ||
| pipeline: | ||
| name: "otel-trace-pipeline" | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| processor: | ||
| - service_map_stateful: | ||
| # The window duration is the maximum length of time the data prepper stores the most recent trace data to evaluvate service-map relationships. | ||
| # The default is 3 minutes, this means we can detect relationships between services from spans reported in last 3 minutes. | ||
| # Set higher value if your applications have higher latency. | ||
| window_duration: 180 | ||
| buffer: | ||
| bounded_blocking: | ||
| # buffer_size is the number of ExportTraceRequest from otel-collector the data prepper should hold in memeory. | ||
| # We recommend to keep the same buffer_size for all pipelines. | ||
| # Make sure you configure sufficient heap | ||
| # default value is 512 | ||
| buffer_size: 512 | ||
| # This is the maximum number of request each worker thread will process within the delay. | ||
| # Default is 8. | ||
| # Make sure buffer_size >= workers * batch_size | ||
| batch_size: 8 | ||
| sink: | ||
| - opensearch: | ||
| hosts: [ "https://localhost:9200" ] | ||
| index_type: trace-analytics-service-map | ||
| # Change to your credentials | ||
| username: "admin" | ||
| password: "admin" | ||
| # Add a certificate file if you are accessing an OpenSearch cluster with a self-signed certificate | ||
| #cert: /path/to/cert | ||
| # If you are connecting to an Amazon OpenSearch Service domain without | ||
| # Fine-Grained Access Control, enable these settings. Comment out the | ||
| # username and password above. | ||
| #aws_sigv4: true | ||
| #aws_region: us-east-1 | ||
| ``` | ||
|
|
||
| You will need to modify the configuration above for your OpenSearch cluster. Note that it has two | ||
| `opensearch` sinks which need to be modified. | ||
|
|
||
| The main changes you will need to make are: | ||
| * `hosts` - Set to your hosts | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| * `username` - Provide the OpenSearch username | ||
| * `password` - Provide your OpenSearch password | ||
| * `aws_sigv4` - If you are Amazon OpenSearch Service with AWS signing, set this to `true`. It will sign requests with the default AWS credentials provider. | ||
| * `aws_region` - If you are Amazon OpenSearch Service with AWS signing, set this value to your region. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| The the [Data Prepper OpenSearch Sink](../data-prepper-plugins/opensearch/README.md#Configuration) documents | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| other configurations available for OpenSearch. | ||
|
|
||
| ## OpenTelemetry collector | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| You will have to run OpenTelemetry collector in your service environment. You can find the installation guide of OpenTelemetry collector [here](https://opentelemetry.io/docs/collector/getting-started/#getting-started). Ensure that you configure the collector with an exporter configured to your Data Prepper. Below is an example `otel-collector-config.yaml` that receives data from various instrumentations and export it to Data Prepper. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Example otel-collector-config.yaml | ||
| ``` | ||
| receivers: | ||
| jaeger: | ||
| protocols: | ||
| grpc: | ||
| otlp: | ||
| protocols: | ||
| grpc: | ||
| zipkin: | ||
|
|
||
| processors: | ||
| batch/traces: | ||
| timeout: 1s | ||
| send_batch_size: 50 | ||
|
|
||
| exporters: | ||
| otlp/data-prepper: | ||
| endpoint: localhost:21890 | ||
| tls: | ||
| insecure: true | ||
|
|
||
| service: | ||
| pipelines: | ||
| traces: | ||
| receivers: [jaeger, otlp, zipkin] | ||
| processors: [batch/traces] | ||
| exporters: [otlp/data-prepper] | ||
| ``` | ||
|
|
||
| After you run OpenTelemetry in your service environment, you need to configure your application to use the OpenTelemetry collector. Normally, the OpenTelemetry collector runs alongside your application. | ||
|
|
||
| ## Next steps and more information | ||
|
|
||
| The [OpenSearch Trace Analytics](https://opensearch.org/docs/monitoring-plugins/trace/index/) documentation provides additional details on configuring OpenSearch for viewing trace analytics. In particular, it documents how to use OpenSearch Dashboards. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| The [Trace Tuning page](trace_tuning.md) has information to help you tune and scale Data Prepper for | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| trace analytics use cases. | ||
|
|
||
| ## Migrating to Data Prepper 2.0 | ||
|
|
||
| Starting in Data Prepper 1.4, the trace processing uses Data Prepper's Event model. This allows pipeline authors the ability to configure other processors to modify spans or traces. To provide a migration path, Data Prepper 1.4 introduced the following changes. | ||
| * The `otel_trace_source` has an optional parameter `record_type` which can be set to `event`. When configured, it will output event objects. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| * The `otel_trace_raw` replaces `otel_trace_raw_prepper` for event-based spans. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| * The `otel_trace_group` replaces `otel_trace_group_prepper` for event-based spans. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| In Data Prepper 2.0, the `otel_trace_source` will only output Events. Data Prepper 2.0 also removes | ||
| `otel_trace_raw_prepper` and `otel_trace_group_prepper` entirely. To help migrate to 2.0, | ||
| you can configure your trace pipeline using the Event model. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Uh oh!
There was an error while loading. Please reload this page.