Skip to content

Commit

Permalink
chore: remove user/password configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll committed Jan 2, 2025
1 parent a64d888 commit c48db20
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 34 deletions.
21 changes: 1 addition & 20 deletions receiver/valkeyreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ next consumer. The `collection_interval` configuration option tells this
receiver the duration between runs. This value must be a string readable by
Golang's `ParseDuration` function (example: `1h30m`). Valid time units are
`ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.
- `username` (no default): Client username used to connect to a Valkey >=6.0 instance that is using the Valkey ACL system.
- `password` (no default): The password used to access the Valkey instance;
must match the password specified in the `requirepass` server configuration option in Valkey <6.0.
For Valkey >=6.0, the user's password when connecting using the Valkey ACL system.
- `transport` (default = `tcp`) Defines the network to use for connecting to the server. Valid Values are `tcp` or `Unix`
- `tls`:
- `insecure` (default = true): whether to disable client transport security for the exporter's connection.
- `ca_file`: path to the CA cert. For a client this verifies the server certificate. Should only be used if `insecure` is set to false.
Expand All @@ -56,23 +51,9 @@ Example:

```yaml
receivers:
redis:
valkey:
endpoint: "localhost:6379"
collection_interval: 10s
password: ${env:VALKEY_PASSWORD}
```
> :information_source: As with all Open Telemetry configuration values, a
reference to an environment variable is supported. For example, to pick up
the value of an environment variable `VALKEY_PASSWORD`, you could use a
configuration like the following:

```yaml
receivers:
redis:
endpoint: "localhost:6379"
collection_interval: 10s
password: ${env:VALKEY_PASSWORD}
```
The full list of settings exposed for this receiver are documented [here](./config.go).
13 changes: 1 addition & 12 deletions receiver/valkeyreceiver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"net"

"go.opentelemetry.io/collector/config/confignet"
"go.opentelemetry.io/collector/config/configopaque"
"go.opentelemetry.io/collector/config/configtls"
"go.opentelemetry.io/collector/receiver/scraperhelper"

Expand All @@ -17,20 +16,10 @@ import (

type Config struct {
scraperhelper.ControllerConfig `mapstructure:",squash"`
// TODO: Use one of the configs from core.

// The target endpoint.
confignet.AddrConfig `mapstructure:",squash"`

// Optional username. Use the specified Username to authenticate the current connection
// with one of the connections defined in the ACL list when connecting
// to a valkey instance that is using the valkey ACL system.
Username string `mapstructure:"username"`

// Optional password. Must match the password specified in the
// requirepass server configuration option, or the user's password when connecting
// to a valkey instance that is using the valkey ACL system.
Password configopaque.String `mapstructure:"password"`

TLS configtls.ClientConfig `mapstructure:"tls,omitempty"`

MetricsBuilderConfig metadata.MetricsBuilderConfig `mapstructure:",squash"`
Expand Down
2 changes: 0 additions & 2 deletions receiver/valkeyreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ func (vs *valkeyScraper) scrape(ctx context.Context) (pmetric.Metrics, error) {
if vs.client == nil {
opts := valkey.ClientOption{
InitAddress: []string{vs.cfg.Endpoint},
Username: vs.cfg.Username,
Password: string(vs.cfg.Password),
}

var err error
Expand Down

0 comments on commit c48db20

Please sign in to comment.