-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update deps to v0.36.0 * Bump smart agent bundle to v5.14.0 * Bump github.com/signalfx/signalfx-agent to main * Update CHANGELOG.md * Fixes for breaking upstream changes Unit tests pass (at least on my machine) but we may want to test manually as well. * Use new run api from collector v.36 * Update configs for tls/insecure option * testutil 0.36.0 fixes and mod tidy * Bump smart agent bundle to v5.14.1 * Bump github.com/signalfx/signalfx-agent to main * missing test insecure tls settings * account for updated exec default timeout * correct failing vault config source test * Move exporters::otlp::tls::insecure if it exists * Add a warning for deprecated parameter in otlp exporter * Update CHANGELOG.md Co-authored-by: Ryan Fitzpatrick <[email protected]> * Update CHANGELOG.md Co-authored-by: Pablo Collins <[email protected]> Co-authored-by: Ryan Fitzpatrick <[email protected]> Co-authored-by: Dmitry <[email protected]> Co-authored-by: Ryan Fitzpatrick <[email protected]>
- Loading branch information
1 parent
6156235
commit 8341caf
Showing
60 changed files
with
569 additions
and
423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v5.13.0 | ||
v5.14.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package configconverter | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"regexp" | ||
|
||
"go.opentelemetry.io/collector/config/configparser" | ||
) | ||
|
||
func MoveOTLPInsecureKey(in *configparser.ConfigMap) *configparser.ConfigMap { | ||
const expr = "exporters::otlp(/\\w+)?::insecure" | ||
insecureRE, _ := regexp.Compile(expr) | ||
out := configparser.NewConfigMap() | ||
var deprecatedOTLPConfigFound bool | ||
for _, k := range in.AllKeys() { | ||
v := in.Get(k) | ||
match := insecureRE.FindStringSubmatch(k) | ||
if match == nil { | ||
out.Set(k, v) | ||
} else { | ||
tlsKey := fmt.Sprintf("exporters::otlp%s::tls::insecure", match[1]) | ||
log.Printf("Unsupported key found: %s. Moving to %s\n", k, tlsKey) | ||
out.Set(tlsKey, v) | ||
deprecatedOTLPConfigFound = true | ||
} | ||
} | ||
if deprecatedOTLPConfigFound { | ||
log.Println("[WARNING] `exporters` -> `otlp` -> `insecure` parameter is " + | ||
"deprecated. Please update the config according to the guideline: " + | ||
"https://github.com/signalfx/splunk-otel-collector#from-0350-to-0360.") | ||
} | ||
return out | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Copyright The OpenTelemetry Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package configconverter | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestConverterProvider_Noop(t *testing.T) { | ||
pp := &converterProvider{ | ||
wrapped: &fileParserProvider{fileName: "testdata/otlp-insecure.yaml"}, | ||
} | ||
v, err := pp.Get(context.Background()) | ||
require.NoError(t, err) | ||
assert.True(t, v.IsSet("exporters::otlp::insecure")) | ||
} | ||
|
||
func TestMoveOTLPInsecureKey(t *testing.T) { | ||
pp := &converterProvider{ | ||
wrapped: &fileParserProvider{fileName: "testdata/otlp-insecure.yaml"}, | ||
cfgMapFuncs: []CfgMapFunc{MoveOTLPInsecureKey}, | ||
} | ||
v, err := pp.Get(context.Background()) | ||
require.NoError(t, err) | ||
assert.False(t, v.IsSet("exporters::otlp::insecure")) | ||
assert.Equal(t, true, v.Get("exporters::otlp::tls::insecure")) | ||
} | ||
|
||
func TestMoveOTLPInsecureKey_Custom(t *testing.T) { | ||
pp := &converterProvider{ | ||
wrapped: &fileParserProvider{fileName: "testdata/otlp-insecure-custom.yaml"}, | ||
cfgMapFuncs: []CfgMapFunc{MoveOTLPInsecureKey}, | ||
} | ||
v, err := pp.Get(context.Background()) | ||
require.NoError(t, err) | ||
assert.False(t, v.IsSet("exporters::otlp/foo::insecure")) | ||
assert.Equal(t, true, v.Get("exporters::otlp/foo::tls::insecure")) | ||
assert.Equal(t, true, v.Get("exporters::otlp/foo::tls::insecure_skip_verify")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
internal/configconverter/testdata/otlp-insecure-custom.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
receivers: | ||
hostmetrics: | ||
collection_interval: 1s | ||
scrapers: | ||
cpu: | ||
exporters: | ||
otlp/foo: | ||
endpoint: localhost:4317 | ||
insecure: true | ||
tls: | ||
insecure_skip_verify: true | ||
service: | ||
pipelines: | ||
metrics: | ||
receivers: | ||
- hostmetrics | ||
exporters: | ||
- otlp/foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
receivers: | ||
hostmetrics: | ||
collection_interval: 1s | ||
scrapers: | ||
cpu: | ||
exporters: | ||
otlp: | ||
endpoint: localhost:4317 | ||
insecure: true | ||
service: | ||
pipelines: | ||
metrics: | ||
receivers: | ||
- hostmetrics | ||
exporters: | ||
- otlp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.