Skip to content

Commit

Permalink
fix typos: Otel -> OTel
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonQ committed Sep 26, 2024
1 parent 188192b commit 88e1d69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions libbeat/outputs/elasticsearch/config_otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
"github.com/elastic/elastic-agent-libs/config"
)

// ToOtelConfig converts a Beat config into an OTel elasticsearch exporter config
func ToOtelConfig(beatCfg *config.C) (*elasticsearchexporter.Config, error) {
// ToOTelConfig converts a Beat config into an OTel elasticsearch exporter config
func ToOTelConfig(beatCfg *config.C) (*elasticsearchexporter.Config, error) {
// Handle cloud.id the same way Beats does, this will also handle
// extracting the Kibana URL (which is required to handle ILM on
// Beats side (currently not supported by ES OTel exporter).
Expand Down Expand Up @@ -81,7 +81,7 @@ func ToOtelConfig(beatCfg *config.C) (*elasticsearchexporter.Config, error) {
headers[k] = configopaque.String(v)
}

otelTLSConfg, err := outputs.TLSCommonToOtel(escfg.Transport.TLS)
otelTLSConfg, err := outputs.TLSCommonToOTel(escfg.Transport.TLS)
if err != nil {
return nil, fmt.Errorf("cannot convert SSL config into OTel: %w", err)
}
Expand All @@ -95,7 +95,7 @@ func ToOtelConfig(beatCfg *config.C) (*elasticsearchexporter.Config, error) {
Authentication: elasticsearchexporter.AuthenticationSettings{
User: escfg.Username, // username
Password: configopaque.String(escfg.Password), // password
APIKey: configopaque.String(escfg.APIKey), //api_key
APIKey: configopaque.String(escfg.APIKey), // api_key
},

// HTTP Client configuration
Expand Down
2 changes: 1 addition & 1 deletion libbeat/outputs/elasticsearch/config_otel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var wantCAPem string
func TestToOtelConfig(t *testing.T) {
beatCfg := config.MustNewConfigFrom(beatYAMLCfg)

otelCfg, err := ToOtelConfig(beatCfg)
otelCfg, err := ToOTelConfig(beatCfg)
if err != nil {
t.Fatalf("could not convert Beat config to OTel elasicsearch exporter: %s", err)
}
Expand Down
8 changes: 4 additions & 4 deletions libbeat/outputs/tls_to_otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ import (
"github.com/elastic/elastic-agent-libs/transport/tlscommon"
)

// TLSCommonToOtel converts a tlscommon.Config into the OTel configtls.ClientConfig
func TLSCommonToOtel(tlscfg *tlscommon.Config) (configtls.ClientConfig, error) {
// TLSCommonToOTel converts a tlscommon.Config into the OTel configtls.ClientConfig
func TLSCommonToOTel(tlscfg *tlscommon.Config) (configtls.ClientConfig, error) {
logger := logp.L().Named("tls-to-otel")
insecureSkipVerify := false
if tlscfg.VerificationMode == tlscommon.VerifyNone {
insecureSkipVerify = true
}

// The OTel exporter accepts either single CA file or CA string. However
// The OTel exporter accepts either single CA file or CA string. However,
// Beats support any combination and number of files and certificates
// as string, so we read them all and assemble one PEM string with
// all CA certificates
caCerts := []string{}
var caCerts []string
for _, ca := range tlscfg.CAs {
d, err := tlscommon.ReadPEMFile(logger, ca, "")
if err != nil {
Expand Down

0 comments on commit 88e1d69

Please sign in to comment.