Skip to content

Commit

Permalink
Merge branch 'main' into deprecate_ErrNilNextConsumer
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme authored Feb 16, 2024
2 parents b67152e + 59b45a5 commit 65b4919
Show file tree
Hide file tree
Showing 47 changed files with 229 additions and 117 deletions.
25 changes: 25 additions & 0 deletions .chloggen/codeboten_consisten-scope-name.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: breaking

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: scope name for all generated Meter/Tracer funcs now includes full package name

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

# (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: []
25 changes: 25 additions & 0 deletions .chloggen/mx-psi_configopaque-stable.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: configopaque

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

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

# (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: []
25 changes: 25 additions & 0 deletions .chloggen/remove_ServerConfig_ToListener.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: breaking

# 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: Remove deprecated `configgrpc.ServerConfig.ToListener`

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

# (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]
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ jobs:
- name: Run Unit Tests With Coverage
run: make gotest-with-cover
- name: Upload coverage report
uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0
uses: Wandalen/wretry.action@62451a214c01d1b0136b4f87289d840b30d67b98 # v1.4.4
with:
action: codecov/codecov-action@v3
with: |
Expand Down
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@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
uses: github/codeql-action/init@e675ced7a7522a761fc9c8eb26682c8b27c42b2b # v3.24.1
with:
languages: go

- name: Autobuild
uses: github/codeql-action/autobuild@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
uses: github/codeql-action/autobuild@e675ced7a7522a761fc9c8eb26682c8b27c42b2b # v3.24.1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
uses: github/codeql-action/analyze@e675ced7a7522a761fc9c8eb26682c8b27c42b2b # v3.24.1
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@2f93e4319b2f04a2efc38fa7f78bd681bc3f7b2f # v2.23.2
uses: github/codeql-action/upload-sarif@1a077f8f6c71a45340c26ca0b877e00459e5f443 # v2.24.1
with:
sarif_file: results.sarif
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Here is a list of community roles with current and previous members:

- [Andrzej Stencel](https://github.com/astencel-sumo), Sumo Logic
- [Antoine Toulme](https://github.com/atoulme), Splunk
- [Evan Bradley](https://github.com/evan-bradley), Dynatrace
- [Tyler Helmuth](https://github.com/TylerHelmuth), Honeycomb
- [Yang Song](https://github.com/songy23), Datadog
- Actively seeking contributors to triage issues
Expand Down
2 changes: 1 addition & 1 deletion cmd/mdatagen/internal/metadata/generated_metrics.go

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

7 changes: 4 additions & 3 deletions cmd/mdatagen/internal/metadata/generated_status.go

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

30 changes: 11 additions & 19 deletions cmd/mdatagen/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,18 @@ func loadMetadata(filePath string) (metadata, error) {
return md, nil
}

var componentTypes = map[string]func(string) string{
"connector": func(in string) string { return strings.TrimSuffix(in, "connector") },
"exporter": func(in string) string { return strings.TrimSuffix(in, "exporter") },
"extension": func(in string) string { return strings.TrimSuffix(in, "extension") },
"processor": func(in string) string { return strings.TrimSuffix(in, "processor") },
"scraper": func(in string) string { return strings.TrimSuffix(in, "scraper") },
"receiver": func(in string) string { return in },
var componentTypes = []string{
"connector",
"exporter",
"extension",
"processor",
"scraper",
"receiver",
}

func shortFolderName(filePath string) string {
parentFolder := filepath.Base(filepath.Dir(filePath))
for cType := range componentTypes {
for _, cType := range componentTypes {
if strings.HasSuffix(parentFolder, cType) {
return strings.TrimSuffix(parentFolder, cType)
}
Expand All @@ -287,20 +287,12 @@ func shortFolderName(filePath string) string {
}

func scopeName(filePath string) string {
sn := "otelcol"
sn := "go.opentelemetry.io/collector"
dirs := strings.Split(filepath.Dir(filePath), string(os.PathSeparator))
for _, dir := range dirs {
// skip directory names for component types
if _, ok := componentTypes[dir]; ok {
continue
}
// note here that the only component that receives a different
// treatment is receivers. this is to prevent breaking backwards
// compatibility for anyone that's using the generated metrics w/
// scope names today.
for cType, normalizeFunc := range componentTypes {
for _, cType := range componentTypes {
if strings.HasSuffix(dir, cType) {
sn += "/" + normalizeFunc(dir)
sn += "/" + dir
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/mdatagen/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func Test_loadMetadata(t *testing.T) {
},
},
},
ScopeName: "otelcol",
ScopeName: "go.opentelemetry.io/collector",
ShortFolderName: ".",
},
},
Expand All @@ -223,7 +223,7 @@ func Test_loadMetadata(t *testing.T) {
want: metadata{
Type: "subcomponent",
Parent: "parentComponent",
ScopeName: "otelcol",
ScopeName: "go.opentelemetry.io/collector",
ShortFolderName: "testdata",
},
},
Expand Down
14 changes: 8 additions & 6 deletions cmd/mdatagen/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,19 +366,20 @@ import (
)
var (
Type = component.MustNewType("foo")
Type = component.MustNewType("foo")
scopeName = ""
)
const (
MetricsStability = component.StabilityLevelBeta
)
func Meter(settings component.TelemetrySettings) metric.Meter {
return settings.MeterProvider.Meter("")
return settings.MeterProvider.Meter(scopeName)
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
return settings.TracerProvider.Tracer("")
return settings.TracerProvider.Tracer(scopeName)
}
`,
},
Expand All @@ -403,19 +404,20 @@ import (
)
var (
Type = component.MustNewType("foo")
Type = component.MustNewType("foo")
scopeName = ""
)
const (
MetricsStability = component.StabilityLevelAlpha
)
func Meter(settings component.TelemetrySettings) metric.Meter {
return settings.MeterProvider.Meter("")
return settings.MeterProvider.Meter(scopeName)
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
return settings.TracerProvider.Tracer("")
return settings.TracerProvider.Tracer(scopeName)
}
`,
},
Expand Down
5 changes: 3 additions & 2 deletions cmd/mdatagen/templates/status.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

var (
Type = component.MustNewType("{{ .Type }}")
scopeName = "{{ .ScopeName }}"
)

const (
Expand All @@ -21,9 +22,9 @@ const (
)

func Meter(settings component.TelemetrySettings) metric.Meter {
return settings.MeterProvider.Meter("{{ .ScopeName }}")
return settings.MeterProvider.Meter(scopeName)
}

func Tracer(settings component.TelemetrySettings) trace.Tracer {
return settings.TracerProvider.Tracer("{{ .ScopeName }}")
return settings.TracerProvider.Tracer(scopeName)
}
6 changes: 0 additions & 6 deletions config/configgrpc/configgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,6 @@ func (gss *ServerConfig) ToListenerContext(ctx context.Context) (net.Listener, e
return gss.NetAddr.Listen(ctx)
}

// ToListener returns the net.Listener constructed from the settings.
// Deprecated: [v0.94.0] Call Listen directly on the NetAddr field.
func (gss *ServerConfig) ToListener() (net.Listener, error) {
return gss.ToListenerContext(context.Background())
}

func (gss *ServerConfig) ToServer(host component.Host, settings component.TelemetrySettings, extraOpts ...grpc.ServerOption) (*grpc.Server, error) {
opts, err := gss.toServerOption(host, settings)
if err != nil {
Expand Down

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

2 changes: 1 addition & 1 deletion exporter/debugexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect
google.golang.org/grpc v1.61.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions exporter/debugexporter/go.sum

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

7 changes: 4 additions & 3 deletions exporter/debugexporter/internal/metadata/generated_status.go

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

4 changes: 2 additions & 2 deletions exporter/exporterhelper/retry_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/internal/queue"
"go.opentelemetry.io/collector/exporter/internal/experr"
"go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics"
)

Expand Down Expand Up @@ -127,7 +127,7 @@ func (rs *retrySender) send(ctx context.Context, req Request) error {
case <-ctx.Done():
return fmt.Errorf("request is cancelled or timed out %w", err)
case <-rs.stopCh:
return queue.NewShutdownErr(err)
return experr.NewShutdownErr(err)
case <-time.After(backoffDelay):
}
}
Expand Down
2 changes: 1 addition & 1 deletion exporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.26.0
golang.org/x/sys v0.16.0
golang.org/x/sys v0.17.0
google.golang.org/grpc v1.61.0
)

Expand Down
Loading

0 comments on commit 65b4919

Please sign in to comment.