Skip to content

Commit

Permalink
Merge branch 'main' into renovate/major-github-actions-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdandrutu authored Dec 19, 2023
2 parents 7f2de12 + 1b56c29 commit b9409f4
Show file tree
Hide file tree
Showing 41 changed files with 1,194 additions and 169 deletions.
22 changes: 22 additions & 0 deletions .chloggen/carbonexportermax.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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. filelogreceiver)
component: carbonexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Add ability to configure max_idle_conns"

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

# 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: [user]
27 changes: 27 additions & 0 deletions .chloggen/filterprocessor-telemetry.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: enhancement

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add telemetry for metrics, logs, and spans that were intentionally dropped via filterprocessor.

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

# (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: [user]
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- cmd
- other
runs-on: windows-latest
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push') }}
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push') }}
env:
# Limit memory usage via GC environment variables to avoid OOM on GH runners, especially for `cmd/otelcontribcol`,
# see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/28682#issuecomment-1802296776
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Run Unit tests
run: make -j2 gotest GROUP=${{ matrix.group }}
windows-unittest:
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push') }}
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push') }}
runs-on: windows-latest
needs: [windows-unittest-matrix]
steps:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
setup-environment:
timeout-minutes: 30
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
- name: Lint
run: make -j2 golint GROUP=${{ matrix.group }}
lint:
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && always() }}
if: ${{ github.actor != 'dependabot[bot]' && always() }}
runs-on: ubuntu-latest
needs: [setup-environment, lint-matrix]
steps:
Expand Down Expand Up @@ -134,7 +134,6 @@ jobs:
- internal
- pkg
runs-on: ubuntu-latest
if: ${{ github.actor != 'renovate[bot]' }}
timeout-minutes: 30
steps:
- name: Checkout Repo
Expand Down Expand Up @@ -277,7 +276,7 @@ jobs:
name: coverage-artifacts
path: ${{ matrix.group }}-coverage.txt
unittest:
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && always() }}
if: ${{ github.actor != 'dependabot[bot]' && always() }}
runs-on: ubuntu-latest
needs: [setup-environment, unittest-matrix]
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ concurrency:
jobs:
changelog:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' }}
env:
PR_HEAD: ${{ github.event.pull_request.head.sha }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
env:
PR_HEAD: ${{ github.event.pull_request.head.sha }}
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' }}
outputs:
md: ${{ steps.changes.outputs.md }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
CodeQL-Build:
runs-on: macos-latest
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' }}
env:
# Force CodeQL to run the extraction on the files compiled by our custom
# build command, as opposed to letting the autobuilder figure it out.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
jobs:
collector-build:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/load-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
setup-environment:
timeout-minutes: 30
runs-on: self-hosted
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' }}
outputs:
loadtest_matrix: ${{ steps.splitloadtest.outputs.loadtest_matrix }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prometheus-compliance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
jobs:
prometheus-compliance-tests:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/telemetrygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
build-dev:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
Expand Down
6 changes: 3 additions & 3 deletions cmd/configschema/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ require (
github.com/prometheus/prometheus v0.48.1 // indirect
github.com/prometheus/statsd_exporter v0.22.7 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/redis/go-redis/v9 v9.3.0 // indirect
github.com/redis/go-redis/v9 v9.3.1 // indirect
github.com/relvacode/iso8601 v1.3.0 // indirect
github.com/rs/cors v1.10.1 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
Expand Down Expand Up @@ -597,7 +597,7 @@ require (
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821 // indirect
github.com/tg123/go-htpasswd v1.2.1 // indirect
github.com/tg123/go-htpasswd v1.2.2 // indirect
github.com/tidwall/gjson v1.14.3 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
Expand Down Expand Up @@ -704,7 +704,7 @@ require (
k8s.io/apimachinery v0.28.4 // indirect
k8s.io/client-go v0.28.4 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/kubelet v0.28.4 // indirect
k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect
Expand Down
13 changes: 6 additions & 7 deletions cmd/configschema/go.sum

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

6 changes: 3 additions & 3 deletions cmd/otelcontribcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ require (
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/statsd_exporter v0.22.7 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/redis/go-redis/v9 v9.3.0 // indirect
github.com/redis/go-redis/v9 v9.3.1 // indirect
github.com/relvacode/iso8601 v1.3.0 // indirect
github.com/rs/cors v1.10.1 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
Expand Down Expand Up @@ -621,7 +621,7 @@ require (
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821 // indirect
github.com/tg123/go-htpasswd v1.2.1 // indirect
github.com/tg123/go-htpasswd v1.2.2 // indirect
github.com/tidwall/gjson v1.10.2 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
Expand Down Expand Up @@ -714,7 +714,7 @@ require (
k8s.io/apimachinery v0.28.4 // indirect
k8s.io/client-go v0.28.4 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/kubelet v0.28.4 // indirect
k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect
Expand Down
13 changes: 6 additions & 7 deletions cmd/otelcontribcol/go.sum

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

14 changes: 8 additions & 6 deletions exporter/carbonexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry"
)

// Defaults for not specified configuration settings.
const (
defaultEndpoint = "localhost:2003"
)

// Config defines configuration for Carbon exporter.
type Config struct {
// Specifies the connection endpoint config. The default value is "localhost:2003".
confignet.TCPAddr `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
// MaxIdleConns is used to set a limit to the maximum idle TCP connections the client can keep open. Default value is 100.
// If `sending_queue` is enabled, it is recommended to use same value as `sending_queue::num_consumers`.
MaxIdleConns int `mapstructure:"max_idle_conns"`

// Timeout is the maximum duration allowed to connecting and sending the
// data to the Carbon/Graphite backend. The default value is 5s.
Expand All @@ -43,7 +41,11 @@ func (cfg *Config) Validate() error {

// Negative timeouts are not acceptable, since all sends will fail.
if cfg.Timeout < 0 {
return errors.New("exporter requires a positive timeout")
return errors.New("'timeout' must be non-negative")
}

if cfg.MaxIdleConns < 0 {
return errors.New("'max_idle_conns' must be non-negative")
}

return nil
Expand Down
10 changes: 10 additions & 0 deletions exporter/carbonexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func TestLoadConfig(t *testing.T) {
TCPAddr: confignet.TCPAddr{
Endpoint: "localhost:8080",
},
MaxIdleConns: 15,
TimeoutSettings: exporterhelper.TimeoutSettings{
Timeout: 10 * time.Second,
},
Expand Down Expand Up @@ -101,12 +102,21 @@ func TestValidateConfig(t *testing.T) {
{
name: "invalid_timeout",
config: &Config{
TCPAddr: confignet.TCPAddr{Endpoint: defaultEndpoint},
TimeoutSettings: exporterhelper.TimeoutSettings{
Timeout: -5 * time.Second,
},
},
wantErr: true,
},
{
name: "invalid_max_idle_conns",
config: &Config{
TCPAddr: confignet.TCPAddr{Endpoint: defaultEndpoint},
MaxIdleConns: -1,
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
Loading

0 comments on commit b9409f4

Please sign in to comment.