diff --git a/.chloggen/collectd-http-server-settings-api.yaml b/.chloggen/collectd-http-server-settings-api.yaml new file mode 100644 index 000000000000..90baafb4e59c --- /dev/null +++ b/.chloggen/collectd-http-server-settings-api.yaml @@ -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: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: collectdreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Move to use confighttp.HTTPServerSettings + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [28811] + +# (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: [api] diff --git a/.chloggen/collectd-http-server-settings.yaml b/.chloggen/collectd-http-server-settings.yaml new file mode 100644 index 000000000000..c08818af0315 --- /dev/null +++ b/.chloggen/collectd-http-server-settings.yaml @@ -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: collectdreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add support of confighttp.HTTPServerSettings + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [28811] + +# (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: [] diff --git a/.chloggen/cpuinfo_frequency_metric.yaml b/.chloggen/cpuinfo_frequency_metric.yaml new file mode 100644 index 000000000000..cf44d87b8bf7 --- /dev/null +++ b/.chloggen/cpuinfo_frequency_metric.yaml @@ -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: receiver/hostmetricsreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Added support for host's cpuinfo frequnecies. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [27445] + +# (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: In Linux the current frequency is populated using the values from /proc/cpuinfo. An os specific implementation will be needed for Windows and others. + +# 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: [] \ No newline at end of file diff --git a/.chloggen/k8sattrs-move-time-format-feature-gate-to-beta.yaml b/.chloggen/k8sattrs-move-time-format-feature-gate-to-beta.yaml new file mode 100755 index 000000000000..2d430fc73a9f --- /dev/null +++ b/.chloggen/k8sattrs-move-time-format-feature-gate-to-beta.yaml @@ -0,0 +1,31 @@ +# 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. filelogreceiver) +component: processor/k8sattributes + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Graduate "k8sattr.rfc3339" feature gate to Beta. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [28817] + +# (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: | + Time format of `k8s.pod.start_time` attribute value migrated from RFC3339: + Before: 2023-07-10 12:34:39.740638 -0700 PDT m=+0.020184946 + After: 2023-07-10T12:39:53.112485-07:00 + The feature gate can be temporary reverted back by adding `--feature-gate=-k8sattr.rfc3339` to the command line. + +# 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] diff --git a/exporter/datadogexporter/traces_exporter_test.go b/exporter/datadogexporter/traces_exporter_test.go index 5ff91312c04e..73de0d506d88 100644 --- a/exporter/datadogexporter/traces_exporter_test.go +++ b/exporter/datadogexporter/traces_exporter_test.go @@ -229,7 +229,6 @@ func TestTracesSource(t *testing.T) { } func TestTraceExporter(t *testing.T) { - t.Skip("Flaky test on CI, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/27630") metricsServer := testutil.DatadogServerMock() defer metricsServer.Close() @@ -259,6 +258,7 @@ func TestTraceExporter(t *testing.T) { }, IgnoreResources: []string{}, flushInterval: 0.1, + TraceBuffer: 2, }, } diff --git a/exporter/signalfxexporter/internal/apm/correlations/client.go b/exporter/signalfxexporter/internal/apm/correlations/client.go index bb48cb4f98b3..427c0abb685f 100644 --- a/exporter/signalfxexporter/internal/apm/correlations/client.go +++ b/exporter/signalfxexporter/internal/apm/correlations/client.go @@ -146,7 +146,7 @@ func (cc *Client) putRequestOnChan(r *request) error { func (cc *Client) putRequestOnRetryChan(r *request) error { // handle request counter - if requestcounter.GetRequestCount(r.ctx) == cc.maxAttempts { + if requestcounter.GetRequestCount(r.ctx) >= cc.maxAttempts { return errMaxAttempts } requestcounter.IncrementRequestCount(r.ctx) diff --git a/exporter/signalfxexporter/internal/apm/correlations/client_test.go b/exporter/signalfxexporter/internal/apm/correlations/client_test.go index ecffd83add46..48cb24b996de 100644 --- a/exporter/signalfxexporter/internal/apm/correlations/client_test.go +++ b/exporter/signalfxexporter/internal/apm/correlations/client_test.go @@ -148,8 +148,8 @@ func setup(t *testing.T) (CorrelationClient, chan *request, *atomic.Value, *atom MaxBuffered: 10, MaxRetries: 4, LogUpdates: true, - RetryDelay: 0, - CleanupInterval: 0, + RetryDelay: 0 * time.Second, + CleanupInterval: 1 * time.Minute, }, AccessToken: "", URL: serverURL, @@ -180,7 +180,6 @@ func setup(t *testing.T) (CorrelationClient, chan *request, *atomic.Value, *atom } func TestCorrelationClient(t *testing.T) { - t.Skip("See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/27059") client, serverCh, forcedRespCode, forcedRespPayload, cancel := setup(t) defer close(serverCh) defer cancel() @@ -248,6 +247,7 @@ func TestCorrelationClient(t *testing.T) { cors := waitForCors(serverCh, 1, 4) require.Len(t, cors, 0) + require.Equal(t, uint32(5), client.(*Client).maxAttempts) require.Equal(t, int64(5), atomic.LoadInt64(&client.(*Client).TotalRetriedUpdates)) forcedRespCode.Store(200) diff --git a/processor/k8sattributesprocessor/internal/kube/client.go b/processor/k8sattributesprocessor/internal/kube/client.go index 70e46ed4049a..1a995fb9649c 100644 --- a/processor/k8sattributesprocessor/internal/kube/client.go +++ b/processor/k8sattributesprocessor/internal/kube/client.go @@ -26,10 +26,10 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor/internal/observability" ) -// Upgrade to StageBeta in v0.83.0 +// Upgrade to StageStable in v0.92.0 var enableRFC3339Timestamp = featuregate.GlobalRegistry().MustRegister( "k8sattr.rfc3339", - featuregate.StageAlpha, + featuregate.StageBeta, featuregate.WithRegisterDescription("When enabled, uses RFC3339 format for k8s.pod.start_time value"), featuregate.WithRegisterFromVersion("v0.82.0"), ) diff --git a/processor/k8sattributesprocessor/processor.go b/processor/k8sattributesprocessor/processor.go index ce0d095e92ab..2a10b9b86afa 100644 --- a/processor/k8sattributesprocessor/processor.go +++ b/processor/k8sattributesprocessor/processor.go @@ -50,12 +50,6 @@ func (kp *kubernetesprocessor) initKubeClient(logger *zap.Logger, kubeClient kub } func (kp *kubernetesprocessor) Start(_ context.Context, _ component.Host) error { - if kp.rules.StartTime { - kp.logger.Warn("k8s.pod.start_time value will be changed to use RFC3339 format in v0.83.0. " + - "see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/24016 for more information. " + - "enable feature-gate k8sattr.rfc3339 to opt into this change.") - } - if !kp.passthroughMode { go kp.kc.Start() } diff --git a/receiver/collectdreceiver/README.md b/receiver/collectdreceiver/README.md index a24b87fd51b6..688acc41f227 100644 --- a/receiver/collectdreceiver/README.md +++ b/receiver/collectdreceiver/README.md @@ -29,10 +29,12 @@ value `field[a=b, k=v]`, this receiver will extract `a` and `b` as label keys and, `k` and `v` as the respective label values. ## Configuration +The configuration includes the Opentelemetry collector's server [confighttp](https://github.com/open-telemetry/opentelemetry-collector/tree/main/config/confighttp#server-configuration), +which allows for a variety of settings. Only the most relevant ones will be discussed here, but all are available. The following settings are required: -- `endpoint` (default = `localhost:8081`): Address to reach the desired Docker daemon. +- `endpoint` (default = `localhost:8081`): Endpoint exposed by this receiver to send data. The following settings are optional: diff --git a/receiver/collectdreceiver/config.go b/receiver/collectdreceiver/config.go index bb62eeba702e..d1959ba94834 100644 --- a/receiver/collectdreceiver/config.go +++ b/receiver/collectdreceiver/config.go @@ -4,16 +4,29 @@ package collectdreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver" import ( + "fmt" + "strings" "time" - "go.opentelemetry.io/collector/config/confignet" + "go.opentelemetry.io/collector/config/confighttp" ) // Config defines configuration for Collectd receiver. type Config struct { - confignet.TCPAddr `mapstructure:",squash"` + confighttp.HTTPServerSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct + Timeout time.Duration `mapstructure:"timeout"` + Encoding string `mapstructure:"encoding"` + AttributesPrefix string `mapstructure:"attributes_prefix"` +} - Timeout time.Duration `mapstructure:"timeout"` - AttributesPrefix string `mapstructure:"attributes_prefix"` - Encoding string `mapstructure:"encoding"` +func (c *Config) Validate() error { + // CollectD receiver only supports JSON encoding. We expose a config option + // to make it explicit and obvious to the users. + if strings.ToLower(c.Encoding) != defaultEncodingFormat { + return fmt.Errorf( + "CollectD only support JSON encoding format. %s is not supported", + c.Encoding, + ) + } + return nil } diff --git a/receiver/collectdreceiver/config_test.go b/receiver/collectdreceiver/config_test.go index 4e67ab5a9a24..1e1af73fb53a 100644 --- a/receiver/collectdreceiver/config_test.go +++ b/receiver/collectdreceiver/config_test.go @@ -4,6 +4,7 @@ package collectdreceiver import ( + "errors" "path/filepath" "testing" "time" @@ -11,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config/confignet" + "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/confmap/confmaptest" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver/internal/metadata" @@ -23,6 +24,7 @@ func TestLoadConfig(t *testing.T) { tests := []struct { id component.ID expected component.Config + wantErr error }{ { id: component.NewIDWithName(metadata.Type, ""), @@ -31,13 +33,14 @@ func TestLoadConfig(t *testing.T) { { id: component.NewIDWithName(metadata.Type, "one"), expected: &Config{ - TCPAddr: confignet.TCPAddr{ + HTTPServerSettings: confighttp.HTTPServerSettings{ Endpoint: "localhost:12345", }, - Timeout: time.Second * 50, + Timeout: 50 * time.Second, AttributesPrefix: "dap_", Encoding: "command", }, + wantErr: errors.New("CollectD only support JSON encoding format. command is not supported"), }, } @@ -53,7 +56,11 @@ func TestLoadConfig(t *testing.T) { require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - assert.NoError(t, component.ValidateConfig(cfg)) + if tt.wantErr == nil { + assert.NoError(t, component.ValidateConfig(cfg)) + } else { + assert.Equal(t, tt.wantErr, component.ValidateConfig(cfg)) + } assert.Equal(t, tt.expected, cfg) }) } diff --git a/receiver/collectdreceiver/factory.go b/receiver/collectdreceiver/factory.go index b0a211997d39..b28891a8e4b7 100644 --- a/receiver/collectdreceiver/factory.go +++ b/receiver/collectdreceiver/factory.go @@ -5,12 +5,10 @@ package collectdreceiver // import "github.com/open-telemetry/opentelemetry-coll import ( "context" - "fmt" - "strings" "time" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config/confignet" + "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" @@ -21,7 +19,6 @@ import ( const ( defaultBindEndpoint = "localhost:8081" - defaultTimeout = time.Second * 30 defaultEncodingFormat = "json" ) @@ -34,10 +31,10 @@ func NewFactory() receiver.Factory { } func createDefaultConfig() component.Config { return &Config{ - TCPAddr: confignet.TCPAddr{ + HTTPServerSettings: confighttp.HTTPServerSettings{ Endpoint: defaultBindEndpoint, }, - Timeout: defaultTimeout, + Timeout: 30 * time.Second, Encoding: defaultEncodingFormat, } } @@ -49,14 +46,5 @@ func createMetricsReceiver( nextConsumer consumer.Metrics, ) (receiver.Metrics, error) { c := cfg.(*Config) - c.Encoding = strings.ToLower(c.Encoding) - // CollectD receiver only supports JSON encoding. We expose a config option - // to make it explicit and obvious to the users. - if c.Encoding != defaultEncodingFormat { - return nil, fmt.Errorf( - "CollectD only support JSON encoding format. %s is not supported", - c.Encoding, - ) - } - return newCollectdReceiver(cs.Logger, c.Endpoint, c.Timeout, c.AttributesPrefix, nextConsumer, cs) + return newCollectdReceiver(cs.Logger, c, c.AttributesPrefix, nextConsumer, cs) } diff --git a/receiver/collectdreceiver/go.mod b/receiver/collectdreceiver/go.mod index 7d89ec45fd8a..294752cc8312 100644 --- a/receiver/collectdreceiver/go.mod +++ b/receiver/collectdreceiver/go.mod @@ -8,7 +8,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.88.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 - go.opentelemetry.io/collector/config/confignet v0.88.1-0.20231026220224-6405e152a2d9 + go.opentelemetry.io/collector/config/confighttp v0.88.1-0.20231026220224-6405e152a2d9 go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 go.opentelemetry.io/collector/consumer v0.88.1-0.20231026220224-6405e152a2d9 go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 @@ -19,9 +19,15 @@ require ( require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/snappy v0.0.4 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.2 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.0.1 // indirect @@ -32,10 +38,19 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.88.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rs/cors v1.10.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/config/configauth v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/config/configcompression v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/config/configopaque v0.88.1-0.20231026220224-6405e152a2d9 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/config/configtls v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/config/internal v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/extension/auth v0.88.1-0.20231026220224-6405e152a2d9 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect diff --git a/receiver/collectdreceiver/go.sum b/receiver/collectdreceiver/go.sum index 5a4a2b216e2e..a8a8917a7e1e 100644 --- a/receiver/collectdreceiver/go.sum +++ b/receiver/collectdreceiver/go.sum @@ -14,10 +14,17 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -36,6 +43,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -50,6 +59,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= +github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -79,6 +90,8 @@ github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lne github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= +github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -96,20 +109,36 @@ go.opentelemetry.io/collector v0.88.1-0.20231026220224-6405e152a2d9 h1:UIbHSFtHl go.opentelemetry.io/collector v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:5iWdJH9WM+Bp+t3Ii72ppPmeZ0B2vci07ApE+0fRGKs= go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 h1:t9GCaQDZ1MDBjEAC1Y7NvwiqvVppK6ckAfrUEAlFioA= go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:4utKxz4Lilym3SPxNXJHosdaTjT1aQxI+TCmnJO54pU= -go.opentelemetry.io/collector/config/confignet v0.88.1-0.20231026220224-6405e152a2d9 h1:NPTJUR2N2d0XfRgkuxLJk3TzoaIaeXsC6eynZXDkC9w= -go.opentelemetry.io/collector/config/confignet v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:cpO8JYWGONaViOygKVw+Hd2UoBcn2cUiyi0WWeFTwJY= +go.opentelemetry.io/collector/config/configauth v0.88.1-0.20231026220224-6405e152a2d9 h1:/miLBOHQlxspauNzKacbukT861aW8vgkG6DYjc6i7YA= +go.opentelemetry.io/collector/config/configauth v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:iMPoqAeGB9UScF/sugPF8xcuctlhx8jFK2jAmzDn/1E= +go.opentelemetry.io/collector/config/configcompression v0.88.1-0.20231026220224-6405e152a2d9 h1:5cqU6jeFGjqSrL5RsDSxrQe7vTIICeyoxATY1J4mUvc= +go.opentelemetry.io/collector/config/configcompression v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:LaavoxZsro5lL7qh1g9DMifG0qixWPEecW18Qr8bpag= +go.opentelemetry.io/collector/config/confighttp v0.88.1-0.20231026220224-6405e152a2d9 h1:jEEupxkBYPlKo4uA/9s7mrN9d2iZQ5hTPIQpOelxaiw= +go.opentelemetry.io/collector/config/confighttp v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:bmzLcdPexlRvI7a+56eGqZOWhMYAMf+F0h+HLzrpv6w= +go.opentelemetry.io/collector/config/configopaque v0.88.1-0.20231026220224-6405e152a2d9 h1:YwkklGD3FSAp9QAmkFwzjRLxYKdTGp61s0ZuIpFQSyM= +go.opentelemetry.io/collector/config/configopaque v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:TPCHaU+QXiEV+JXbgyr6mSErTI9chwQyasDVMdJr3eY= go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 h1:4WPy3qE1lJE1LZE7t1kAj1XSZN85w68JknZO5Uo00vw= go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= +go.opentelemetry.io/collector/config/configtls v0.88.1-0.20231026220224-6405e152a2d9 h1:Ez4mdgLXvdusZGu7I4+X2hiXCQP69aAB0LWERwosJmE= +go.opentelemetry.io/collector/config/configtls v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:i8X3Zj6ICyTbtIOZrDzgXFkFVGKjFtM6/82SMOXbYHc= +go.opentelemetry.io/collector/config/internal v0.88.1-0.20231026220224-6405e152a2d9 h1:11WTkBuGy3QCRXQA6oy9ZJn+wBSEfZ7USnKVTPy9yCY= +go.opentelemetry.io/collector/config/internal v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:42VsQ/1kP2qnvzjNi+dfNP+KyCFRADejyrJ8m2GVL3M= go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 h1:JKFChlNpigR1Q4hZUjDU2sB2VuQ+RigAh7oOQfdcaiQ= go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:CSJlMk1KRZloXAygpiPeCLpuQiLVDEZYbGsGHIKHeUg= go.opentelemetry.io/collector/consumer v0.88.1-0.20231026220224-6405e152a2d9 h1:xiosDLoF99krBlBdiZvw22CSCYU0picQMKskzjaIU8I= go.opentelemetry.io/collector/consumer v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:VVoafgyhjpO6fuJu12GqspmuLrn91JCOou0sOtb9GOg= +go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 h1:6lnGLRgbuTQR7sR1xRqTfJMX2UNkOKbqVAwJDzobvGY= +go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:5wPlOyWtVJcZS9CMhFUnuRvNQ0XIoV/iUSaZWtCjoHA= +go.opentelemetry.io/collector/extension/auth v0.88.1-0.20231026220224-6405e152a2d9 h1:YFN6/C9HLfY/k0OyHUdF7jInwBZT+C9O9FNfQTxNHoY= +go.opentelemetry.io/collector/extension/auth v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:IcwiPhj6ZGTaZ7WVRVvl97uyw9NShsVqcTRLtXddpK0= go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:luvDPu+FNy6LIylBOO8PH/ca6ym7JKAdMe1J1aJbsF4= go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:TVYPzf0ZwFDTSoQ6gPk4lpQgVK4g43cWYuo710E0RHI= go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:Rv9fOclA5AtM/JGm0d4jBOIAo1+jBA13UT5Bx0ovXi4= go.opentelemetry.io/collector/receiver v0.88.1-0.20231026220224-6405e152a2d9 h1:h+1btMM+rRpZsCnR2vFmvmczeQxKhVwEohV8urOvZho= go.opentelemetry.io/collector/receiver v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:3lhOi7CWMwiiolm6d579ZX+pIVwKPCRP+7ScontYOuI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA= diff --git a/receiver/collectdreceiver/receiver.go b/receiver/collectdreceiver/receiver.go index 225d5bc30633..977292f4d217 100644 --- a/receiver/collectdreceiver/receiver.go +++ b/receiver/collectdreceiver/receiver.go @@ -7,11 +7,9 @@ import ( "context" "encoding/json" "errors" - "fmt" "io" "net/http" "strings" - "time" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" @@ -28,53 +26,59 @@ var _ receiver.Metrics = (*collectdReceiver)(nil) // collectdReceiver implements the receiver.Metrics for CollectD protocol. type collectdReceiver struct { logger *zap.Logger - addr string server *http.Server defaultAttrsPrefix string nextConsumer consumer.Metrics obsrecv *receiverhelper.ObsReport + createSettings receiver.CreateSettings + config *Config } // newCollectdReceiver creates the CollectD receiver with the given parameters. func newCollectdReceiver( logger *zap.Logger, - addr string, - timeout time.Duration, + cfg *Config, defaultAttrsPrefix string, nextConsumer consumer.Metrics, createSettings receiver.CreateSettings) (receiver.Metrics, error) { if nextConsumer == nil { return nil, component.ErrNilNextConsumer } - obsrecv, err := receiverhelper.NewObsReport(receiverhelper.ObsReportSettings{ - ReceiverID: createSettings.ID, - Transport: "http", - ReceiverCreateSettings: createSettings, - }) - if err != nil { - return nil, err - } + r := &collectdReceiver{ logger: logger, - addr: addr, nextConsumer: nextConsumer, defaultAttrsPrefix: defaultAttrsPrefix, - obsrecv: obsrecv, - } - r.server = &http.Server{ - Addr: addr, - Handler: r, - ReadTimeout: timeout, - WriteTimeout: timeout, + config: cfg, + createSettings: createSettings, } - return r, err + return r, nil } // Start starts an HTTP server that can process CollectD JSON requests. func (cdr *collectdReceiver) Start(_ context.Context, host component.Host) error { + var err error + cdr.server, err = cdr.config.HTTPServerSettings.ToServer(host, cdr.createSettings.TelemetrySettings, cdr) + if err != nil { + return err + } + cdr.server.ReadTimeout = cdr.config.Timeout + cdr.server.WriteTimeout = cdr.config.Timeout + cdr.obsrecv, err = receiverhelper.NewObsReport(receiverhelper.ObsReportSettings{ + ReceiverID: cdr.createSettings.ID, + Transport: "http", + ReceiverCreateSettings: cdr.createSettings, + }) + if err != nil { + return err + } + l, err := cdr.config.HTTPServerSettings.ToListener() + if err != nil { + return err + } go func() { - if err := cdr.server.ListenAndServe(); !errors.Is(err, http.ErrServerClosed) && err != nil { - host.ReportFatalError(fmt.Errorf("error starting collectd receiver: %w", err)) + if err := cdr.server.Serve(l); !errors.Is(err, http.ErrServerClosed) && err != nil { + _ = cdr.createSettings.TelemetrySettings.ReportComponentStatus(component.NewFatalErrorEvent(err)) } }() return nil @@ -82,6 +86,9 @@ func (cdr *collectdReceiver) Start(_ context.Context, host component.Host) error // Shutdown stops the CollectD receiver. func (cdr *collectdReceiver) Shutdown(context.Context) error { + if cdr.server == nil { + return nil + } return cdr.server.Shutdown(context.Background()) } diff --git a/receiver/collectdreceiver/receiver_test.go b/receiver/collectdreceiver/receiver_test.go index f03d7149a3cb..69a87f82380c 100644 --- a/receiver/collectdreceiver/receiver_test.go +++ b/receiver/collectdreceiver/receiver_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" @@ -33,8 +34,7 @@ type wantedBody struct { func TestNewReceiver(t *testing.T) { type args struct { - addr string - timeout time.Duration + config *Config attrsPrefix string nextConsumer consumer.Metrics } @@ -46,8 +46,11 @@ func TestNewReceiver(t *testing.T) { { name: "nil next Consumer", args: args{ - addr: ":0", - timeout: defaultTimeout, + config: &Config{ + HTTPServerSettings: confighttp.HTTPServerSettings{ + Endpoint: ":0", + }, + }, attrsPrefix: "default_attr_", }, wantErr: component.ErrNilNextConsumer, @@ -55,8 +58,11 @@ func TestNewReceiver(t *testing.T) { { name: "happy path", args: args{ - addr: ":0", - timeout: defaultTimeout, + config: &Config{ + HTTPServerSettings: confighttp.HTTPServerSettings{ + Endpoint: ":0", + }, + }, attrsPrefix: "default_attr_", nextConsumer: consumertest.NewNop(), }, @@ -65,7 +71,7 @@ func TestNewReceiver(t *testing.T) { logger := zap.NewNop() for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - _, err := newCollectdReceiver(logger, tt.args.addr, time.Second*10, "", tt.args.nextConsumer, receivertest.NewNopCreateSettings()) + _, err := newCollectdReceiver(logger, tt.args.config, "", tt.args.nextConsumer, receivertest.NewNopCreateSettings()) require.ErrorIs(t, err, tt.wantErr) }) } @@ -82,7 +88,11 @@ func TestCollectDServer(t *testing.T) { WantData []pmetric.Metrics } - var endpoint = "localhost:8081" + config := &Config{ + HTTPServerSettings: confighttp.HTTPServerSettings{ + Endpoint: "localhost:8081", + }, + } defaultAttrsPrefix := "dap_" wantedRequestBody := wantedBody{ @@ -148,18 +158,18 @@ func TestCollectDServer(t *testing.T) { sink := new(consumertest.MetricsSink) logger := zap.NewNop() - cdr, err := newCollectdReceiver(logger, endpoint, defaultTimeout, defaultAttrsPrefix, sink, receivertest.NewNopCreateSettings()) + cdr, err := newCollectdReceiver(logger, config, defaultAttrsPrefix, sink, receivertest.NewNopCreateSettings()) if err != nil { t.Fatalf("Failed to create receiver: %v", err) } require.NoError(t, cdr.Start(context.Background(), componenttest.NewNopHost())) - defer func() { + t.Cleanup(func() { err := cdr.Shutdown(context.Background()) if err != nil { t.Fatalf("Error stopping metrics reception: %v", err) } - }() + }) time.Sleep(time.Second) @@ -168,7 +178,7 @@ func TestCollectDServer(t *testing.T) { sink.Reset() req, err := http.NewRequest( tt.HTTPMethod, - "http://"+endpoint+"?"+tt.QueryParams, + "http://"+config.HTTPServerSettings.Endpoint+"?"+tt.QueryParams, bytes.NewBuffer([]byte(tt.RequestBody)), ) require.NoError(t, err) diff --git a/receiver/hostmetricsreceiver/go.mod b/receiver/hostmetricsreceiver/go.mod index 2d181a07f031..a0488270cbde 100644 --- a/receiver/hostmetricsreceiver/go.mod +++ b/receiver/hostmetricsreceiver/go.mod @@ -8,6 +8,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.88.0 + github.com/prometheus/procfs v0.11.1 github.com/shirou/gopsutil/v3 v3.23.9 github.com/stretchr/testify v1.8.4 github.com/yusufpapurcu/wmi v1.2.3 @@ -79,7 +80,6 @@ require ( github.com/prometheus/client_golang v1.17.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.11.1 // indirect github.com/prometheus/statsd_exporter v0.22.7 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sirupsen/logrus v1.9.3 // indirect diff --git a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/cpu_scraper.go b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/cpu_scraper.go index 5507247f960f..dbd1238c717a 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/cpu_scraper.go +++ b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/cpu_scraper.go @@ -5,6 +5,7 @@ package cpuscraper // import "github.com/open-telemetry/opentelemetry-collector- import ( "context" + "fmt" "time" "github.com/shirou/gopsutil/v3/common" @@ -21,6 +22,7 @@ import ( ) const metricsLen = 2 +const hzInAMHz = 1_000_000 // scraper for CPU Metrics type scraper struct { @@ -35,6 +37,11 @@ type scraper struct { now func() time.Time } +type cpuInfo struct { + frequency float64 + processor uint +} + // newCPUScraper creates a set of CPU related metrics func newCPUScraper(_ context.Context, settings receiver.CreateSettings, cfg *Config) *scraper { return &scraper{settings: settings, config: cfg, bootTime: host.BootTimeWithContext, times: cpu.TimesWithContext, ucal: &ucal.CPUUtilizationCalculator{}, now: time.Now} @@ -79,5 +86,15 @@ func (s *scraper) scrape(ctx context.Context) (pmetric.Metrics, error) { } s.mb.RecordSystemCPULogicalCountDataPoint(now, int64(numCPU)) + if s.config.MetricsBuilderConfig.Metrics.SystemCPUFrequency.Enabled { + cpuInfos, err := s.getCPUInfo() + if err != nil { + return pmetric.NewMetrics(), scrapererror.NewPartialScrapeError(err, metricsLen) + } + for _, cInfo := range cpuInfos { + s.mb.RecordSystemCPUFrequencyDataPoint(now, cInfo.frequency*hzInAMHz, fmt.Sprintf("cpu%d", cInfo.processor)) + } + } + return s.mb.Emit(), nil } diff --git a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/cpu_scraper_linux.go b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/cpu_scraper_linux.go index ee430e2db397..99517c8ea911 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/cpu_scraper_linux.go +++ b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/cpu_scraper_linux.go @@ -7,8 +7,10 @@ package cpuscraper // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/cpuscraper" import ( + "github.com/prometheus/procfs" "github.com/shirou/gopsutil/v3/cpu" "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/receiver/scrapererror" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/ucal" @@ -35,3 +37,23 @@ func (s *scraper) recordCPUUtilization(now pcommon.Timestamp, cpuUtilization uca s.mb.RecordSystemCPUUtilizationDataPoint(now, cpuUtilization.Steal, cpuUtilization.CPU, metadata.AttributeStateSteal) s.mb.RecordSystemCPUUtilizationDataPoint(now, cpuUtilization.Iowait, cpuUtilization.CPU, metadata.AttributeStateWait) } + +func (s *scraper) getCPUInfo() ([]cpuInfo, error) { + var cpuInfos []cpuInfo + fs, err := procfs.NewDefaultFS() + if err != nil { + return nil, scrapererror.NewPartialScrapeError(err, metricsLen) + } + cInf, err := fs.CPUInfo() + if err != nil { + return nil, scrapererror.NewPartialScrapeError(err, metricsLen) + } + for _, cInfo := range cInf { + c := cpuInfo{ + frequency: cInfo.CPUMHz, + processor: cInfo.Processor, + } + cpuInfos = append(cpuInfos, c) + } + return cpuInfos, nil +} diff --git a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/cpu_scraper_others.go b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/cpu_scraper_others.go index 2c7d8d62469b..1cef0d5e5089 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/cpu_scraper_others.go +++ b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/cpu_scraper_others.go @@ -27,3 +27,8 @@ func (s *scraper) recordCPUUtilization(now pcommon.Timestamp, cpuUtilization uca s.mb.RecordSystemCPUUtilizationDataPoint(now, cpuUtilization.Idle, cpuUtilization.CPU, metadata.AttributeStateIdle) s.mb.RecordSystemCPUUtilizationDataPoint(now, cpuUtilization.Irq, cpuUtilization.CPU, metadata.AttributeStateInterrupt) } + +func (s *scraper) getCPUInfo() ([]cpuInfo, error) { + var cpuInfos []cpuInfo + return cpuInfos, nil +} diff --git a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/documentation.md b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/documentation.md index 61cec80e1b54..7fa1b7e05513 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/documentation.md +++ b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/documentation.md @@ -39,6 +39,20 @@ metrics: enabled: true ``` +### system.cpu.frequency + +Current frequency of the CPU core in Hz. + +| Unit | Metric Type | Value Type | +| ---- | ----------- | ---------- | +| Hz | Gauge | Double | + +#### Attributes + +| Name | Description | Values | +| ---- | ----------- | ------ | +| cpu | Logical CPU number starting at 0. | Any Str | + ### system.cpu.logical.count Number of available logical CPUs. diff --git a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_config.go b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_config.go index ae1e59703b16..8cea0feef5e7 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_config.go +++ b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_config.go @@ -25,6 +25,7 @@ func (ms *MetricConfig) Unmarshal(parser *confmap.Conf) error { // MetricsConfig provides config for hostmetricsreceiver/cpu metrics. type MetricsConfig struct { + SystemCPUFrequency MetricConfig `mapstructure:"system.cpu.frequency"` SystemCPULogicalCount MetricConfig `mapstructure:"system.cpu.logical.count"` SystemCPUPhysicalCount MetricConfig `mapstructure:"system.cpu.physical.count"` SystemCPUTime MetricConfig `mapstructure:"system.cpu.time"` @@ -33,6 +34,9 @@ type MetricsConfig struct { func DefaultMetricsConfig() MetricsConfig { return MetricsConfig{ + SystemCPUFrequency: MetricConfig{ + Enabled: false, + }, SystemCPULogicalCount: MetricConfig{ Enabled: false, }, diff --git a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_config_test.go b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_config_test.go index 1bd8ffc8b026..20fdd234b2de 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_config_test.go +++ b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_config_test.go @@ -26,6 +26,7 @@ func TestMetricsBuilderConfig(t *testing.T) { name: "all_set", want: MetricsBuilderConfig{ Metrics: MetricsConfig{ + SystemCPUFrequency: MetricConfig{Enabled: true}, SystemCPULogicalCount: MetricConfig{Enabled: true}, SystemCPUPhysicalCount: MetricConfig{Enabled: true}, SystemCPUTime: MetricConfig{Enabled: true}, @@ -37,6 +38,7 @@ func TestMetricsBuilderConfig(t *testing.T) { name: "none_set", want: MetricsBuilderConfig{ Metrics: MetricsConfig{ + SystemCPUFrequency: MetricConfig{Enabled: false}, SystemCPULogicalCount: MetricConfig{Enabled: false}, SystemCPUPhysicalCount: MetricConfig{Enabled: false}, SystemCPUTime: MetricConfig{Enabled: false}, diff --git a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_metrics.go b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_metrics.go index fa5eb13ebb96..d6eb80141269 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_metrics.go +++ b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_metrics.go @@ -62,6 +62,57 @@ var MapAttributeState = map[string]AttributeState{ "wait": AttributeStateWait, } +type metricSystemCPUFrequency struct { + data pmetric.Metric // data buffer for generated metric. + config MetricConfig // metric config provided by user. + capacity int // max observed number of data points added to the metric. +} + +// init fills system.cpu.frequency metric with initial data. +func (m *metricSystemCPUFrequency) init() { + m.data.SetName("system.cpu.frequency") + m.data.SetDescription("Current frequency of the CPU core in Hz.") + m.data.SetUnit("Hz") + m.data.SetEmptyGauge() + m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) +} + +func (m *metricSystemCPUFrequency) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, cpuAttributeValue string) { + if !m.config.Enabled { + return + } + dp := m.data.Gauge().DataPoints().AppendEmpty() + dp.SetStartTimestamp(start) + dp.SetTimestamp(ts) + dp.SetDoubleValue(val) + dp.Attributes().PutStr("cpu", cpuAttributeValue) +} + +// updateCapacity saves max length of data point slices that will be used for the slice capacity. +func (m *metricSystemCPUFrequency) updateCapacity() { + if m.data.Gauge().DataPoints().Len() > m.capacity { + m.capacity = m.data.Gauge().DataPoints().Len() + } +} + +// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. +func (m *metricSystemCPUFrequency) emit(metrics pmetric.MetricSlice) { + if m.config.Enabled && m.data.Gauge().DataPoints().Len() > 0 { + m.updateCapacity() + m.data.MoveTo(metrics.AppendEmpty()) + m.init() + } +} + +func newMetricSystemCPUFrequency(cfg MetricConfig) metricSystemCPUFrequency { + m := metricSystemCPUFrequency{config: cfg} + if cfg.Enabled { + m.data = pmetric.NewMetric() + m.init() + } + return m +} + type metricSystemCPULogicalCount struct { data pmetric.Metric // data buffer for generated metric. config MetricConfig // metric config provided by user. @@ -278,6 +329,7 @@ type MetricsBuilder struct { metricsCapacity int // maximum observed number of metrics per resource. metricsBuffer pmetric.Metrics // accumulates metrics data before emitting. buildInfo component.BuildInfo // contains version information. + metricSystemCPUFrequency metricSystemCPUFrequency metricSystemCPULogicalCount metricSystemCPULogicalCount metricSystemCPUPhysicalCount metricSystemCPUPhysicalCount metricSystemCPUTime metricSystemCPUTime @@ -300,6 +352,7 @@ func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSetting startTime: pcommon.NewTimestampFromTime(time.Now()), metricsBuffer: pmetric.NewMetrics(), buildInfo: settings.BuildInfo, + metricSystemCPUFrequency: newMetricSystemCPUFrequency(mbc.Metrics.SystemCPUFrequency), metricSystemCPULogicalCount: newMetricSystemCPULogicalCount(mbc.Metrics.SystemCPULogicalCount), metricSystemCPUPhysicalCount: newMetricSystemCPUPhysicalCount(mbc.Metrics.SystemCPUPhysicalCount), metricSystemCPUTime: newMetricSystemCPUTime(mbc.Metrics.SystemCPUTime), @@ -361,6 +414,7 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { ils.Scope().SetName("otelcol/hostmetricsreceiver/cpu") ils.Scope().SetVersion(mb.buildInfo.Version) ils.Metrics().EnsureCapacity(mb.metricsCapacity) + mb.metricSystemCPUFrequency.emit(ils.Metrics()) mb.metricSystemCPULogicalCount.emit(ils.Metrics()) mb.metricSystemCPUPhysicalCount.emit(ils.Metrics()) mb.metricSystemCPUTime.emit(ils.Metrics()) @@ -385,6 +439,11 @@ func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics { return metrics } +// RecordSystemCPUFrequencyDataPoint adds a data point to system.cpu.frequency metric. +func (mb *MetricsBuilder) RecordSystemCPUFrequencyDataPoint(ts pcommon.Timestamp, val float64, cpuAttributeValue string) { + mb.metricSystemCPUFrequency.recordDataPoint(mb.startTime, ts, val, cpuAttributeValue) +} + // RecordSystemCPULogicalCountDataPoint adds a data point to system.cpu.logical.count metric. func (mb *MetricsBuilder) RecordSystemCPULogicalCountDataPoint(ts pcommon.Timestamp, val int64) { mb.metricSystemCPULogicalCount.recordDataPoint(mb.startTime, ts, val) diff --git a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_metrics_test.go b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_metrics_test.go index 98749fb0e0c4..1333e19db136 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_metrics_test.go +++ b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/generated_metrics_test.go @@ -55,6 +55,9 @@ func TestMetricsBuilder(t *testing.T) { defaultMetricsCount := 0 allMetricsCount := 0 + allMetricsCount++ + mb.RecordSystemCPUFrequencyDataPoint(ts, 1, "cpu-val") + allMetricsCount++ mb.RecordSystemCPULogicalCountDataPoint(ts, 1) @@ -90,6 +93,21 @@ func TestMetricsBuilder(t *testing.T) { validatedMetrics := make(map[string]bool) for i := 0; i < ms.Len(); i++ { switch ms.At(i).Name() { + case "system.cpu.frequency": + assert.False(t, validatedMetrics["system.cpu.frequency"], "Found a duplicate in the metrics slice: system.cpu.frequency") + validatedMetrics["system.cpu.frequency"] = true + assert.Equal(t, pmetric.MetricTypeGauge, ms.At(i).Type()) + assert.Equal(t, 1, ms.At(i).Gauge().DataPoints().Len()) + assert.Equal(t, "Current frequency of the CPU core in Hz.", ms.At(i).Description()) + assert.Equal(t, "Hz", ms.At(i).Unit()) + dp := ms.At(i).Gauge().DataPoints().At(0) + assert.Equal(t, start, dp.StartTimestamp()) + assert.Equal(t, ts, dp.Timestamp()) + assert.Equal(t, pmetric.NumberDataPointValueTypeDouble, dp.ValueType()) + assert.Equal(t, float64(1), dp.DoubleValue()) + attrVal, ok := dp.Attributes().Get("cpu") + assert.True(t, ok) + assert.EqualValues(t, "cpu-val", attrVal.Str()) case "system.cpu.logical.count": assert.False(t, validatedMetrics["system.cpu.logical.count"], "Found a duplicate in the metrics slice: system.cpu.logical.count") validatedMetrics["system.cpu.logical.count"] = true diff --git a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/testdata/config.yaml b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/testdata/config.yaml index a4f7f0de3adb..2dbaa6a35373 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/testdata/config.yaml +++ b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata/testdata/config.yaml @@ -1,6 +1,8 @@ default: all_set: metrics: + system.cpu.frequency: + enabled: true system.cpu.logical.count: enabled: true system.cpu.physical.count: @@ -11,6 +13,8 @@ all_set: enabled: true none_set: metrics: + system.cpu.frequency: + enabled: false system.cpu.logical.count: enabled: false system.cpu.physical.count: diff --git a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/metadata.yaml b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/metadata.yaml index 17de7eb384a8..ad71d581a182 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/metadata.yaml +++ b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/metadata.yaml @@ -50,3 +50,11 @@ metrics: value_type: int monotonic: false aggregation_temporality: cumulative + + system.cpu.frequency: + enabled: false + description: Current frequency of the CPU core in Hz. + unit: "Hz" + gauge: + value_type: double + attributes: [cpu] \ No newline at end of file diff --git a/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go b/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go index 23fae50689af..ec0885646659 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go +++ b/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go @@ -935,6 +935,7 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) { type testCase struct { name string + skipTestCase bool muteProcessNameError bool muteProcessExeError bool muteProcessIOError bool @@ -1000,6 +1001,7 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) { }, { name: "Process User Error Muted", + skipTestCase: runtime.GOOS != "linux", muteProcessUserError: true, skipProcessNameError: true, muteProcessExeError: true, @@ -1008,6 +1010,7 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) { }, { name: "Process User Error Unmuted", + skipTestCase: runtime.GOOS != "linux", muteProcessUserError: false, skipProcessNameError: true, muteProcessExeError: true, @@ -1019,6 +1022,9 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) { for _, test := range testCases { t.Run(test.name, func(t *testing.T) { + if test.skipTestCase { + t.Skipf("skipping test %v on %v", test.name, runtime.GOOS) + } config := &Config{MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig()} if !test.omitConfigField { config.MuteProcessNameError = test.muteProcessNameError diff --git a/receiver/wavefrontreceiver/go.mod b/receiver/wavefrontreceiver/go.mod index 4be42d5ae5ab..a5c2d168183a 100644 --- a/receiver/wavefrontreceiver/go.mod +++ b/receiver/wavefrontreceiver/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver v0.88.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver v0.0.0-00010101000000-000000000000 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 go.opentelemetry.io/collector/config/confignet v0.88.1-0.20231026220224-6405e152a2d9 @@ -17,10 +17,16 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/snappy v0.0.4 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.2 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.0.1 // indirect @@ -30,10 +36,20 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rs/cors v1.10.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/config/configauth v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/config/configcompression v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/config/confighttp v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/config/configopaque v0.88.1-0.20231026220224-6405e152a2d9 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/config/configtls v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/config/internal v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/extension/auth v0.88.1-0.20231026220224-6405e152a2d9 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect diff --git a/receiver/wavefrontreceiver/go.sum b/receiver/wavefrontreceiver/go.sum index 7f44f4b6320a..98eeb3fc0e1c 100644 --- a/receiver/wavefrontreceiver/go.sum +++ b/receiver/wavefrontreceiver/go.sum @@ -13,10 +13,17 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -36,6 +43,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -50,6 +59,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= +github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -79,6 +90,8 @@ github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lne github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= +github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -96,20 +109,38 @@ go.opentelemetry.io/collector v0.88.1-0.20231026220224-6405e152a2d9 h1:UIbHSFtHl go.opentelemetry.io/collector v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:5iWdJH9WM+Bp+t3Ii72ppPmeZ0B2vci07ApE+0fRGKs= go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 h1:t9GCaQDZ1MDBjEAC1Y7NvwiqvVppK6ckAfrUEAlFioA= go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:4utKxz4Lilym3SPxNXJHosdaTjT1aQxI+TCmnJO54pU= +go.opentelemetry.io/collector/config/configauth v0.88.1-0.20231026220224-6405e152a2d9 h1:/miLBOHQlxspauNzKacbukT861aW8vgkG6DYjc6i7YA= +go.opentelemetry.io/collector/config/configauth v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:iMPoqAeGB9UScF/sugPF8xcuctlhx8jFK2jAmzDn/1E= +go.opentelemetry.io/collector/config/configcompression v0.88.1-0.20231026220224-6405e152a2d9 h1:5cqU6jeFGjqSrL5RsDSxrQe7vTIICeyoxATY1J4mUvc= +go.opentelemetry.io/collector/config/configcompression v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:LaavoxZsro5lL7qh1g9DMifG0qixWPEecW18Qr8bpag= +go.opentelemetry.io/collector/config/confighttp v0.88.1-0.20231026220224-6405e152a2d9 h1:jEEupxkBYPlKo4uA/9s7mrN9d2iZQ5hTPIQpOelxaiw= +go.opentelemetry.io/collector/config/confighttp v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:bmzLcdPexlRvI7a+56eGqZOWhMYAMf+F0h+HLzrpv6w= go.opentelemetry.io/collector/config/confignet v0.88.1-0.20231026220224-6405e152a2d9 h1:NPTJUR2N2d0XfRgkuxLJk3TzoaIaeXsC6eynZXDkC9w= go.opentelemetry.io/collector/config/confignet v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:cpO8JYWGONaViOygKVw+Hd2UoBcn2cUiyi0WWeFTwJY= +go.opentelemetry.io/collector/config/configopaque v0.88.1-0.20231026220224-6405e152a2d9 h1:YwkklGD3FSAp9QAmkFwzjRLxYKdTGp61s0ZuIpFQSyM= +go.opentelemetry.io/collector/config/configopaque v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:TPCHaU+QXiEV+JXbgyr6mSErTI9chwQyasDVMdJr3eY= go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 h1:4WPy3qE1lJE1LZE7t1kAj1XSZN85w68JknZO5Uo00vw= go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= +go.opentelemetry.io/collector/config/configtls v0.88.1-0.20231026220224-6405e152a2d9 h1:Ez4mdgLXvdusZGu7I4+X2hiXCQP69aAB0LWERwosJmE= +go.opentelemetry.io/collector/config/configtls v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:i8X3Zj6ICyTbtIOZrDzgXFkFVGKjFtM6/82SMOXbYHc= +go.opentelemetry.io/collector/config/internal v0.88.1-0.20231026220224-6405e152a2d9 h1:11WTkBuGy3QCRXQA6oy9ZJn+wBSEfZ7USnKVTPy9yCY= +go.opentelemetry.io/collector/config/internal v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:42VsQ/1kP2qnvzjNi+dfNP+KyCFRADejyrJ8m2GVL3M= go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 h1:JKFChlNpigR1Q4hZUjDU2sB2VuQ+RigAh7oOQfdcaiQ= go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:CSJlMk1KRZloXAygpiPeCLpuQiLVDEZYbGsGHIKHeUg= go.opentelemetry.io/collector/consumer v0.88.1-0.20231026220224-6405e152a2d9 h1:xiosDLoF99krBlBdiZvw22CSCYU0picQMKskzjaIU8I= go.opentelemetry.io/collector/consumer v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:VVoafgyhjpO6fuJu12GqspmuLrn91JCOou0sOtb9GOg= +go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 h1:6lnGLRgbuTQR7sR1xRqTfJMX2UNkOKbqVAwJDzobvGY= +go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:5wPlOyWtVJcZS9CMhFUnuRvNQ0XIoV/iUSaZWtCjoHA= +go.opentelemetry.io/collector/extension/auth v0.88.1-0.20231026220224-6405e152a2d9 h1:YFN6/C9HLfY/k0OyHUdF7jInwBZT+C9O9FNfQTxNHoY= +go.opentelemetry.io/collector/extension/auth v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:IcwiPhj6ZGTaZ7WVRVvl97uyw9NShsVqcTRLtXddpK0= go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:luvDPu+FNy6LIylBOO8PH/ca6ym7JKAdMe1J1aJbsF4= go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:TVYPzf0ZwFDTSoQ6gPk4lpQgVK4g43cWYuo710E0RHI= go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:Rv9fOclA5AtM/JGm0d4jBOIAo1+jBA13UT5Bx0ovXi4= go.opentelemetry.io/collector/receiver v0.88.1-0.20231026220224-6405e152a2d9 h1:h+1btMM+rRpZsCnR2vFmvmczeQxKhVwEohV8urOvZho= go.opentelemetry.io/collector/receiver v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:3lhOi7CWMwiiolm6d579ZX+pIVwKPCRP+7ScontYOuI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA=