Skip to content

Commit

Permalink
[provider/s3] Use mdatagen, promote to alpha (#38227)
Browse files Browse the repository at this point in the history
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Officially promotes the s3 provider to alpha and records this with
mdatagen.

Requires
#38226.

Unblocks
open-telemetry/opentelemetry-collector-releases#546.

---------

Co-authored-by: Antoine Toulme <antoine@toulme.name>
  • Loading branch information
evan-bradley and atoulme authored Feb 26, 2025
1 parent 2098453 commit 4763d9f
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .chloggen/s3provider-mdatagen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: confmap/provider/s3

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Promote to alpha stability

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [38227]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
19 changes: 19 additions & 0 deletions confmap/provider/s3provider/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
# S3 Confmap Provider

<!-- status autogenerated section -->
| Status | |
| ------------- |-----------|
| Stability | [alpha] |
| Distributions | [contrib] |
| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aprovider%2Fs3provider%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprovider%2Fs3provider) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprovider%2Fs3provider%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprovider%2Fs3provider) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@Aneurysm9](https://github.com/Aneurysm9) |

[alpha]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#alpha
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
<!-- end autogenerated section -->

## Summary

This package provides a `ConfigMapProvider` implementation for Amazon S3 (`s3provider`) that allows the Collector the ability to load configuration by fetching and reading config objects stored in Amazon S3.

## How it works

- It will be called by `ConfigMapResolver` to load configuration for the Collector.
- By giving a config URI starting with prefix `s3://`, this `s3provider` will be used to download config objects from the given S3 URIs, and then use the downloaded configuration during Collector initialization.

Expected URI format:

- s3://[BUCKET].s3.[REGION].amazonaws.com/[KEY]

Prerequistes:

- Need to setup access keys from IAM console (aws_access_key_id and aws_secret_access_key) with permission to access Amazon S3
- For details, can take a look at https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion confmap/provider/s3provider/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
type: s3

status:
class: provider
stability:
alpha: [provider]
distributions: [contrib]
codeowners:
active: [Aneurysm9]
active: [Aneurysm9]
2 changes: 2 additions & 0 deletions confmap/provider/s3provider/provider.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:generate mdatagen metadata.yaml

package s3provider // import "github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provider/s3provider"

import (
Expand Down
2 changes: 2 additions & 0 deletions reports/distributions/contrib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ components:
- sumologic
- tail_sampling
- transform
provider:
- s3
receiver:
- active_directory_ds
- aerospike
Expand Down

0 comments on commit 4763d9f

Please sign in to comment.