Skip to content

Commit 0318453

Browse files
Otel doc fixes (#10150) (#10171)
1 parent 00a98d8 commit 0318453

File tree

6 files changed

+74
-4
lines changed

6 files changed

+74
-4
lines changed

_data-prepper/pipelines/configuration/sinks/opensearch.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ Option | Required | Type | Description
6666
`insecure` | No | Boolean | Whether or not to verify SSL certificates. If set to `true`, then certificate authority (CA) certificate verification is disabled and insecure HTTP requests are sent instead. Default is `false`.
6767
`proxy` | No | String | The address of the [forward HTTP proxy server](https://en.wikipedia.org/wiki/Proxy_server). The format is `"<hostname or IP>:<port>"` (for example, `"example.com:8100"`, `"http://example.com:8100"`, `"112.112.112.112:8100"`). The port number cannot be omitted.
6868
`index` | Conditionally | String | The name of the export index. Only required when the `index_type` is `custom`. The index can be a plain string, such as `my-index-name`, contain [Java date-time patterns](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html), such as `my-index-%{yyyy.MM.dd}` or `my-%{yyyy-MM-dd-HH}-index`, be formatted using field values, such as `my-index-${/my_field}`, or use [Data Prepper expressions]({{site.url}}{{site.baseurl}}/data-prepper/pipelines/expression-syntax/), such as `my-index-${getMetadata(\"my_metadata_field\"}`. All formatting options can be combined to provide flexibility when creating static, dynamic, and rolling indexes.
69-
`index_type` | No | String | Tells the sink plugin what type of data it is handling. Valid values are `custom`, `trace-analytics-raw`, `trace-analytics-service-map`, or `management-disabled`. Default is `custom`.
69+
`index_type` | No | String | Specifies the type of data the sink plugin handles. Valid values include `custom`, `trace-analytics-raw`, `trace-analytics-plain-raw`, `trace-analytics-service-map`, `log-analytics`, `log-analytics-plain`, `metric-analytics`, `metric-analytics-plain`, and `management-disabled`. <br><br>To produce Amazon Security Lake–compliant data from the `otel_logs_source` with `output_format: otel`, set `index_type` to `log-analytics-plain`. <br>For `otel_metrics_source` with `output_format: otel`, set `index_type` to `metric-analytics-plain`. <br>For `otel_trace_source` with `output_format: otel`, set `index_type` to `trace-analytics-plain-raw`. <br><br>Default is `custom`.
70+
71+
7072
`template_type` | No | String | Defines what type of OpenSearch template to use. Available options are `v1` and `index-template`. The default value is `v1`, which uses the original OpenSearch templates available at the `_template` API endpoints. The `index-template` option uses composable [index templates]({{site.url}}{{site.baseurl}}/opensearch/index-templates/), which are available through the OpenSearch `_index_template` API. Composable index types offer more flexibility than the default and are necessary when an OpenSearch cluster contains existing index templates. Composable templates are available for all versions of OpenSearch and some later versions of Elasticsearch. When `distribution_version` is set to `es6`, Data Prepper enforces the `template_type` as `v1`.
7173
`template_file` | No | String | The path to a JSON [index template]({{site.url}}{{site.baseurl}}/opensearch/index-templates/) file, such as `/your/local/template-file.json`, when `index_type` is set to `custom`. For an example template file, see [otel-v1-apm-span-index-template.json](https://github.com/opensearch-project/data-prepper/blob/main/data-prepper-plugins/opensearch/src/main/resources/otel-v1-apm-span-index-template.json). If you supply a template file, then it must match the template format specified by the `template_type` parameter.
7274
`template_content` | No | JSON | Contains all the inline JSON found inside of the index [index template]({{site.url}}{{site.baseurl}}/opensearch/index-templates/). For an example of template content, see [the example template content](#example_template_content).

_data-prepper/pipelines/configuration/sources/otel-logs-source.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ You can configure the `otel_logs_source` source with the following options.
2929
| unframed_requests | Boolean | Enables requests that are not framed using the gRPC wire protocol. Default value is `false`. |
3030
| thread_count | int | The number of threads to keep in the `ScheduledThreadPool`. Default value is `500`. |
3131
| max_connection_count | int | The maximum number of open connections allowed. Default value is `500`. |
32+
| `output_format` | String | Specifies the output format of the generated events. Valid values are `otel` or `opensearch`. Default is `opensearch`. |
33+
3234

3335
### SSL
3436

@@ -52,6 +54,15 @@ source:
5254
- otel_logs_source:
5355
```
5456

57+
To generate data in the OpenTelemetry format, set the `output_format` setting to `otel`, as shown in the following example:
58+
59+
```yaml
60+
source:
61+
- otel_logs_source:
62+
output_format: otel
63+
```
64+
{% include copy.html %}
65+
5566
## Metrics
5667
5768
You can use the following metrics with the `otel_logs_source` source.
@@ -65,4 +76,4 @@ You can use the following metrics with the `otel_logs_source` source.
6576
| `internalServerError` | Counter | Measures the total number of requests that are erroneous due to errors other than `requestTimeouts` or `requestsTooLarge`. |
6677
| `successRequests` | Counter | Measures the total number of requests successfully written to the buffer. |
6778
| `payloadSize` | Distribution summary | Measures the distribution of all incoming payload sizes. |
68-
| `requestProcessDuration` | Timer | Measures the duration of request processing. |
79+
| `requestProcessDuration` | Timer | Measures the duration of request processing. |

_data-prepper/pipelines/configuration/sources/otel-metrics-source.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ proto_reflection_service | No | Boolean | Enables a reflection service for Proto
1919
unframed_requests | No | Boolean | Enables requests not framed using the gRPC wire protocol.
2020
thread_count | No | Integer | The number of threads to keep in the `ScheduledThreadPool`. Default value is `200`.
2121
max_connection_count | No | Integer | The maximum allowed number of open connections. Default value is `500`.
22+
| `output_format` | String | Specifies the output format of the generated events. Valid values are `otel` or `opensearch`. Default is `opensearch`. |
2223
max_request_length | No | ByteCount | The maximum number of bytes allowed in the payload of a single gRPC or HTTP request. Default value is `10mb`.
2324
ssl | No | Boolean | Enables connections to the OpenTelemetry source port over TLS/SSL. Default value is `true`.
2425
sslKeyCertChainFile | Conditionally | String | File-system path or Amazon Simple Storage Service (Amazon S3) path to the security certificate (for example, `"config/demo-data-prepper.crt"` or `"s3://my-secrets-bucket/demo-data-prepper.crt"`). Required if `ssl` is set to `true`.
@@ -28,9 +29,25 @@ acmCertificateArn | Conditionally | String | Represents the ACM certificate ARN.
2829
awsRegion | Conditionally | String | Represents the AWS Region used by ACM or Amazon S3. Required if `useAcmCertForSSL` is set to `true` or `sslKeyCertChainFile` and `sslKeyFile` is the Amazon S3 path.
2930
authentication | No | Object | An authentication configuration. By default, an unauthenticated server is created for the pipeline. This uses pluggable authentication for HTTPS. To use basic authentication, define the `http_basic` plugin with a `username` and `password`. To provide customer authentication, use or create a plugin that implements [GrpcAuthenticationProvider](https://github.com/opensearch-project/data-prepper/blob/1.2.0/data-prepper-plugins/armeria-common/src/main/java/com/amazon/dataprepper/armeria/authentication/GrpcAuthenticationProvider.java).
3031

31-
<!--- ## Configuration
32+
## Usage
33+
34+
To use the `otel-metrics` source, create the following `pipeline.yaml` file with `otel_metrics_source` as the source:
35+
36+
```yaml
37+
source:
38+
- otel_metrics_source:
39+
```
40+
{% include copy.html %}
41+
42+
To use the OpenTelemetry format for your output, set the `output_format` to `otel`, as shown in the following example:
43+
44+
```yaml
45+
source:
46+
- otel_metrics_source:
47+
output_format: otel
48+
```
49+
{% include copy.html %}
3250

33-
Content will be added to this section.--->
3451

3552
## Metrics
3653

_data-prepper/pipelines/configuration/sources/otel-trace-source.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ proto_reflection_service | No | Boolean | Enables a reflection service for Proto
2424
unframed_requests | No | Boolean | Enable requests not framed using the gRPC wire protocol.
2525
thread_count | No | Integer | The number of threads to keep in the ScheduledThreadPool. Default value is `200`.
2626
max_connection_count | No | Integer | The maximum allowed number of open connections. Default value is `500`.
27+
| `output_format` | String | Specifies the output format of the generated events. Valid values are `otel` or `opensearch`. Default is `opensearch`. |
2728
max_request_length | No | ByteCount | The maximum number of bytes allowed in the payload of a single gRPC or HTTP request. Default value is `10mb`.
2829
ssl | No | Boolean | Enables connections to the OTel source port over TLS/SSL. Defaults to `true`.
2930
sslKeyCertChainFile | Conditionally | String | File system path or Amazon Simple Storage Service (Amazon S3) path to the security certificate (for example, `"config/demo-data-prepper.crt"` or `"s3://my-secrets-bucket/demo-data-prepper.crt"`). Required if `ssl` is set to `true`.
@@ -33,6 +34,24 @@ acmCertificateArn | Conditionally | String | Represents the ACM certificate ARN.
3334
awsRegion | Conditionally | String | Represents the AWS region used by ACM or Amazon S3. Required if `useAcmCertForSSL` is set to `true` or `sslKeyCertChainFile` and `sslKeyFile` are Amazon S3 paths.
3435
authentication | No | Object | An authentication configuration. By default, an unauthenticated server is created for the pipeline. This parameter uses pluggable authentication for HTTPS. To use basic authentication, define the `http_basic` plugin with a `username` and `password`. To provide customer authentication, use or create a plugin that implements [GrpcAuthenticationProvider](https://github.com/opensearch-project/data-prepper/blob/1.2.0/data-prepper-plugins/armeria-common/src/main/java/com/amazon/dataprepper/armeria/authentication/GrpcAuthenticationProvider.java).
3536

37+
## Usage
38+
39+
To use the `otel-metrics` source, create the following `pipeline.yaml` file with `otel_metrics_source` as the source:
40+
41+
```yaml
42+
source:
43+
- otel_trace_source:
44+
```
45+
{% include copy.html %}
46+
47+
If you want to use the OpenTelemetry format for your output, set the `output_format` to `otel`, as shown in the following example:
48+
49+
```yaml
50+
source:
51+
- otel_trace_source:
52+
output_format: otel
53+
```
54+
{% include copy.html %}
3655

3756
## Metrics
3857

_data-prepper/pipelines/functions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ OpenSearch Data Prepper offers a range of built-in functions that can be used wi
1313
- [`cidrContains()`]({{site.url}}{{site.baseurl}}/data-prepper/pipelines/cidrcontains/)
1414
- [`contains()`]({{site.url}}{{site.baseurl}}/data-prepper/pipelines/contains/)
1515
- [`getMetadata()`]({{site.url}}{{site.baseurl}}/data-prepper/pipelines/get-metadata/)
16+
- [`getEventType()`]({{site.url}}{{site.baseurl}}/data-prepper/pipelines/get-eventtype/)
1617
- [`hasTags()`]({{site.url}}{{site.baseurl}}/data-prepper/pipelines/has-tags/)
1718
- [`join()`]({{site.url}}{{site.baseurl}}/data-prepper/pipelines/join/)
1819
- [`length()`]({{site.url}}{{site.baseurl}}/data-prepper/pipelines/length/)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
layout: default
3+
title: getEventType()
4+
parent: Functions
5+
grand_parent: Pipelines
6+
nav_order: 45
7+
---
8+
9+
# getEventType()
10+
11+
The `getEventType()` function returns the internal event type of the current event.
12+
13+
The return value is one of the event types defined in the `EventType.java` file. For example, if the event is an OpenTelemetry trace event, the returned event type is `TRACE`.
14+
15+
Use this function to check the event type before performing conditional processing, as shown in the following example:
16+
17+
```json
18+
getEventType() == "TRACE"
19+
```
20+
{% include copy.html %}

0 commit comments

Comments
 (0)