Skip to content

Commit bc3885b

Browse files
feat(otelcol.receiver): add awss3 receiver (#4928)
* feat: add awss3receiver component template * fix: imports * feat: map config * feat: remove currently not supported Encodings and Notification blocks * fix: filename * feat: add arguments test * feat: register component * feat: add awss3 otelconverter * chore: update changelog * fix: state type * feat: add component docs * chore: make generate-gh-issue-templates * fix: docs link typo * fix: otelconvert fixtures * fix: typo * fix: doc * chore: go generate ./internal/tools/docs_generator/ * feat: map awss3receiver defaults to SetToDefault * feat: add config defaults break change test * fix: apply doc suggestions from code review Co-authored-by: Clayton Cornell <[email protected]> * fix: tests * fix: Apply suggestions from code review Co-authored-by: Clayton Cornell <[email protected]> * fix: mention that awss3 supports any kind of telemetry * fix: codegen --------- Co-authored-by: Clayton Cornell <[email protected]>
1 parent 5f9893e commit bc3885b

File tree

16 files changed

+693
-0
lines changed

16 files changed

+693
-0
lines changed

.github/ISSUE_TEMPLATE/blank.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ body:
121121
- otelcol.processor.transform
122122
- otelcol.receiver.awscloudwatch
123123
- otelcol.receiver.awsecscontainermetrics
124+
- otelcol.receiver.awss3
124125
- otelcol.receiver.cloudflare
125126
- otelcol.receiver.datadog
126127
- otelcol.receiver.faro

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ body:
121121
- otelcol.processor.transform
122122
- otelcol.receiver.awscloudwatch
123123
- otelcol.receiver.awsecscontainermetrics
124+
- otelcol.receiver.awss3
124125
- otelcol.receiver.cloudflare
125126
- otelcol.receiver.datadog
126127
- otelcol.receiver.faro

.github/ISSUE_TEMPLATE/docs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ body:
124124
- otelcol.processor.transform
125125
- otelcol.receiver.awscloudwatch
126126
- otelcol.receiver.awsecscontainermetrics
127+
- otelcol.receiver.awss3
127128
- otelcol.receiver.cloudflare
128129
- otelcol.receiver.datadog
129130
- otelcol.receiver.faro

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ body:
121121
- otelcol.processor.transform
122122
- otelcol.receiver.awscloudwatch
123123
- otelcol.receiver.awsecscontainermetrics
124+
- otelcol.receiver.awss3
124125
- otelcol.receiver.cloudflare
125126
- otelcol.receiver.datadog
126127
- otelcol.receiver.faro

.github/ISSUE_TEMPLATE/proposal.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ body:
121121
- otelcol.processor.transform
122122
- otelcol.receiver.awscloudwatch
123123
- otelcol.receiver.awsecscontainermetrics
124+
- otelcol.receiver.awss3
124125
- otelcol.receiver.cloudflare
125126
- otelcol.receiver.datadog
126127
- otelcol.receiver.faro

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Main (unreleased)
1212

1313
### Features
1414

15+
- (_Experimental_) A new `otelcol.receiver.awss3` component to receive traces previously stored in S3 by the [AWS S3 Exporter](https://grafana.com/docs/alloy/latest/reference/components/otelcol/otelcol.exporter.awss3/). (@x1unix)
16+
1517
- A new `mimir.alerts.kubernetes` component which discovers `AlertmanagerConfig` Kubernetes resources and loads them into a Mimir instance. (@ptodev)
1618

1719
- Mark `stage.windowsevent` block in the `loki.process` component as GA. (@kgeckhart)

docs/sources/reference/compatibility/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ The following components, grouped by namespace, _consume_ OpenTelemetry `otelcol
384384
- [otelcol.processor.transform](../components/otelcol/otelcol.processor.transform)
385385
- [otelcol.receiver.awscloudwatch](../components/otelcol/otelcol.receiver.awscloudwatch)
386386
- [otelcol.receiver.awsecscontainermetrics](../components/otelcol/otelcol.receiver.awsecscontainermetrics)
387+
- [otelcol.receiver.awss3](../components/otelcol/otelcol.receiver.awss3)
387388
- [otelcol.receiver.cloudflare](../components/otelcol/otelcol.receiver.cloudflare)
388389
- [otelcol.receiver.datadog](../components/otelcol/otelcol.receiver.datadog)
389390
- [otelcol.receiver.faro](../components/otelcol/otelcol.receiver.faro)
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
---
2+
canonical: https://grafana.com/docs/alloy/latest/reference/components/otelcol/otelcol.receiver.awss3/
3+
description: Learn about otelcol.receiver.awss3
4+
labels:
5+
stage: experimental
6+
products:
7+
- oss
8+
title: otelcol.receiver.awss3
9+
---
10+
11+
# `otelcol.receiver.awss3`
12+
13+
{{< docs/shared lookup="stability/experimental.md" source="alloy" version="<ALLOY_VERSION>" >}}
14+
15+
`otelcol.receiver.awss3` receives telemetry stored in S3 by the [AWS S3 Exporter](./otelcol.exporter.awss3.md).
16+
17+
{{< admonition type="warning" >}}
18+
`otelcol.receiver.awss3` is a wrapper over the upstream OpenTelemetry Collector [`awss3`][] receiver.
19+
Bug reports or feature requests will be redirected to the upstream repository, if necessary.
20+
21+
[`awss3`]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/{{< param "OTEL_VERSION" >}}/receiver/awss3receiver
22+
{{< /admonition >}}
23+
24+
The receiver has two modes of operation:
25+
26+
- **Time Range Mode** - Specify start and end to fetch data from a specific time range.
27+
- **SQS Message Mode** - Subscribe to SQS messages to process objects as they arrive.
28+
29+
The receiver supports the following encodings:
30+
31+
- `otlp_json` (OpenTelemetry Protocol format represented as JSON) with a suffix of `.json`
32+
- `otlp_proto` (OpenTelemetry Protocol format represented as Protocol Buffers) with a suffix of `.binpb`
33+
34+
{{< admonition type="note" >}}
35+
Currently, `otelcol.receiver.awss3` receiver doesn't support encoding extensions.
36+
{{< /admonition >}}
37+
38+
You can specify multiple `otelcol.receiver.awss3` components by giving them different labels.
39+
40+
## Usage
41+
42+
```alloy
43+
otelcol.receiver.awss3 "<LABEL>" {
44+
start_time = "..."
45+
end_time = "..."
46+
47+
s3downloader {
48+
s3_bucket = "..."
49+
s3_prefix = "..."
50+
}
51+
52+
output {
53+
logs = [...]
54+
metrics = [...]
55+
trace = [...]
56+
}
57+
}
58+
```
59+
60+
## Arguments
61+
62+
You can use the following arguments with `otelcol.receiver.awss3`:
63+
64+
| Name | Type | Description | Default | Required |
65+
| ------------ | -------- | ------------------------------------------- | ------- | ----------------------------- |
66+
| `start_time` | `string` | The time at which to start retrieving data. | | Required if fetching by time. |
67+
| `end_time` | `string` | The time at which to stop retrieving data. | | Required if fetching by time. |
68+
69+
The `start_time` and `end_time` fields use one of the following time formats: RFC3339, `YYYY-MM-DD HH:MM`, or `YYYY-MM-DD`. When using `YYYY-MM-DD`, the time defaults to `00:00`.
70+
71+
{{< admonition type="note" >}}
72+
Time-based configuration (`start_time` and `end_time` arguments) can't be combined together with [`sqs`][] block.
73+
74+
[`sqs`]: #sqs
75+
76+
{{< /admonition >}}
77+
78+
Refer to the upstream receiver [documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/{{< param "OTEL_VERSION" >}}/receiver/awss3receiver#configuration) for more details.
79+
80+
## Blocks
81+
82+
You can use the following blocks with `otelcol.receiver.awss3`:
83+
84+
| Block | Description | Required |
85+
| ------------------------------ | ---------------------------------------------------------------------------- | ----------------------------------------- |
86+
| [`s3downloader`][s3downloader] | Configures S3 downloader. | yes |
87+
| [`sqs`][sqs] | Configures SQS queue configuration for receiving object change notification. | Required if fetching by SQS notification. |
88+
| [`output`][output] | Configures where to send received telemetry data. | yes |
89+
90+
[s3downloader]: #s3downloader
91+
[sqs]: #sqs
92+
[output]: #output
93+
94+
### `s3downloader`
95+
96+
{{< badge text="Required" >}}
97+
98+
The `s3downloader` block contains AWS S3 downloader related configuration to control things like bucket, prefix, batching, connections, retries, etc.
99+
100+
The following arguments are supported:
101+
102+
| Name | Type | Description | Default | Required |
103+
| ----------------------- | -------- | ----------------------------------------------------------------------------------------------------- | ------------- | -------- |
104+
| `s3_bucket` | `string` | S3 bucket. | | yes |
105+
| `s3_prefix` | `string` | Prefix for the S3 key (root directory inside bucket). | | yes |
106+
| `endpoint_partition_id` | `string` | Partition id to use if `endpoint` is specified. | `"aws"` | no |
107+
| `endpoint` | `string` | Overrides the endpoint used by the exporter instead of constructing it from `region` and `s3_bucket`. | | no |
108+
| `file_prefix` | `string` | Prefix used to filter files for download. | | no |
109+
| `region` | `string` | AWS region. | `"us-east-1"` | no |
110+
| `s3_force_path_style` | `bool` | When enabled, forces the request to use [path-style addressing][s3-force-path-style-ref]. | `false` | no |
111+
| `s3_partition` | `string` | Time granularity of S3 key: hour or minute. | `"minute"` | no |
112+
113+
[s3-force-path-style-ref]: http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html
114+
115+
### `sqs`
116+
117+
The `sqs` block holds SQS queue configuration for receiving object change notifications.
118+
119+
The following arguments are supported:
120+
121+
| Name | Type | Description | Default | Required |
122+
| ------------------------ | -------- | --------------------------------------------------------------- | ------- | -------- |
123+
| `queue_url` | `string` | The URL of the SQS queue that receives S3 bucket notifications. | | yes |
124+
| `region` | `string` | AWS region of the SQS queue. | | yes |
125+
| `endpoint` | `string` | Custom endpoint for the SQS service. | | no |
126+
| `max_number_of_messages` | `int` | Maximum number of messages to retrieve in a single SQS request. | `10` | no |
127+
| `wait_time_seconds` | `int` | Wait time in seconds for long polling SQS requests. | `20` | no |
128+
129+
{{< admonition type="note" >}}
130+
You must configure your S3 bucket to send event notifications to the SQS queue.
131+
Time-based configuration (`start_time`/`end_time`) and SQS configuration can't be used together.
132+
{{< /admonition >}}
133+
134+
### `output`
135+
136+
{{< badge text="Required" >}}
137+
138+
{{< docs/shared lookup="reference/components/output-block.md" source="alloy" version="<ALLOY_VERSION>" >}}
139+
140+
## Exported fields
141+
142+
`otelcol.receiver.awss3` doesn't export any fields.
143+
144+
## Component health
145+
146+
`otelcol.receiver.awss3` is only reported as unhealthy if given an invalid configuration.
147+
148+
## Debug information
149+
150+
`otelcol.receiver.awss3` doesn't expose any component-specific debug information.
151+
152+
## Example
153+
154+
This example forwards received traces through a batch processor before finally sending it to an OTLP-capable endpoint:
155+
156+
```alloy
157+
// Time range mode:
158+
otelcol.receiver.awss3 "default" {
159+
start_time = "2024-01-01 01:00"
160+
end_time = "2024-01-02"
161+
162+
s3downloader {
163+
region = "us-west-1"
164+
s3_bucket = "mybucket"
165+
s3_prefix = "trace"
166+
s3_partition = "minute"
167+
}
168+
169+
output {
170+
traces = [otelcol.processor.batch.default.input]
171+
}
172+
}
173+
174+
// SQS message mode:
175+
otelcol.receiver.awss3 "sqs_traces" {
176+
s3downloader {
177+
region = "us-east-1"
178+
s3_bucket = "mybucket"
179+
s3_prefix = "mytrace"
180+
}
181+
182+
sqs {
183+
queue_url = "https://sqs.us-east-1.amazonaws.com/123456789012/test-queue"
184+
region = "us-east-1"
185+
}
186+
187+
output {
188+
traces = [otelcol.processor.batch.default.input]
189+
}
190+
}
191+
192+
otelcol.processor.batch "default" {
193+
output {
194+
metrics = [otelcol.exporter.otlp.default.input]
195+
logs = [otelcol.exporter.otlp.default.input]
196+
traces = [otelcol.exporter.otlp.default.input]
197+
}
198+
}
199+
200+
otelcol.exporter.otlp "default" {
201+
client {
202+
endpoint = sys.env("<OTLP_ENDPOINT>")
203+
}
204+
}
205+
```
206+
207+
<!-- START GENERATED COMPATIBLE COMPONENTS -->
208+
209+
## Compatible components
210+
211+
`otelcol.receiver.awss3` can accept arguments from the following components:
212+
213+
- Components that export [OpenTelemetry `otelcol.Consumer`](../../../compatibility/#opentelemetry-otelcolconsumer-exporters)
214+
215+
216+
{{< admonition type="note" >}}
217+
Connecting some components may not be sensible or components may require further configuration to make the connection work correctly.
218+
Refer to the linked documentation for more details.
219+
{{< /admonition >}}
220+
221+
<!-- END GENERATED COMPATIBLE COMPONENTS -->

go.mod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,7 @@ require (
991991
github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/rum v0.73.0-devel.0.20251030121902-cd89eab046d6 // indirect
992992
github.com/DataDog/datadog-agent/pkg/util/defaultpaths v0.69.3 // indirect
993993
github.com/DataDog/datadog-agent/pkg/util/quantile v0.73.0-devel.0.20251030121902-cd89eab046d6 // indirect
994+
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.11 // indirect
994995
github.com/digitalocean/go-metadata v0.0.0-20250129100319-e3650a3df44b // indirect
995996
github.com/go-openapi/swag/cmdutils v0.25.1 // indirect
996997
github.com/go-openapi/swag/conv v0.25.1 // indirect
@@ -1005,6 +1006,9 @@ require (
10051006
github.com/go-openapi/swag/yamlutils v0.25.1 // indirect
10061007
github.com/linode/go-metadata v0.2.2 // indirect
10071008
github.com/mitchellh/hashstructure v1.1.0 // indirect
1009+
github.com/open-telemetry/opamp-go v0.22.0 // indirect
1010+
github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampcustommessages v0.139.0 // indirect
1011+
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awss3receiver v0.139.0 // indirect
10081012
github.com/twmb/franz-go/pkg/kadm v1.17.1 // indirect
10091013
golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 // indirect
10101014
)

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,8 @@ github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.39.12 h1:Rw32TILqdeSIfK
560560
github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.39.12/go.mod h1:A6p6Pb5x8Xwl69rskqHOr3fGBENGNBFHCvAjGIvkqOw=
561561
github.com/aws/aws-sdk-go-v2/service/shield v1.29.8 h1:H5urm641txrisNK7AOXVVR3FdG/dGg+CpekseU5BgZk=
562562
github.com/aws/aws-sdk-go-v2/service/shield v1.29.8/go.mod h1:fl0FdAKddek5SfmZAINtCgq0IQohtrQMpAIszgQIVjs=
563+
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.11 h1:tt34G790giMoWqpqJOfvc5BD25hHRSjgvx1x1jtwi9w=
564+
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.11/go.mod h1:tj8YTswoacIeRGjkYuHOkUd4ioQ4Of0m+gy09kuns9o=
563565
github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk=
564566
github.com/aws/aws-sdk-go-v2/service/sso v1.29.8 h1:M5nimZmugcZUO9wG7iVtROxPhiqyZX6ejS1lxlDPbTU=
565567
github.com/aws/aws-sdk-go-v2/service/sso v1.29.8/go.mod h1:mbef/pgKhtKRwrigPPs7SSSKZgytzP8PQ6P6JAAdqyM=
@@ -1755,6 +1757,8 @@ github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus
17551757
github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8=
17561758
github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y=
17571759
github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0=
1760+
github.com/open-telemetry/opamp-go v0.22.0 h1:7UnsQgFFS7ffM09JQk+9aGVBAAlsLfcooZ9xvSYwxWM=
1761+
github.com/open-telemetry/opamp-go v0.22.0/go.mod h1:339N71soCPrhHywbAcKUZJDODod581ZOxCpTkrl3zYQ=
17581762
github.com/open-telemetry/opentelemetry-collector-contrib/connector/servicegraphconnector v0.139.0 h1:wsylHna5nuu6Jl+ow9uv3WJ0qKGJxg2aRORFUDa8SAs=
17591763
github.com/open-telemetry/opentelemetry-collector-contrib/connector/servicegraphconnector v0.139.0/go.mod h1:LIR7KA0MIoHFQN/mO3zLEeK7piZL3cR6Ig10GfpS5UU=
17601764
github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.139.0 h1:USQU4VEL4Vi1rDm1am6LFjIvRGSOWhb+huw1OLIo3Eo=
@@ -1793,6 +1797,8 @@ github.com/open-telemetry/opentelemetry-collector-contrib/extension/jaegerremote
17931797
github.com/open-telemetry/opentelemetry-collector-contrib/extension/jaegerremotesampling v0.139.0/go.mod h1:70ZwjOdBJd/vphyHnow3SJg1CU5ZDPRkxwAoKQerjgU=
17941798
github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension v0.139.0 h1:lGhsaspNdzFupSKKYij88cfca5T1D4IR18n70hyBXJ8=
17951799
github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension v0.139.0/go.mod h1:M28yXdZYNKe/OG8O9pk4/+ZJU/2lch6RliXrDVJLLkE=
1800+
github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampcustommessages v0.139.0 h1:tRWaYl3gYJEAMa9AwdRqnh8aT09derEg5KAQfKAvY/I=
1801+
github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampcustommessages v0.139.0/go.mod h1:fd4BmG/alnGTP5jbYwyRAegWFkvqYjgXU4EXYUXPUyA=
17961802
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.139.0 h1:1X2OrH3LPowYMPIqoQL3JxAi4DZ8qeW2yiPTztNStt4=
17971803
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.139.0/go.mod h1:Jcvh4kIf/LZZh4fvPVVbUgstcMELMgKIncZLJk7bEIA=
17981804
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.139.0 h1:3Hhr2s+h3nNiEkvv1G7/ETbvx+BU6z02IBB2ZbrmbNA=
@@ -1891,6 +1897,8 @@ github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscloudwatch
18911897
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscloudwatchreceiver v0.139.0/go.mod h1:RKHgTIuRIYeAXG+PfGGYeuNNHJmL568rhHAZT1F7ulI=
18921898
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsecscontainermetricsreceiver v0.139.0 h1:6qdUPpYUyv9a7j6Onm8FQbJ+WzigJaZtHmPLTkuXkHg=
18931899
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsecscontainermetricsreceiver v0.139.0/go.mod h1:WRXQ6QPLWLy2yvv83W0k+BK1jIQ45M++k3YAmt6Xy8A=
1900+
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awss3receiver v0.139.0 h1:hb89RphDnSdgCh1o9ETaDDGCtwvqDtmroGWtjKuMDss=
1901+
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awss3receiver v0.139.0/go.mod h1:Dj4yPqiqDiOjJwCu9lRnHk/QBgTNs9Zyj0LwRHdlOw8=
18941902
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/cloudflarereceiver v0.139.0 h1:RQj1FWnNvAkUi3+ZpznQ8AwEjv+ctZDWR0tQwen2yjU=
18951903
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/cloudflarereceiver v0.139.0/go.mod h1:IdhQZGwKVhG/+OcMj0SWNLILHT3mx2IOOKh9uru4zhU=
18961904
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver v0.139.0 h1:O/rzzvZUa+06SGyVWjOgYchprf5pFwLhDjTK33T3sCU=

0 commit comments

Comments
 (0)