Skip to content

Commit

Permalink
PR feedback; Update Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Canuteson committed Feb 16, 2022
1 parent 66315ce commit 17596c1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 34 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Main (unreleased)

- [ENHANCEMENT] opentelemetry trace exporters can now be configured to support Oauth utilizing
the opentelemetry-collector-contrib oauth2clientauthextension. (@canuteson)

- [ENHANCEMENT] Go 1.17 is now used for all builds of the Agent. (@tpaschalis)

- [ENHANCEMENT] integrations-next: Add `extra_labels` to add a custom set of
Expand Down
50 changes: 25 additions & 25 deletions docs/configuration/traces-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,31 @@ remote_write:
# the latter take precedence.
[ insecure_skip_verify: <bool> | default = false ]

# Configures opentelemetry exporters to use the OpenTelemetry auth extension `oauth2clientauthextension`.
# Can not be used in combination with `basic_auth`.
# See https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/extension/oauth2clientauthextension/README.md
oauth2:
# Configures the TLS settings specific to the oauth2 client
# The client identifier issued to the oauth client
[client_id: <string>]
# The secret string associated with the oauth client
[client_secret: <string>]
# The resource server's token endpoint URL
[token_url: <string>]
# Optional, requested permissions associated with the oauth client
[scopes: [<string>]]
# Optional, specifies the timeout fetching tokens from the token_url. Default: no timeout
[timeout: <duration>]
tls:
# Disable validation of the server certificate.
[ insecure: <bool> | default = false ]
# Path to the CA cert. For a client this verifies the server certificate. If empty uses system root CA.
[ca_file: <string>]
# Path to the TLS cert to use for TLS required connections
[cert_file: <string>]
# Path to the TLS key to use for TLS required connections
[key_file: <string>]

# Controls TLS settings of the exporter's client. See https://github.com/open-telemetry/opentelemetry-collector/blob/v0.21.0/config/configtls/README.md
# This should be used only if `insecure` is set to false
tls_config:
Expand All @@ -92,31 +117,6 @@ remote_write:
[ password: <secret> ]
[ password_file: <string> ]

# Configures opentelemetry exporters to use the OpenTelemetry auth extension `oauth2clientauthextension`.
# Can not be used in combination with `basic_auth`.
# See https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/extension/oauth2clientauthextension/README.md
oauth2:
# Configures the TLS settings specific to the oauth2 client
# The client identifier issued to the oauth client
[client_id: <string>]
# The secret string associated with the oauth client
[client_secret: <string>]
# The resource server's token endpoint URL
[token_url: <string>]
# Optional, requested permissions associated with the oauth client
[scopes: [<string>]]
# Optional, specifies the timeout fetching tokens from the token_url. Default: no timeout
[timeout: <duration>]
tls:
# Disable validation of the server certificate.
[ insecure: <bool> | default = false ]
# Path to the CA cert. For a client this verifies the server certificate. If empty uses system root CA.
[ca_file: <string>]
# Path to the TLS cert to use for TLS required connections
[cert_file: <string>]
# Path to the TLS key to use for TLS required connections
[key_file: <string>]

[ sending_queue: <otlpexporter.sending_queue> ]
[ retry_on_failure: <otlpexporter.retry_on_failure> ]

Expand Down
2 changes: 1 addition & 1 deletion pkg/traces/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ type TLSClientSetting struct {
MaxVersion string `yaml:"max_version,omitempty"`
Insecure bool `yaml:"insecure"`
InsecureSkipVerify bool `yaml:"insecure_skip_verify"`
ServerName string `yaml:"server_name_override,omitempty"`
ServerNameOverride string `yaml:"server_name_override,omitempty"`
}

// OAuth2Config configures the oauth2client extension for a remote_write exporter
Expand Down
9 changes: 1 addition & 8 deletions pkg/traces/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ func (i *Instance) buildAndStartPipeline(ctx context.Context, cfg InstanceConfig
i.logger.Error(fmt.Sprintf("failed to build extensions:%s", err.Error()))
return fmt.Errorf("failed to create extensions builder: %w", err)
}
i.logger.Info(fmt.Sprintf("starting extensions:%+v", i.extensions))
err = i.extensions.StartAll(ctx, i)
if err != nil {
i.logger.Error(fmt.Sprintf("failed to start extensions:%s", err.Error()))
Expand All @@ -216,7 +215,6 @@ func (i *Instance) buildAndStartPipeline(ctx context.Context, cfg InstanceConfig
if err != nil {
return fmt.Errorf("failed to create exporters builder: %w", err)
}
i.logger.Info(fmt.Sprintf("starting exporters:%+v", i.exporter))
err = i.exporter.StartAll(ctx, i)
if err != nil {
i.logger.Error(fmt.Sprintf("failed to start exporter:%s", err.Error()))
Expand Down Expand Up @@ -245,12 +243,7 @@ func (i *Instance) buildAndStartPipeline(ctx context.Context, cfg InstanceConfig
return fmt.Errorf("failed to start receivers: %w", err)
}

err = i.extensions.NotifyPipelineReady()
if err != nil {
return fmt.Errorf("failed to notify extension: %w", err)
}

return nil
return i.extensions.NotifyPipelineReady()
}

// ReportFatalError implements component.Host
Expand Down

0 comments on commit 17596c1

Please sign in to comment.