-
Notifications
You must be signed in to change notification settings - Fork 692
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
Changes from 27 commits
30586d3
73fab9f
f8feef6
24d4a5e
7fb9b33
e709ce9
74d1ed3
5f3fb82
f32c31b
01c4fb0
d4b1fae
73cc07e
c9c3727
db822ee
491db10
a877610
ab8edae
f83dffd
0ee7850
2cb064d
0609ee4
2d1cf02
cb5134a
0b4a055
850625f
588da3f
81e08ed
9f5313e
156ddc7
5c640ca
a0eb2ec
069ef71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,186 @@ | ||||||
| --- | ||||||
| layout: default | ||||||
| title: Peer Forwarder | ||||||
| nav_order: 12 | ||||||
| --- | ||||||
|
|
||||||
| # Peer Forwarder | ||||||
|
|
||||||
| Peer Forwarder is an HTTP service that performs peer forwarding of an `event` between Data Prepper nodes for aggregation. Currently, Peer Forwarder is supported by `aggregate`, `service_map_stateful`, `otel_trace_raw` processors. | ||||||
|
|
||||||
| Peer Forwarder groups events based on the identification keys provided by the processors. For `service_map_stateful` and `otel_trace_raw`, the identification key is `traceId` by default and cannot be configured. The `aggregate` processor is configured using the `identification_keys` configuration option. From here, you can specify which keys to use for Peer Forwarder. You can find more information about [identification keys](https://github.com/opensearch-project/data-prepper/tree/main/data-prepper-plugins/aggregate-processor#identification_keys) on the aggregate processor page. | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
|
|
||||||
| Peer discovery is currently provided by either a static list or by a DNS record lookup or AWS Cloud Map. | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| ## Discovery modes | ||||||
|
|
||||||
| See the following information about discovery modes below. | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| ### Static | ||||||
|
|
||||||
| Static discovery mode allows a Data Prepper node to discover nodes using a list of IP addresses or domain names. | ||||||
|
|
||||||
| ```yaml | ||||||
|
carolxob marked this conversation as resolved.
|
||||||
| peer_forwarder:4 | ||||||
| discovery_mode: static | ||||||
| static_endpoints: ["data-prepper1", "data-prepper2"] | ||||||
| ``` | ||||||
|
|
||||||
| ### DNS lookup | ||||||
| DNS discovery is preferred 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
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.
|
||||||
|
|
||||||
| See the following for optional configuration values. | ||||||
|
|
||||||
| ### Optional configuration | ||||||
|
|
||||||
| | Value | Description | | ||||||
| | ---- | ----------- | | ||||||
| | `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`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `server_thread_count` | An `int` representing number of threads used by the Peer Forwarder server. Defaults to `200`.| | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `client_thread_count` | An `int` representing number of threads used by the Peer Forwarder client. Defaults to `200`.| | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `maxConnectionCount` | An `int` representing maximum number of open connections for Peer Forwarder server. Default value is `500`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `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. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `static_endpoints` | A `list` containing endpoints of all Data Prepper instances. Required if `discovery_mode` is set to `static`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `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`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `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`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `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`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `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. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `buffer_size` | An `int` representing max number of unchecked records the buffer accepts (num of unchecked records equals the number of records written into the buffer + the number of in-flight records not yet checked by the Checkpointing API). Default is `512`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `batch_size` | An `int` representing max number of records the buffer returns on read. Default is `48`. | | ||||||
|
carolxob marked this conversation as resolved.
|
||||||
| | `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`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `drain_timeout` | A `Duration` representing the wait time for the Peer Forwarder to complete processing data before shutdown. | | ||||||
|
carolxob marked this conversation as resolved.
|
||||||
|
|
||||||
| ## SSL configuration | ||||||
| The SSL configuration for setting up trust manager for the peer forwarding client to connect to other Data Prepper instances. | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| ### Optional SSL configuration | ||||||
|
|
||||||
| See the table below for optional SSL configuration descriptions. | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| | Value | Description | | ||||||
| | ----- | ----------- | | ||||||
| | `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 the default certificate file,`config/default_certificate.pem`. Read more about how the certificate file is generated at the [Default Certificates](https://github.com/opensearch-project/data-prepper/tree/main/examples/certificates) page. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `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 at the [Default Certificates](https://github.com/opensearch-project/data-prepper/tree/main/examples/certificates) page. | | ||||||
| | `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`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `use_acm_certificate_for_ssl` | A `boolean` that enables TLS/SSL using certificate and private key from AWS Certificate Manager (ACM). Default is `false`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `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`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `acm_private_key_password` | A `String` that represents the ACM private key password that will be used to decrypt the private key. If it's not provided, a random password will be generated. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `acm_certificate_timeout_millis` | An `int` representing the timeout in milliseconds for ACM to get certificates. Default value is `120000`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `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`. | | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @natebower Please clarify what specifically needs extra revision here. Right now, it reads: " A
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As written, the sentences are difficult to parse because they are confusingly organized. They need to be simplified/clarified.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cwillum This comment will need some extra attention in doc review, FYI!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Naarcha-AWS Please take a look. Thanks! |
||||||
|
|
||||||
| #### Example config | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| ```yaml | ||||||
| peer_forwarder: | ||||||
| ssl: true | ||||||
| ssl_certificate_file: "<cert-file-path>" | ||||||
| ssl_key_file: "<private-key-file-path>" | ||||||
| ``` | ||||||
|
|
||||||
| ## Authentication | ||||||
|
|
||||||
| This section describes optional authentication. | ||||||
|
|
||||||
| `authentication`(optional) : A `Map` that enables mTLS. It can either be `mutual_tls` or `unauthenticated`. The default value is `unauthenticated`. | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
|
carolxob marked this conversation as resolved.
|
||||||
| ```yaml | ||||||
|
carolxob marked this conversation as resolved.
|
||||||
| peer_forwarder: | ||||||
| authentication: | ||||||
| mutual_tls: | ||||||
| ``` | ||||||
|
|
||||||
| ## Metrics | ||||||
|
|
||||||
| This section describes Peer Forwarder's metrics capabilities, including timer, counter, and gauge. | ||||||
|
|
||||||
|
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 | ||||||
|
|
||||||
| This section describes the timer metrics feature. | ||||||
|
|
||||||
|
carolxob marked this conversation as resolved.
|
||||||
| - `requestForwardingLatency`: measures latency of forwarding requests by the Peer Forwarder client. | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| - `requestProcessingLatency`: measures latency of processing requests by Peer Forwarder server. | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| ### Counter | ||||||
|
|
||||||
|
carolxob marked this conversation as resolved.
|
||||||
| See the table below for counter metric options. | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| | Value | Description | | ||||||
|
carolxob marked this conversation as resolved.
|
||||||
| | ----- | ----------- | | ||||||
| | `requests`| Measures total number of forwarded requests. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `requestsFailed`| Measures total number of failed requests. Requests with HTTP response code other than `200`. | | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The meaning of the second sentence is unclear. Please revise. Also please revise the subsequent sentences that are in the same format.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chenqi0805 Can you clarify what the second sentence is attempting to communicate?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dlvenable Do you have any feedback on this? |
||||||
| | `requestsSuccessful`| Measures total number of successful requests. Requests with HTTP response code `200`. | | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chenqi0805 Also need clarification on the second sentence here. It looks like some information may have been cut off. Could it be replaced with, "Includes requests with HTTP response code |
||||||
| | `requestsTooLarge`| Measures total number of requests that are too large to be written to Peer Forwarder buffer. Requests with HTTP response code `413`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `requestTimeouts`| Measures the total number of requests that 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 that failed due to unprocessable entity. Requests with HTTP response code `422`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `badRequests`| Measures total number of requests with bad request format. Requests with HTTP response code `400`. | | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do we mean by "with bad request format"? "Measures the total number of requests that are in an incorrect request format."?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chenqi0805 Can you please clarify what "with bad request format" means? Should we use "Measures the total number of requests that are in an incorrect request format." ? |
||||||
| | `recordsSuccessfullyForwarded`| Measures total number of forwarded records successfully. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `recordsFailedForwarding`| Measures total number of records failed to be forwarded. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `recordsToBeForwarded` | Measures total number of records to be forwarded. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `recordsToBeProcessedLocally` | Measures total number of records to be processed locally. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `recordsActuallyProcessedLocally`| Measures total number of records actually processed locally. Sum of `recordsToBeProcessedLocally` and `recordsFailedForwarding`. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
| | `recordsReceivedFromPeers`| Measures total number of records received from remote peers. | | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
|
carolxob marked this conversation as resolved.
|
||||||
| ### Gauge | ||||||
|
|
||||||
| This section describes gauge metric options. | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
|
carolxob marked this conversation as resolved.
|
||||||
| `peerEndpoints` Measures number of dynamically discovered peer Data Prepper endpoints. For `static` mode, the size is fixed. | ||||||
|
carolxob marked this conversation as resolved.
Outdated
|
||||||
Uh oh!
There was an error while loading. Please reload this page.