Skip to content

[provider/secretsmanager] Use mdatagen, promote to alpha #38251

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .chloggen/secretsmanagerprovider-alpha.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: secretsmanagerprovider

# 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: [38251]

# (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: []
24 changes: 21 additions & 3 deletions confmap/provider/secretsmanagerprovider/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
# Secrets Manager 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%2Fsecretsmanagerprovider%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprovider%2Fsecretsmanagerprovider) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprovider%2Fsecretsmanagerprovider%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprovider%2Fsecretsmanagerprovider) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@driverpt](https://www.github.com/driverpt), [@atoulme](https://www.github.com/atoulme) |

[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 Secrets Manager (`secretsmanager`) that allows
the
Collector the ability to read data stored in AWS Secrets Manager.

This package provides a `confmap.Provider` implementation for Amazon Secrets
Manager (`secretsmanager`) that allows the Collector the ability to read data
stored in AWS Secrets Manager.

## How it works

- Just use the placeholders with the following pattern `${secretsmanager:<arn or name>}`
- Make sure you have the `secretsmanager:GetSecretValue` in the OTEL Collector Role
- If your secret is a json string, you can get the value for a json key using the following pattern `${secretsmanager:<arn or name>#json-key}`

Prerequisites:

- Need to set up access keys from IAM console (aws_access_key_id and aws_secret_access_key) with permission to access Amazon Secrets Manager
- 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.

1 change: 1 addition & 0 deletions confmap/provider/secretsmanagerprovider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.19
github.com/stretchr/testify v1.10.0
go.opentelemetry.io/collector/confmap v1.26.1-0.20250226024140-8099e51f9a77
go.uber.org/goleak v1.3.0
)

require (
Expand Down
8 changes: 7 additions & 1 deletion confmap/provider/secretsmanagerprovider/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
type: secretsmanager

status:
class: provider
stability:
alpha: [provider]
distributions: [contrib]
codeowners:
active: [driverpt, atoulme]
active: [driverpt, atoulme]
2 changes: 2 additions & 0 deletions confmap/provider/secretsmanagerprovider/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 secretsmanagerprovider // import "github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provider/secretsmanagerprovider"

import (
Expand Down
1 change: 1 addition & 0 deletions reports/distributions/contrib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ components:
- transform
provider:
- s3
- secretsmanager
receiver:
- active_directory_ds
- aerospike
Expand Down