Skip to content
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

ENG-48179: Revert NewClient api usage in configgrpc. #781

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c206e3e
Update module github.com/prometheus/common to v0.54.0 (#10302)
renovate[bot] Jun 4, 2024
d822b51
Document TLS option Watch client CA (#10254)
pavolloffay Jun 4, 2024
6994059
[chore] Update release schedule (#10305)
mx-psi Jun 4, 2024
a6fdb11
Update github/codeql-action action to v3.25.7 (#10299)
renovate[bot] Jun 4, 2024
c0e8a0b
Updated public methods in configauth (#9880)
AkhigbeEromo Jun 4, 2024
15faf62
Update module github.com/shirou/gopsutil/v3 to v3.24.5 (#10301)
renovate[bot] Jun 4, 2024
6115ef3
Update All go.opentelemetry.io/collector packages to v0.102.0 (#10304)
renovate[bot] Jun 4, 2024
df3f826
Update github/codeql-action action to v3.25.8 (#10308)
renovate[bot] Jun 4, 2024
cc72c2d
[exporterhelper] Fix batch sender ignoring next senders in the chain …
dmitryax Jun 4, 2024
bb4955e
Update module golang.org/x/text to v0.16.0 (#10309)
renovate[bot] Jun 4, 2024
9576591
[chore] [exporterhelper] Minor corrections for a unit test (#10312)
dmitryax Jun 4, 2024
115bc8e
[exporterhelper] Fix shutdown hang on unstarted exporter (#10313)
carsonip Jun 4, 2024
f980592
Update All golang.org/x packages (#10311)
renovate[bot] Jun 4, 2024
d136b6d
[cmd/builder] Allow setting DefaultScheme in builder config (#10296)
TylerHelmuth Jun 4, 2024
7b0c38e
[mdatagen] make meter a struct member of telemetryBuilder (#10314)
codeboten Jun 4, 2024
714cf75
Update All golang.org/x packages (#10317)
renovate[bot] Jun 4, 2024
d9dc6eb
[chore] update go to 1.21.11/1.22.4 (#10321)
codeboten Jun 5, 2024
4e354aa
[confighttp] Deprecate `CustomRoundTripper` (#10310)
evan-bradley Jun 5, 2024
760f773
[configgrpc] Use own compressors for zstd (#10323)
jpkrohling Jun 5, 2024
45a688c
Merge branch 'release/v0.102.x' into mx-psi/release/v0.102.x-fix-merg…
mx-psi Jun 5, 2024
86ee482
[chore] Merge release/v0.102.x into main second replacement (#10329)
mx-psi Jun 5, 2024
d5dd7a6
[chore] Include explicit mention of GHSA-c74f-6mfw-mm4v in changelog …
mx-psi Jun 5, 2024
1e44a9c
[receiver] deprecate CreateSettings -> Settings (#10333)
codeboten Jun 5, 2024
9c3481b
[exporterhelper] Fix potential deadlock in the batch sender (#10315)
dmitryax Jun 5, 2024
d3c5ce0
[chore] Clarify that cmd/otelcorecol and top-level go.mod are not the…
mx-psi Jun 6, 2024
736504c
ENG-48179: Revert NewClient api usage in configgrpc.
puneet-traceable Sep 17, 2024
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
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: Use own compressors for zstd
component: exporterhelper

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Before this change, the zstd compressor we used didn't respect the max message size.
note: Fix potential deadlock in the batch sender

# One or more tracking issues or pull requests related to the change
issues: [10323]
issues: [10315]

# 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.
change_logs: [user]
25 changes: 25 additions & 0 deletions .chloggen/builder-configure-default-scheme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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. otlpreceiver)
component: cmd/builder

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Allow setting `otelcol.CollectorSettings.ResolverSettings.DefaultScheme` via the builder's `conf_resolver.default_uri_scheme` configuration option

# One or more tracking issues or pull requests related to the change
issues: [10296]

# (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:

# 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: []
28 changes: 28 additions & 0 deletions .chloggen/codeboten_create-settings-receiver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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. otlpreceiver)
component: receiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecate CreateSettings and NewNopCreateSettings

# One or more tracking issues or pull requests related to the change
issues: [9428]

# (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: |
The following methods are being renamed:
- receiver.CreateSettings -> receiver.Settings
- receiver.NewNopCreateSettings -> receiver.NewNopSettings

# 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: [api]
25 changes: 25 additions & 0 deletions .chloggen/configauth-add-context-to-public-funcs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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. otlpreceiver)
component: configauth

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecate `GetClientAuthenticator` and `GetServerAuthenticator`, use `GetClientAuthenticatorContext` and `GetServerAuthenticatorContext` instead.

# One or more tracking issues or pull requests related to the change
issues: [9808]

# (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:

# 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: [api]
25 changes: 25 additions & 0 deletions .chloggen/confighttp-customroundtripper.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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. otlpreceiver)
component: confighttp

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecate `ClientConfig.CustomRoundTripper`

# One or more tracking issues or pull requests related to the change
issues: [8627]

# (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: Set the `Transport` field on the `*http.Client` object returned from `(ClientConfig).ToClient` instead.

# 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: [api]
20 changes: 20 additions & 0 deletions .chloggen/fix_batch_sender_chaining.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Fix a bug when the retry and timeout logic was not applied with enabled batching.

# One or more tracking issues or pull requests related to the change
issues: [10166]

# 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: []
20 changes: 20 additions & 0 deletions .chloggen/fix_batch_sender_shutdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Fix a bug where an unstarted batch_sender exporter hangs on shutdown

# One or more tracking issues or pull requests related to the change
issues: [10306]

# 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: []
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
uses: github/codeql-action/init@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
with:
languages: go

- name: Autobuild
uses: github/codeql-action/autobuild@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
uses: github/codeql-action/autobuild@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
uses: github/codeql-action/analyze@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
uses: github/codeql-action/upload-sarif@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
with:
sarif_file: results.sarif
6 changes: 6 additions & 0 deletions CHANGELOG-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ If you are looking for user-facing changes, check out [CHANGELOG.md](./CHANGELOG

<!-- next version -->

## v0.102.1

No API-only changes on this release. **This release addresses [GHSA-c74f-6mfw-mm4v](https://github.com/open-telemetry/opentelemetry-collector/security/advisories/GHSA-c74f-6mfw-mm4v) for `configgrpc`.**

## v1.9.0/v0.102.0

**This release addresses [GHSA-c74f-6mfw-mm4v](https://github.com/open-telemetry/opentelemetry-collector/security/advisories/GHSA-c74f-6mfw-mm4v) for `confighttp`.**

### 🛑 Breaking changes 🛑

- `otelcol`: Remove deprecated `ConfigProvider` field from `CollectorSettings` (#10281)
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@ If you are looking for developer-facing changes, check out [CHANGELOG-API.md](./

<!-- next version -->

## v0.102.1

**This release addresses [GHSA-c74f-6mfw-mm4v](https://github.com/open-telemetry/opentelemetry-collector/security/advisories/GHSA-c74f-6mfw-mm4v) for `configgrpc`.**

### 🧰 Bug fixes 🧰

- `configrpc`: Use own compressors for zstd. Before this change, the zstd compressor we used didn't respect the max message size. This addresses [GHSA-c74f-6mfw-mm4v](https://github.com/open-telemetry/opentelemetry-collector/security/advisories/GHSA-c74f-6mfw-mm4v) for `configgrpc` (#10323)

## v1.9.0/v0.102.0

**This release addresses [GHSA-c74f-6mfw-mm4v](https://github.com/open-telemetry/opentelemetry-collector/security/advisories/GHSA-c74f-6mfw-mm4v) for `confighttp`.**

### 🛑 Breaking changes 🛑

- `envprovider`: Restricts Environment Variable names. Environment variable names must now be ASCII only and start with a letter or an underscore, and can only contain underscores, letters, or numbers. (#9531)
- `confighttp`: Apply MaxRequestBodySize to the result of a decompressed body (#10289)
- `confighttp`: Apply MaxRequestBodySize to the result of a decompressed body. This addresses [GHSA-c74f-6mfw-mm4v](https://github.com/open-telemetry/opentelemetry-collector/security/advisories/GHSA-c74f-6mfw-mm4v) for `confighttp` (#10289)
When using compressed payloads, the Collector would verify only the size of the compressed payload.
This change applies the same restriction to the decompressed content. As a security measure, a limit of 20 MiB was added, which makes this a breaking change.
For most clients, this shouldn't be a problem, but if you often have payloads that decompress to more than 20 MiB, you might want to either configure your
Expand Down
10 changes: 10 additions & 0 deletions cmd/builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ replaces:
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.40.0
```

The builder also allows setting the scheme to use as the default URI scheme via `conf_resolver.default_uri_scheme`:

```yaml
conf_resolver:
default_uri_scheme: "env"
```

This tells the builder to produce a Collector that uses the `env` scheme when expanding configuration that does not
provide a scheme, such as `${HOST}` (instead of doing `${env:HOST}`).

## Steps

The builder has 3 steps:
Expand Down
2 changes: 1 addition & 1 deletion cmd/builder/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
golang.org/x/mod v0.17.0
golang.org/x/mod v0.18.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions cmd/builder/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions cmd/builder/internal/builder/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,18 @@ type Config struct {
Replaces []string `mapstructure:"replaces"`
Excludes []string `mapstructure:"excludes"`

ConfResolver ConfResolver `mapstructure:"conf_resolver"`

downloadModules retry `mapstructure:"-"`
}

type ConfResolver struct {
// When set, will be used to set the CollectorSettings.ConfResolver.DefaultScheme value,
// which determines how the Collector interprets URIs that have no scheme, such as ${ENV}.
// See https://pkg.go.dev/go.opentelemetry.io/collector/confmap#ResolverSettings for more details.
DefaultURIScheme string `mapstructure:"default_uri_scheme"`
}

// Distribution holds the parameters for the final binary
type Distribution struct {
Module string `mapstructure:"module"`
Expand Down
12 changes: 12 additions & 0 deletions cmd/builder/internal/builder/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,18 @@ func TestGenerateAndCompile(t *testing.T) {
return cfg
},
},
{
testCase: "ConfResolverDefaultURIScheme set",
cfgBuilder: func(t *testing.T) Config {
cfg := newTestConfig()
cfg.ConfResolver = ConfResolver{
DefaultURIScheme: "env",
}
cfg.Distribution.OutputPath = t.TempDir()
cfg.Replaces = append(cfg.Replaces, replaces...)
return cfg
},
},
}

for _, tt := range testCases {
Expand Down
3 changes: 3 additions & 0 deletions cmd/builder/internal/builder/templates/main.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ func main() {
{{.Name}}.NewFactory(),
{{- end}}
},
{{- if .ConfResolver.DefaultURIScheme }}
DefaultScheme: "{{ .ConfResolver.DefaultURIScheme }}",
{{- end }}
ConverterFactories: []confmap.ConverterFactory{
expandconverter.NewFactory(),
},
Expand Down
2 changes: 2 additions & 0 deletions cmd/builder/internal/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ func applyCfgFromFile(flags *flag.FlagSet, cfgFromFile builder.Config) {
cfg.Replaces = cfgFromFile.Replaces
cfg.Excludes = cfgFromFile.Excludes

cfg.ConfResolver.DefaultURIScheme = cfgFromFile.ConfResolver.DefaultURIScheme

if !flags.Changed(skipGenerateFlag) && cfgFromFile.SkipGenerate {
cfg.SkipGenerate = cfgFromFile.SkipGenerate
}
Expand Down
19 changes: 13 additions & 6 deletions cmd/builder/internal/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func Test_applyCfgFromFile(t *testing.T) {
wantErr bool
}{
{
name: "distribution, excludes, exporters, receivers, processors, replaces are applied correctly",
name: "distribution, scheme, excludes, exporters, receivers, processors, replaces are applied correctly",
args: args{
flags: flag.NewFlagSet("version=1.0.0", 1),
cfgFromFile: builder.Config{
Expand All @@ -95,16 +95,22 @@ func Test_applyCfgFromFile(t *testing.T) {
Receivers: []builder.Module{testModule},
Exporters: []builder.Module{testModule},
Replaces: testStringTable,
ConfResolver: builder.ConfResolver{
DefaultURIScheme: "env",
},
},
},
want: builder.Config{
Logger: zap.NewNop(),
Distribution: testDistribution,
Excludes: testStringTable,
Processors: []builder.Module{testModule},
Receivers: []builder.Module{testModule},
Exporters: []builder.Module{testModule},
Replaces: testStringTable,
ConfResolver: builder.ConfResolver{
DefaultURIScheme: "env",
},
Excludes: testStringTable,
Processors: []builder.Module{testModule},
Receivers: []builder.Module{testModule},
Exporters: []builder.Module{testModule},
Replaces: testStringTable,
},
wantErr: false,
},
Expand Down Expand Up @@ -246,6 +252,7 @@ func Test_applyCfgFromFile(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
applyCfgFromFile(tt.args.flags, tt.args.cfgFromFile)
assert.Equal(t, tt.want.ConfResolver.DefaultURIScheme, cfg.ConfResolver.DefaultURIScheme)
assert.Equal(t, tt.want.Distribution, cfg.Distribution)
assert.Equal(t, tt.want.SkipGenerate, cfg.SkipGenerate)
assert.Equal(t, tt.want.SkipCompilation, cfg.SkipCompilation)
Expand Down
3 changes: 3 additions & 0 deletions cmd/builder/internal/config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ dist:
version: 0.102.1-dev
otelcol_version: 0.102.1

conf_resolver:
default_uri_scheme: "env"

receivers:
- gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.102.1
- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.102.1
Expand Down
Loading
Loading