Skip to content

Commit

Permalink
Merge branch 'main' into otlpexporter
Browse files Browse the repository at this point in the history
  • Loading branch information
dmathieu committed Sep 20, 2024
2 parents 8549655 + 1391fab commit bd6d2cd
Show file tree
Hide file tree
Showing 222 changed files with 2,798 additions and 1,979 deletions.
28 changes: 28 additions & 0 deletions .chloggen/9480-configgrpc-option-wrapper.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: configgrpc

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Deprecate `ClientConfig.ToClientConn`/`ServerConfig.ToServer` in favor of `ToClientConnWithOptions`/`ToServerWithOptions`"

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

# (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: |
Users providing a grpc.DialOption/grpc.ServerOption should now wrap them into
a generic option with `WithGrpcDialOption`/`WithGrpcServerOption`.
# 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]
36 changes: 36 additions & 0 deletions .chloggen/codeboten_deprecate-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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: processorhelper

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: deprecate accepted/refused/dropped metrics

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

# (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 metrics are being deprecated as they were only used in a single
processor:
- `otelcol_processor_accepted_log_records`
- `otelcol_processor_accepted_metric_points`
- `otelcol_processor_accepted_spans`
- `otelcol_processor_dropped_log_records`
- `otelcol_processor_dropped_metric_points`
- `otelcol_processor_dropped_spans`
- `otelcol_processor_refused_log_records`
- `otelcol_processor_refused_metric_points`
- `otelcol_processor_refused_spans`
# 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/fixbuildtags.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: builder

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Honor build_tags in config

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

# 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: [user]
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: 'enhancement'

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Mark useOtelWithSDKConfigurationForInternalTelemetry as stable

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

# 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: [user]
20 changes: 20 additions & 0 deletions .chloggen/use-cobra-add-version.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: 'enhancement'

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Use cobra for the command, add version flag

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

# 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: [user]
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ linters-settings:
- "!**/*_test.go"

testifylint:
# TODO: enable all rules
disable:
- require-error
enable-all: true

linters:
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ SEMCONVGEN := $(TOOLS_BIN_DIR)/semconvgen
SEMCONVKIT := $(TOOLS_BIN_DIR)/semconvkit
TESTIFYLINT := $(TOOLS_BIN_DIR)/testifylint

TESTIFYLINT_OPT?= --enable-all --disable=require-error
TESTIFYLINT_OPT?= --enable-all

.PHONY: install-tools
install-tools: $(TOOLS_BIN_NAMES)
Expand Down
28 changes: 14 additions & 14 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,38 @@ import (

func TestNewContext(t *testing.T) {
testCases := []struct {
desc string
name string
cl Info
}{
{
desc: "valid client",
name: "valid client",
cl: Info{
Addr: &net.IPAddr{
IP: net.IPv4(1, 2, 3, 4),
},
},
},
{
desc: "nil client",
name: "nil client",
cl: Info{},
},
}
for _, tC := range testCases {
t.Run(tC.desc, func(t *testing.T) {
ctx := NewContext(context.Background(), tC.cl)
assert.Equal(t, ctx.Value(ctxKey{}), tC.cl)
for _, tt := range testCases {
t.Run(tt.name, func(t *testing.T) {
ctx := NewContext(context.Background(), tt.cl)
assert.Equal(t, ctx.Value(ctxKey{}), tt.cl)
})
}
}

func TestFromContext(t *testing.T) {
testCases := []struct {
desc string
name string
input context.Context
expected Info
}{
{
desc: "context with client",
name: "context with client",
input: context.WithValue(context.Background(), ctxKey{}, Info{
Addr: &net.IPAddr{
IP: net.IPv4(1, 2, 3, 4),
Expand All @@ -59,19 +59,19 @@ func TestFromContext(t *testing.T) {
},
},
{
desc: "context without client",
name: "context without client",
input: context.Background(),
expected: Info{},
},
{
desc: "context with something else in the key",
name: "context with something else in the key",
input: context.WithValue(context.Background(), ctxKey{}, "unexpected!"),
expected: Info{},
},
}
for _, tC := range testCases {
t.Run(tC.desc, func(t *testing.T) {
assert.Equal(t, tC.expected, FromContext(tC.input))
for _, tt := range testCases {
t.Run(tt.name, func(t *testing.T) {
assert.Equal(t, tt.expected, FromContext(tt.input))
})
}
}
Expand Down
23 changes: 18 additions & 5 deletions cmd/builder/internal/builder/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestParseModules(t *testing.T) {

// test
err := cfg.ParseModules()
assert.NoError(t, err)
require.NoError(t, err)

// verify
assert.Equal(t, "github.com/org/repo v0.1.2", cfg.Extensions[0].GoMod)
Expand All @@ -47,7 +47,7 @@ func TestRelativePath(t *testing.T) {

// test
err := cfg.ParseModules()
assert.NoError(t, err)
require.NoError(t, err)

// verify
cwd, err := os.Getwd()
Expand All @@ -72,7 +72,7 @@ func TestModuleFromCore(t *testing.T) {

// test
err := cfg.ParseModules()
assert.NoError(t, err)
require.NoError(t, err)

// verify
assert.True(t, strings.HasPrefix(cfg.Extensions[0].Name, "otlpreceiver"))
Expand Down Expand Up @@ -153,6 +153,7 @@ func TestNewDefaultConfig(t *testing.T) {
assert.NoError(t, cfg.SetGoPath())
require.NoError(t, cfg.Validate())
assert.False(t, cfg.Distribution.DebugCompilation)
assert.Empty(t, cfg.Distribution.BuildTags)
}

func TestNewBuiltinConfig(t *testing.T) {
Expand Down Expand Up @@ -198,6 +199,18 @@ func TestSkipGoInitialization(t *testing.T) {
assert.Zero(t, cfg.Distribution.Go)
}

func TestBuildTagConfig(t *testing.T) {
cfg := Config{
Distribution: Distribution{
BuildTags: "customTag",
},
SkipCompilation: true,
SkipGetModules: true,
}
require.NoError(t, cfg.Validate())
assert.Equal(t, "customTag", cfg.Distribution.BuildTags)
}

func TestDebugOptionSetConfig(t *testing.T) {
cfg := Config{
Distribution: Distribution{
Expand All @@ -206,7 +219,7 @@ func TestDebugOptionSetConfig(t *testing.T) {
SkipCompilation: true,
SkipGetModules: true,
}
assert.NoError(t, cfg.Validate())
require.NoError(t, cfg.Validate())
assert.True(t, cfg.Distribution.DebugCompilation)
}

Expand Down Expand Up @@ -314,7 +327,7 @@ func TestConfmapFactoryVersions(t *testing.T) {
func TestAddsDefaultProviders(t *testing.T) {
cfg := NewDefaultConfig()
cfg.Providers = nil
assert.NoError(t, cfg.ParseModules())
require.NoError(t, cfg.ParseModules())
assert.Len(t, *cfg.Providers, 5)
}

Expand Down
Loading

0 comments on commit bd6d2cd

Please sign in to comment.