-
Notifications
You must be signed in to change notification settings - Fork 685
Add Peer forwarder to doc website repo. #1936
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
Closed
Closed
Changes from 6 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
30586d3
Add Peer forwarder to doc site repo.
carolxob 73fab9f
Minor updates.
carolxob f8feef6
Minor updates to header section.
carolxob 24d4a5e
Minor copyedits and heading adjustements.
carolxob 7fb9b33
Minor copyedits and heading updates. Additional of Optional section t…
carolxob e709ce9
Minor copyedits and heading adjustments.
carolxob 74d1ed3
Changed capitalization in title.
carolxob 5f3fb82
Minor changes from doc review feedback.
carolxob f32c31b
Update _data-prepper/peer-forwarder.md
carolxob 01c4fb0
Update _data-prepper/peer-forwarder.md
carolxob d4b1fae
Update _data-prepper/peer-forwarder.md
carolxob 73cc07e
Update _data-prepper/peer-forwarder.md
carolxob c9c3727
Update _data-prepper/peer-forwarder.md
carolxob db822ee
Update _data-prepper/peer-forwarder.md
carolxob 491db10
Trying to commit file.
carolxob a877610
Trying to push file.
carolxob ab8edae
Trying to push file again.
carolxob f83dffd
Trying to push file one more time after rebasing.
carolxob 0ee7850
Minor change.
carolxob 2cb064d
Minor edits.
carolxob 0609ee4
Converted optional configuration section to table.
carolxob 2d1cf02
Minor adjustmenets.
carolxob cb5134a
Minor adjustments again.
carolxob 0b4a055
Updates from doc review feedback.
carolxob 850625f
Made changes based on doc review feedback.
carolxob 588da3f
Made minor heading adjustements.
carolxob 81e08ed
Made edits based on doc review feedback.
carolxob 9f5313e
Made updates based on editorial feedback.
carolxob 156ddc7
Made extensive changes based on editorial feedback.
carolxob 5c640ca
Incorporated minor editorial feedback changes.
carolxob a0eb2ec
Incorporated more editorial feedback.
carolxob 069ef71
Minor changes.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| --- | ||
| layout: default | ||
| title: Peer forwarder | ||
| nav_order: 12 | ||
| --- | ||
|
|
||
| Peer Forwarder is an HTTP service which performs peer forwarding of `Event` between Data Prepper nodes for aggregation. Currently, supported by `aggregate`, `service_map_stateful`, `otel_trace_raw` processors. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| Peer Forwarder groups events based on the identification keys provided the processors. For `service_map_stateful` and `otel_trace_raw` it's `traceId` by default and can not be configured. It's configurable for `aggregate` processor using `identification_keys` configuration option. You can find more information about identification keys [here](https://github.com/opensearch-project/data-prepper/tree/main/data-prepper-plugins/aggregate-processor#identification_keys). | ||
|
carolxob marked this conversation as resolved.
Outdated
carolxob marked this conversation as resolved.
Outdated
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| --- | ||
|
|
||
| Right now, peer discovery is provided by either a static list or by a DNS record lookup or AWS Cloudmap. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| # Discovery modes | ||
|
|
||
| ## Static | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| Static discover mode allows Data Prepper node to discover nodes using a list of IP addresses or domain names. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| ```yaml | ||
|
carolxob marked this conversation as resolved.
|
||
| peer_forwarder: | ||
| discovery_mode: static | ||
| static_endpoints: ["data-prepper1", "data-prepper2"] | ||
| ``` | ||
|
|
||
| ## DNS lookup | ||
| We recommend using DNS discovery over static discovery when scaling out a Data Prepper cluster. The core concept is to configure a DNS provider to return a list of Data Prepper hosts when given a single domain name. This is a [DNS A Record](https://www.cloudflare.com/learning/dns/dns-records/dns-a-record/) which indicates a list of IP addresses of a given domain. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```yaml | ||
|
carolxob marked this conversation as resolved.
|
||
| peer_forwarder: | ||
| discovery_mode: dns | ||
| domain_name: "data-prepper-cluster.my-domain.net" | ||
| ``` | ||
|
|
||
| ## AWS Cloud Map | ||
|
|
||
| [AWS Cloud Map](https://docs.aws.amazon.com/cloud-map/latest/dg/what-is-cloud-map.html) provides API-based service discovery as well as DNS-based service discovery. | ||
|
|
||
| Peer forwarder can use the API-based service discovery. To support this you must have an existing namespace configured for API instance discovery. You can create a new one following the instructions provided by the [Cloud Map documentation](https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-namespaces.html). | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| Your Data Prepper configuration needs to include: | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| * `aws_cloud_map_namespace_name` - Set to your Cloud Map Namespace name | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| * `aws_cloud_map_service_name` - Set to the service name within your specified Namespace | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| * `aws_region` - The AWS region where your namespace exists. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| * `discovery_mode` - Set to `aws_cloud_map` | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| Your Data Prepper configuration can optionally include: | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| * `aws_cloud_map_query_parameters` - Key/value pairs to filter the results based on the custom attributes attached to an instance. Only instances that match all the specified key-value pairs are returned. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Example configuration | ||
|
|
||
| ```yaml | ||
|
carolxob marked this conversation as resolved.
|
||
| peer_forwarder: | ||
| discovery_mode: aws_cloud_map | ||
| aws_cloud_map_namespace_name: "my-namespace" | ||
| aws_cloud_map_service_name: "data-prepper-cluster" | ||
| aws_cloud_map_query_parameters: | ||
| instance_type: "r5.xlarge" | ||
| aws_region: "us-east-1" | ||
| ``` | ||
|
|
||
| ### IAM policy with necessary permissions | ||
|
|
||
| The Data Prepper must also be running with the necessary permissions. The following IAM policy shows the necessary permissions. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```json | ||
| { | ||
| "Version": "2012-10-17", | ||
| "Statement": [ | ||
| { | ||
| "Sid": "CloudMapPeerForwarder", | ||
| "Effect": "Allow", | ||
| "Action": "servicediscovery:DiscoverInstances", | ||
| "Resource": "*" | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
| --- | ||
| # Configuration | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Optional configuration | ||
|
|
||
| * `port`: An `int` between 0 and 65535 represents the port peer forwarder server is running on. Default value is `4994`. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| * `request_timeout`: Duration - An `int` representing the request timeout in milliseconds for Peer Forwarder HTTP server. Default value is `10000`. | ||
| * `server_thread_count`: An `int` representing number of threads used by Peer Forwarder server. Defaults to `200`. | ||
| * `client_thread_count`: An `int` representing number of threads used by Peer Forwarder client. Defaults to `200`. | ||
| * `maxConnectionCount`: An `int` representing maximum number of open connections for Peer Forwarder server. Default value is `500`. | ||
| * `discovery_mode`: A `String` representing the peer discovery mode to be used. Allowable values are `local_node`, `static`, `dns`, and `aws_cloud_map`. Defaults to `local_node` which processes events locally. | ||
| * `static_endpoints`: A `list` containing endpoints of all Data Prepper instances. Required if `discovery_mode` is set to `static`. | ||
| * `domain_name`: A `String` representing single domain name to query DNS against. Typically, used by creating multiple [DNS A Records](https://www.cloudflare.com/learning/dns/dns-records/dns-a-record/) for the same domain. Required if `discovery_mode` is set to `dns`. | ||
| * `aws_cloud_map_namespace_name`: A `String` representing the Cloud Map namespace when using AWS Cloud Map service discovery. Required if `discovery_mode` is set to `aws_cloud_map`. | ||
| * `aws_cloud_map_service_name`: A `String` representing the Cloud Map service when using AWS Cloud Map service discovery. Required if `discovery_mode` is set to `aws_cloud_map`. | ||
| * `aws_cloud_map_query_parameters`: A `Map` of Key/value pairs to filter the results based on the custom attributes attached to an instance. Only instances that match all the specified key-value pairs are returned. | ||
| * `buffer_size`: An `int` representing max number of unchecked records the buffer accepts (num of unchecked records = num of records written into the buffer + num of in-flight records not yet checked by the Checkpointing API). Default is `512`. | ||
| * `batch_size`: An `int` representing max number of records the buffer returns on read. Default is `48`. | ||
| * `aws_region`: A `String` represents the AWS region to use `ACM`, `S3` or `AWS Cloud Map`. Required if `use_acm_certificate_for_ssl` is set to `true` or `ssl_certificate_file` and `ssl_key_file` is `AWS S3` path or if `discovery_mode` is set to `aws_cloud_map`. | ||
| * `drain_timeout`: A `Duration` representing the wait time for the peer forwarder to complete processing data before shutdown. | ||
|
|
||
| # SSL configuration | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| The SSL configuration for setting up trust manager for peer forwarding client to connect to other Data Prepper instances. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Optional SSL configuration | ||
|
|
||
| * `ssl`: A `boolean` that enables TLS/SSL. Default value is `true`. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| * `ssl_certificate_file`: A `String` representing the SSL certificate chain file path or AWS S3 path. S3 path example `s3://<bucketName>/<path>`. Defaults to `config/default_certificate.pem` which is default certificate file. Read more about how the certificate file is generated [here](https://github.com/opensearch-project/data-prepper/tree/main/examples/certificates). | ||
| * `ssl_key_file`: A `String` represents the SSL key file path or AWS S3 path. S3 path example `s3://<bucketName>/<path>`. Defaults to `config/default_private_key.pem` which is default private key file. Read more about how the private key file is generated [here](https://github.com/opensearch-project/data-prepper/tree/main/examples/certificates). | ||
| * `ssl_insecure_disable_verification`: A `boolean` that disables the verification of server's TLS certificate chain. Default value is `false`. | ||
| * `ssl_fingerprint_verification_only`: A `boolean` that disables the verification of server's TLS certificate chain and instead verifies only the certificate fingerprint. Default value is `false`. | ||
| * `use_acm_certificate_for_ssl`: A `boolean` that enables TLS/SSL using certificate and private key from AWS Certificate Manager (ACM). Default is `false`. | ||
| * `acm_certificate_arn`: A `String` represents the ACM certificate ARN. ACM certificate take preference over S3 or local file system certificate. Required if `use_acm_certificate_for_ssl` is set to `true`. | ||
| * `acm_private_key_password`: A `String` that represents the ACM private key password which that will be used to decrypt the private key. If it's not provided, a random password will be generated. | ||
| * `acm_certificate_timeout_millis`: An `int` representing the timeout in milliseconds for ACM to get certificates. Default value is `120000`. | ||
| * `aws_region`: A `String` represents the AWS region to use `ACM`, `S3` or `AWS Cloud Map`. Required if `use_acm_certificate_for_ssl` is set to `true` or `ssl_certificate_file` and `ssl_key_file` is `AWS S3` path or if `discovery_mode` is set to `aws_cloud_map`. | ||
|
|
||
| ```yaml | ||
| peer_forwarder: | ||
| ssl: true | ||
| ssl_certificate_file: "<cert-file-path>" | ||
| ssl_key_file: "<private-key-file-path>" | ||
| ``` | ||
|
|
||
| # Authentication | ||
|
|
||
|
carolxob marked this conversation as resolved.
|
||
| * `authentication`(Optional) : A `Map` that enables mTLS. It can either be `mutual_tls` or `unauthenticated`. Default value is `unauthenticated`. | ||
| ```yaml | ||
|
carolxob marked this conversation as resolved.
|
||
| peer_forwarder: | ||
| authentication: | ||
| mutual_tls: | ||
| ``` | ||
|
|
||
| # Metrics | ||
|
|
||
|
carolxob marked this conversation as resolved.
|
||
| Core Peer Forwarder introduces the following custom metrics and all the metrics are prefixed by `core.peerForwarder`. | ||
|
carolxob marked this conversation as resolved.
Outdated
carolxob marked this conversation as resolved.
Outdated
|
||
|
|
||
| # Timer | ||
|
|
||
|
carolxob marked this conversation as resolved.
|
||
| - `requestForwardingLatency`: measures latency of forwarding requests by peer forwarder client. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| - `requestProcessingLatency`: measures latency of processing requests by peer forwarder server. | ||
|
|
||
| # Counter | ||
|
|
||
|
carolxob marked this conversation as resolved.
|
||
| - `requests`: measures total number of forwarded requests. | ||
| - `requestsFailed`: measures total number of failed requests. Requests with HTTP response code other than `200`. | ||
| - `requestsSuccessful`: measures total number of successful requests. Requests with HTTP response code `200`. | ||
| - `requestsTooLarge`: measures total number of requests which are too large to be written to peer forwarder buffer. Requests with HTTP response code `413`. | ||
| - `requestTimeouts`: measures total number of requests which timed out while writing content to peer forwarder buffer. Requests with HTTP response code `408`. | ||
|
carolxob marked this conversation as resolved.
Outdated
|
||
| - `requestsUnprocessable`: measures total number of requests which failed due to unprocessable entity. Requests with HTTP response code `422`. | ||
| - `badRequests`: measures total number of requests with bad request format. Requests with HTTP response code `400`. | ||
| - `recordsSuccessfullyForwarded`: measures total number of forwarded records successfully. | ||
| - `recordsFailedForwarding`: measures total number of records failed to be forwarded. | ||
| - `recordsToBeForwarded`: measures total number of records to be forwarded. | ||
| - `recordsToBeProcessedLocally`: measures total number of records to be processed locally. | ||
| - `recordsActuallyProcessedLocally`: measures total number of records actually processed locally. Sum of `recordsToBeProcessedLocally` and `recordsFailedForwarding`. | ||
| - `recordsReceivedFromPeers`: measures total number of records received from remote peers. | ||
|
|
||
| ## Gauge | ||
|
|
||
|
carolxob marked this conversation as resolved.
|
||
| - `peerEndpoints`: measures number of dynamically discovered peer data-prepper endpoints. For `static` mode, the size is fixed. | ||
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.