Skip to content

Commit

Permalink
Merge branch 'main' into telemetrygen_tls_secure_tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliaj committed Jan 5, 2024
2 parents 143efc2 + b275884 commit 3a74ad7
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 6 deletions.
27 changes: 27 additions & 0 deletions .chloggen/deprecate_configschema.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: deprecation

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecating configschema to prefer generating documentation as part of its metadata generation with mdatagen

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

# (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: []
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,6 @@ issues:
- text: "G402:"
linters:
- gosec
- text: "SA1019: \"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/configschema"
linters:
- staticcheck
3 changes: 3 additions & 0 deletions cmd/configschema/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
> Deprecated: [v0.92.0] This tool is deprecated and will be removed in a future release.
> See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30187
# ConfigSchema API

This package contains an API that can be used to introspect the configuration
Expand Down
3 changes: 3 additions & 0 deletions cmd/configschema/cfgmetadatagen/cfgmetadatagen/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
> Deprecated: [v0.92.0] This tool is deprecated and will be removed in a future release.
> See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30187
# Config Metadata YAML Generator (alpha)

This CLI application creates a configuration metadata YAML file for each
Expand Down
4 changes: 4 additions & 0 deletions cmd/configschema/cfgmetadatagen/cfgmetadatagen/cli.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

// Deprecated: [v0.92.0] This package is deprecated and will be removed in a future release.
// See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30187
package cfgmetadatagen

import (
Expand All @@ -15,6 +17,8 @@ import (

// GenerateFiles is the entry point for cfgmetadatagen. Component factories are
// passed in so it can be used by other distros.
// Deprecated: [v0.92.0] This package is deprecated and will be removed in a future release.
// See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30187
func GenerateFiles(factories otelcol.Factories, sourceDir string, outputDir string) error {
dr := configschema.NewDirResolver(sourceDir, configschema.DefaultModule)
writer := newMetadataFileWriter(outputDir)
Expand Down
3 changes: 3 additions & 0 deletions cmd/configschema/cfgmetadatagen/main.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

// Deprecated: [v0.92.0] This package is deprecated and will be removed in a future release.
// See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30187
package main

import (
Expand All @@ -14,6 +16,7 @@ import (
)

func main() {

sourceDir, outputDir := getFlags()
c, err := components.Components()
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions cmd/configschema/comments.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

// Deprecated: [v0.92.0] This package is deprecated and will be removed in a future release.
// See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30187
package configschema // import "github.com/open-telemetry/opentelemetry-collector-contrib/cmd/configschema"

import (
Expand Down
3 changes: 3 additions & 0 deletions cmd/configschema/docsgen/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
> Deprecated: [v0.92.0] This tool is deprecated and will be removed in a future release.
> See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30187
# Docsgen CLI Tool

This package contains a CLI tool that generates markdown files for collector
Expand Down
4 changes: 4 additions & 0 deletions cmd/configschema/docsgen/docsgen/cli.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

// Deprecated: [v0.92.0] This package is deprecated and will be removed in a future release.
// See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30187
package docsgen // import "github.com/open-telemetry/opentelemetry-collector-contrib/cmd/configschema/docsgen/docsgen"

import (
Expand All @@ -23,6 +25,8 @@ const mdFileName = "config.md"
// CLI is the entrypoint for this package's functionality. It handles command-
// line arguments for the docsgen executable and produces config documentation
// for the specified components.
// Deprecated: [v0.92.0] This package is deprecated and will be removed in a future release.
// See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30187
func CLI(factories otelcol.Factories, dr configschema.DirResolver) {
tableTmpl, err := tableTemplate()
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions cmd/configschema/docsgen/main.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

// Deprecated: [v0.92.0] This package is deprecated and will be removed in a future release.
// See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30187
package main

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/configschema/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Deprecated: [v0.92.0] This package is deprecated and will be removed in a future release.
// See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30187
module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/configschema

go 1.20
Expand Down
4 changes: 2 additions & 2 deletions exporter/logzioexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ func getListenerURL(region string) string {
}

func generateEndpoint(cfg *Config) (string, error) {
defaultURL := fmt.Sprintf("%s/?token=%s", getListenerURL(""), cfg.Token)
defaultURL := fmt.Sprintf("%s/?token=%s", getListenerURL(""), string(cfg.Token))
switch {
case cfg.HTTPClientSettings.Endpoint != "":
return cfg.HTTPClientSettings.Endpoint, nil
case cfg.Region != "":
return fmt.Sprintf("%s/?token=%s", getListenerURL(cfg.Region), cfg.Token), nil
return fmt.Sprintf("%s/?token=%s", getListenerURL(cfg.Region), string(cfg.Token)), nil
case cfg.HTTPClientSettings.Endpoint == "" && cfg.Region == "":
return defaultURL, errors.New("failed to generate endpoint, Endpoint or Region must be set")
default:
Expand Down
2 changes: 1 addition & 1 deletion pkg/stanza/docs/types/expression.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Expressions give the config flexibility by allowing dynamic business logic rules
Most notably, expressions can be used to route log records and add new fields based on the contents of the log entry
being processed.

For reference documentation of the expression language, see [here](https://github.com/antonmedv/expr/blob/master/docs/Language-Definition.md).
For reference documentation of the expression language, see [here](https://github.com/expr-lang/expr/blob/master/docs/language-definition.md).

Available to the expressions are a few special variables:
- `body` contains the entry's body
Expand Down
2 changes: 1 addition & 1 deletion receiver/elasticsearchreceiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func newElasticsearchClient(settings component.TelemetrySettings, c Config, h co

var authHeader string
if c.Username != "" && c.Password != "" {
userPass := fmt.Sprintf("%s:%s", c.Username, c.Password)
userPass := fmt.Sprintf("%s:%s", c.Username, string(c.Password))
authb64 := base64.StdEncoding.EncodeToString([]byte(userPass))
authHeader = fmt.Sprintf("Basic %s", authb64)
}
Expand Down
2 changes: 1 addition & 1 deletion receiver/receivercreator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ instantiate that receiver.
**receivers.<receiver_type/id>.rule**

Rule expression using [expvar
syntax](https://github.com/antonmedv/expr/blob/master/docs/language-definition.md).
syntax](https://github.com/expr-lang/expr/blob/master/docs/language-definition.md).
Variables available are detailed below in [Rule
Expressions](#rule-expressions).

Expand Down
2 changes: 1 addition & 1 deletion receiver/saphanareceiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func newSapHanaClient(cfg *Config, factory sapHanaConnectionFactory) client {
}

func (c *sapHanaClient) Connect(ctx context.Context) error {
connector, err := sapdriver.NewDSNConnector(fmt.Sprintf("hdb://%s:%s@%s", c.receiverConfig.Username, c.receiverConfig.Password, c.receiverConfig.TCPAddr.Endpoint))
connector, err := sapdriver.NewDSNConnector(fmt.Sprintf("hdb://%s:%s@%s", c.receiverConfig.Username, string(c.receiverConfig.Password), c.receiverConfig.TCPAddr.Endpoint))
if err != nil {
return fmt.Errorf("error generating DSN for SAP HANA connection: %w", err)
}
Expand Down

0 comments on commit 3a74ad7

Please sign in to comment.