|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * observability/otel/otel-collector/otel-collector-exporters.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: REFERENCE |
| 6 | +[id="otel-exporters-aws-emf-exporter_{context}"] |
| 7 | += AWS EMF Exporter |
| 8 | + |
| 9 | +[role="_abstract"] |
| 10 | +The AWS EMF Exporter converts the following OpenTelemetry metrics datapoints to the AWS CloudWatch Embedded Metric Format (EMF): |
| 11 | + |
| 12 | +- `Int64DataPoints` |
| 13 | +- `DoubleDataPoints` |
| 14 | +- `SummaryDataPoints` |
| 15 | +
|
| 16 | +The EMF metrics are then sent directly to the Amazon CloudWatch Logs service by using the `PutLogEvents` API. |
| 17 | + |
| 18 | +One of the benefits of using this exporter is the possibility to view logs and metrics in the Amazon CloudWatch console at link:https://console.aws.amazon.com/cloudwatch/[]. |
| 19 | + |
| 20 | +:FeatureName: The AWS EMF Exporter |
| 21 | +include::snippets/technology-preview.adoc[] |
| 22 | + |
| 23 | +.OpenTelemetry Collector custom resource with the enabled AWS EMF Exporter |
| 24 | +[source,yaml] |
| 25 | +---- |
| 26 | +# ... |
| 27 | + config: |
| 28 | + exporters: |
| 29 | + awsemf: |
| 30 | + log_group_name: "<group_name_of_amazon_cloudwatch_logs>" # <1> |
| 31 | + log_stream_name: "<log_stream_of_amazon_cloudwatch_logs>" # <2> |
| 32 | + resource_to_telemetry_conversion: # <3> |
| 33 | + enabled: true |
| 34 | + region: <region> # <4> |
| 35 | + endpoint: <protocol><endpoint> # <5> |
| 36 | + log_retention: <supported_value_in_days> # <6> |
| 37 | + namespace: <custom_namespace> # <7> |
| 38 | +# ... |
| 39 | +---- |
| 40 | +<1> You can use the `log_group_name` parameter to customize the log group name or set the default `+/metrics/default+` value or the following placeholders: |
| 41 | ++ |
| 42 | +The `+/aws/metrics/{ClusterName}+` placeholder is for searching for the `ClusterName` or `+aws.ecs.cluster.name+` resource attribute in the metrics data and replacing it with the actual cluster name. |
| 43 | ++ |
| 44 | +The `+{NodeName}+` placeholder is for searching for the `NodeName` or `+k8s.node.name+` resource attribute. |
| 45 | ++ |
| 46 | +The `+{TaskId}+` placeholder is for searching for the `TaskId` or `+aws.ecs.task.id+` resource attribute. |
| 47 | ++ |
| 48 | +If no resource attribute is found in the resource attribute map, the placeholder is replaced by the `undefined` value. |
| 49 | +<2> You can use the `log_stream_name` parameter to customize the log stream name or set the default `+otel-stream+` value or the following placeholders: |
| 50 | ++ |
| 51 | +The `+{ClusterName}+` placeholder is for searching for the `+ClusterName+` or `+aws.ecs.cluster.name+` resource attribute. |
| 52 | ++ |
| 53 | +The `+{ContainerInstanceId}+` placeholder is for searching for the `+ContainerInstanceId+` or `+aws.ecs.container.instance.id+` resource attribute. This resource attribute is valid only for the AWS ECS EC2 launch type. |
| 54 | ++ |
| 55 | +The `+{NodeName}+` placeholder is for searching for the `+NodeName+` or `+k8s.node.name+` resource attribute. |
| 56 | ++ |
| 57 | +The `+{TaskDefinitionFamily}+` placeholder is for searching for the `+TaskDefinitionFamily+` or `+aws.ecs.task.family+` resource attribute. |
| 58 | ++ |
| 59 | +The `+{TaskId}+` placeholder is for searching for the `TaskId` or `+aws.ecs.task.id+` resource attribute in the metrics data and replacing it with the actual task ID. |
| 60 | ++ |
| 61 | +If no resource attribute is found in the resource attribute map, the placeholder is replaced by the `undefined` value. |
| 62 | +<3> Optional. Converts resource attributes to telemetry attributes such as metric labels. Disabled by default. |
| 63 | +<4> The AWS region of the log stream. If a region is not already set in the default credential provider chain, you must specify the region. |
| 64 | +<5> Optional. You can override the default Amazon CloudWatch Logs service endpoint to which the requests are forwarded. You must include the protocol, such as `https://`, as part of the endpoint value. For the list of service endpoints by region, see link:https://docs.aws.amazon.com/general/latest/gr/cwl_region.html[Amazon CloudWatch Logs endpoints and quotas] (AWS General Reference). |
| 65 | +<6> Optional. With this parameter, you can set the log retention policy for new Amazon CloudWatch log groups. If this parameter is omitted or set to `0`, the logs never expire by default. Supported values for retention in days are `1`, `3`, `5`, `7`, `14`, `30`, `60`, `90`, `120`, `150`, `180`, `365`, `400`, `545`, `731`, `1827`, `2192`, `2557`, `2922`, `3288`, or `3653`. |
| 66 | +<7> Optional. A custom namespace for the Amazon CloudWatch metrics. |
| 67 | + |
| 68 | +[role="_additional-resources"] |
| 69 | +.Additional resources |
| 70 | +* link:https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format_Specification.html[Amazon CloudWatch User Guide: Specification: Embedded metric format] |
| 71 | +* link:https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html[Amazon CloudWatch Logs API Reference: PutLogEvents] |
| 72 | +* link:https://docs.aws.amazon.com/general/latest/gr/cwl_region.html[AWS General Reference: Amazon CloudWatch Logs endpoints and quotas] |
0 commit comments