diff --git a/.chloggen/googlecloudmonitoringreceiver-phase1.yaml b/.chloggen/googlecloudmonitoringreceiver-phase1.yaml new file mode 100644 index 000000000000..7ff44bde4ffc --- /dev/null +++ b/.chloggen/googlecloudmonitoringreceiver-phase1.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: new_component + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: googlecloudmonitoringreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Adding new component - [Google Cloud monitoring](https://cloud.google.com/monitoring/api/metrics_gcp) receiver to fetch GCP Cloud Metrics and transform to OpenTelemetry compatible format. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [33762] + +# (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/.github/CODEOWNERS b/.github/CODEOWNERS index d6143e82ddcd..835fcbd7c2cc 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -296,6 +296,7 @@ receiver/windowseventlogreceiver/ @open-teleme receiver/windowsperfcountersreceiver/ @open-telemetry/collector-contrib-approvers @dashpole @alxbl @pjanotti receiver/zipkinreceiver/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy @andrzej-stencel @crobert-1 receiver/zookeeperreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski +receiver/googlecloudmonitoringreceiver/ @open-telemetry/collector-contrib-approvers @dashpole @TylerHelmuth @abhishek-at-cloudwerx testbed/ @open-telemetry/collector-contrib-approvers @open-telemetry/collector-approvers testbed/mockdatasenders/mockdatadogagentexporter/ @open-telemetry/collector-contrib-approvers @boostchicken diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 3124015ddeaf..9ac87c55285c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -228,6 +228,7 @@ body: - receiver/flinkmetrics - receiver/fluentforward - receiver/gitprovider + - receiver/googlecloudmonitoring - receiver/googlecloudpubsub - receiver/googlecloudspanner - receiver/haproxy diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index b270c4419cb0..e2e683c9b6a0 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -222,6 +222,7 @@ body: - receiver/flinkmetrics - receiver/fluentforward - receiver/gitprovider + - receiver/googlecloudmonitoring - receiver/googlecloudpubsub - receiver/googlecloudspanner - receiver/haproxy diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml index d540aac44fdc..2757c42b3246 100644 --- a/.github/ISSUE_TEMPLATE/other.yaml +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -222,6 +222,7 @@ body: - receiver/flinkmetrics - receiver/fluentforward - receiver/gitprovider + - receiver/googlecloudmonitoring - receiver/googlecloudpubsub - receiver/googlecloudspanner - receiver/haproxy diff --git a/.github/ISSUE_TEMPLATE/unmaintained.yaml b/.github/ISSUE_TEMPLATE/unmaintained.yaml index 64a7f243ebe1..c1c31f614b07 100644 --- a/.github/ISSUE_TEMPLATE/unmaintained.yaml +++ b/.github/ISSUE_TEMPLATE/unmaintained.yaml @@ -227,6 +227,7 @@ body: - receiver/flinkmetrics - receiver/fluentforward - receiver/gitprovider + - receiver/googlecloudmonitoring - receiver/googlecloudpubsub - receiver/googlecloudspanner - receiver/haproxy diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index bf920ff0fb96..298c7c32e700 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -4,7 +4,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/otelcontrib go 1.21.0 -toolchain go1.21.12 +toolchain go1.22.4 require ( github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provider/s3provider v0.106.1 diff --git a/cmd/oteltestbedcol/go.mod b/cmd/oteltestbedcol/go.mod index c28b2acd8e1f..1c1c1561da70 100644 --- a/cmd/oteltestbedcol/go.mod +++ b/cmd/oteltestbedcol/go.mod @@ -4,7 +4,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/oteltestbed go 1.21.0 -toolchain go1.21.12 +toolchain go1.22.4 require ( github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter v0.106.1 diff --git a/receiver/googlecloudmonitoringreceiver/Makefile b/receiver/googlecloudmonitoringreceiver/Makefile new file mode 100644 index 000000000000..c1496226e590 --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common \ No newline at end of file diff --git a/receiver/googlecloudmonitoringreceiver/README.md b/receiver/googlecloudmonitoringreceiver/README.md new file mode 100644 index 000000000000..3aa5512536e4 --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/README.md @@ -0,0 +1,58 @@ +# Google Cloud Monitoring Receiver + + +| Status | | +| ------------- |-----------| +| Stability | [development]: metrics | +| Distributions | [contrib] | +| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fgooglecloudmonitoring%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fgooglecloudmonitoring) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fgooglecloudmonitoring%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fgooglecloudmonitoring) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dashpole](https://www.github.com/dashpole), [@TylerHelmuth](https://www.github.com/TylerHelmuth), [@abhishek-at-cloudwerx](https://www.github.com/abhishek-at-cloudwerx) | + +[development]: https://github.com/open-telemetry/opentelemetry-collector#development +[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib + + +The primary objective of the Google Cloud Monitoring Receiver is to gather time series metrics data from all Google services and convert this data into a pipeline format that facilitates further use. + +This receiver gets GCP (Google Clout Platform) metrics from [GCP Monitoring REST API] via the [Google SDK for GCP Metrics] and then convert those timeseries data into OTel Format [Pipeline Data]. + +[GCP Monitoring REST API]: https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list +[Google SDK for GCP Metrics]: https://pkg.go.dev/cloud.google.com/go/monitoring/apiv3 +[Pipeline Data]: https://pkg.go.dev/go.opentelemetry.io/collector/pdata + +## Configuration +The following configuration options are supported: + +```yaml +receivers: + googlecloudmonitoring: + collection_interval: 120s + region: us-central1 + project_id: my-project-id + service_account_key: "path/to/service_account.json" + services: + - service_name: "compute" + metric_name: "compute.googleapis.com/instance/cpu/usage_time" + delay: 60s + - service_name: "connectors" + metric_name: "connectors.googleapis.com/flex/instance/cpu/usage_time" + delay: 60s +``` + +- `collection_interval` (Optional): The interval at which metrics are collected. Default is 60s. +- `region` (Required): The GCP region where the services are located. +- `project_id` (Required): The GCP project ID. +- `service_account_key` (Required): The path to the service account key JSON file. +- `services` (Required): A list of services to monitor. + +Each service can have the following configuration: + +- `service_name` (Required): The name of the GCP service (e.g., `compute`). +- `delay` (Optional): The delay before starting the collection of metrics for this service. Default is 0s. +- `metric_name` (Optional): The specific metric name to collect. If not set, all metrics are collected. + +### Filtering + +**Metrics Parameters** : + +- A monitoring filter that specifies which time series should be returned. The filter must specify a single metric type. For example: `metric_name: "compute.googleapis.com/instance/cpu/usage_time"` diff --git a/receiver/googlecloudmonitoringreceiver/config.go b/receiver/googlecloudmonitoringreceiver/config.go new file mode 100644 index 000000000000..02ae2fb55c8c --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/config.go @@ -0,0 +1,59 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package googlecloudmonitoringreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudmonitoringreceiver" + +import ( + "errors" + "fmt" + "time" + + "go.opentelemetry.io/collector/receiver/scraperhelper" +) + +const minCollectionIntervalSeconds = 60 + +type Config struct { + scraperhelper.ControllerConfig `mapstructure:",squash"` + + Region string `mapstructure:"region"` + ProjectID string `mapstructure:"project_id"` + ServiceAccountKey string `mapstructure:"service_account_key"` + Services []Service `mapstructure:"services"` +} + +type Service struct { + ServiceName string `mapstructure:"service_name"` + MetricName string `mapstructure:"metric_name"` + Delay time.Duration `mapstructure:"delay"` +} + +func (config *Config) Validate() error { + if config.CollectionInterval.Seconds() < minCollectionIntervalSeconds { + return fmt.Errorf("\"collection_interval\" must be not lower than %v seconds, current value is %v seconds", minCollectionIntervalSeconds, config.CollectionInterval.Seconds()) + } + + if len(config.Services) == 0 { + return errors.New("missing required field \"services\" or its value is empty") + } + + for _, service := range config.Services { + if err := service.Validate(); err != nil { + return err + } + } + + return nil +} + +func (service Service) Validate() error { + if service.ServiceName == "" { + return errors.New("field \"service_name\" is required and cannot be empty for service configuration") + } + + if service.Delay < 0 { + return errors.New("field \"delay\" cannot be negative for service configuration") + } + + return nil +} diff --git a/receiver/googlecloudmonitoringreceiver/config_test.go b/receiver/googlecloudmonitoringreceiver/config_test.go new file mode 100644 index 000000000000..10a87c7fdabd --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/config_test.go @@ -0,0 +1,124 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package googlecloudmonitoringreceiver + +import ( + "path/filepath" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/receiver/scraperhelper" + + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudmonitoringreceiver/internal/metadata" +) + +func TestLoadConfig(t *testing.T) { + cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml")) + require.NoError(t, err) + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + + sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String()) + require.NoError(t, err) + require.NoError(t, sub.Unmarshal(cfg)) + + assert.Equal(t, + &Config{ + ControllerConfig: scraperhelper.ControllerConfig{ + CollectionInterval: 120 * time.Second, + InitialDelay: 1 * time.Second, + }, + Region: "us-central1", + ProjectID: "my-project-id", + ServiceAccountKey: "path/to/service_account.json", + Services: []Service{ + { + ServiceName: "compute", + Delay: 60 * time.Second, + MetricName: "compute.googleapis.com/instance/cpu/usage_time", + }, + { + ServiceName: "connectors", + Delay: 60 * time.Second, + MetricName: "connectors.googleapis.com/flex/instance/cpu/usage_time", + }, + }, + }, + cfg, + ) +} + +func TestValidateService(t *testing.T) { + testCases := map[string]struct { + service Service + requireError bool + }{ + "Valid Service": { + Service{ + ServiceName: "service_name", + Delay: 0, + }, false}, + "Empty ServiceName": { + Service{ + ServiceName: "", + Delay: 0, + }, true}, + "Negative Delay": { + Service{ + ServiceName: "service_name", + Delay: -1, + }, true}, + } + + for name, testCase := range testCases { + t.Run(name, func(t *testing.T) { + err := testCase.service.Validate() + if testCase.requireError { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestValidateConfig(t *testing.T) { + validService := Service{ + ServiceName: "service_name", + Delay: 0 * time.Second, + } + + testCases := map[string]struct { + services []Service + collectionInterval time.Duration + requireError bool + }{ + "Valid Config": {[]Service{validService}, 60 * time.Second, false}, + "Empty Services": {nil, 60 * time.Second, true}, + "Invalid Service in Services": {[]Service{{}}, 60 * time.Second, true}, + "Invalid Collection Interval": {[]Service{validService}, 0 * time.Second, true}, + } + + for name, testCase := range testCases { + t.Run(name, func(t *testing.T) { + cfg := &Config{ + ControllerConfig: scraperhelper.ControllerConfig{ + CollectionInterval: testCase.collectionInterval, + }, + Services: testCase.services, + } + + err := cfg.Validate() + if testCase.requireError { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/receiver/googlecloudmonitoringreceiver/doc.go b/receiver/googlecloudmonitoringreceiver/doc.go new file mode 100644 index 000000000000..9636dda89101 --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/doc.go @@ -0,0 +1,6 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +//go:generate mdatagen metadata.yaml + +package googlecloudmonitoringreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudmonitoringreceiver" diff --git a/receiver/googlecloudmonitoringreceiver/factory.go b/receiver/googlecloudmonitoringreceiver/factory.go new file mode 100644 index 000000000000..3b6a923ad71a --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/factory.go @@ -0,0 +1,49 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package googlecloudmonitoringreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudmonitoringreceiver" + +import ( + "context" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/scraperhelper" + + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudmonitoringreceiver/internal/metadata" +) + +func NewFactory() receiver.Factory { + return receiver.NewFactory( + metadata.Type, + createDefaultConfig, + receiver.WithMetrics(createMetricsReceiver, metadata.MetricsStability)) +} + +// createDefaultConfig creates the default exporter configuration +func createDefaultConfig() component.Config { + return &Config{ + ControllerConfig: scraperhelper.NewDefaultControllerConfig(), + } +} + +func createMetricsReceiver( + _ context.Context, + settings receiver.Settings, + baseCfg component.Config, + consumer consumer.Metrics, +) (receiver.Metrics, error) { + + rCfg := baseCfg.(*Config) + r := newGoogleCloudMonitoringReceiver(rCfg, settings.Logger) + + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), r.Scrape, scraperhelper.WithStart(r.Start), + scraperhelper.WithShutdown(r.Shutdown)) + if err != nil { + return nil, err + } + + return scraperhelper.NewScraperControllerReceiver(&rCfg.ControllerConfig, settings, consumer, + scraperhelper.AddScraper(scraper)) +} diff --git a/receiver/googlecloudmonitoringreceiver/generated_component_test.go b/receiver/googlecloudmonitoringreceiver/generated_component_test.go new file mode 100644 index 000000000000..bc599fefe415 --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/generated_component_test.go @@ -0,0 +1,69 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package googlecloudmonitoringreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentFactoryType(t *testing.T) { + require.Equal(t, "googlecloudmonitoring", NewFactory().Type().String()) +} + +func TestComponentConfigStruct(t *testing.T) { + require.NoError(t, componenttest.CheckConfigStruct(NewFactory().CreateDefaultConfig())) +} + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, sub.Unmarshal(&cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/googlecloudmonitoringreceiver/generated_package_test.go b/receiver/googlecloudmonitoringreceiver/generated_package_test.go new file mode 100644 index 000000000000..3019661bfd33 --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/generated_package_test.go @@ -0,0 +1,13 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package googlecloudmonitoringreceiver + +import ( + "os" + "testing" +) + +func TestMain(m *testing.M) { + // skipping goleak test as per metadata.yml configuration + os.Exit(m.Run()) +} diff --git a/receiver/googlecloudmonitoringreceiver/go.mod b/receiver/googlecloudmonitoringreceiver/go.mod new file mode 100644 index 000000000000..21bb30509c5c --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/go.mod @@ -0,0 +1,59 @@ +module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudmonitoringreceiver + +go 1.21.3 + +require ( + github.com/stretchr/testify v1.9.0 + go.opentelemetry.io/collector/component v0.104.1-0.20240709093154-e7ce1d50fb5e + go.opentelemetry.io/collector/confmap v0.104.1-0.20240709093154-e7ce1d50fb5e + go.opentelemetry.io/collector/consumer v0.104.1-0.20240709093154-e7ce1d50fb5e + go.opentelemetry.io/collector/pdata v1.11.1-0.20240709093154-e7ce1d50fb5e + go.opentelemetry.io/collector/receiver v0.104.0 + go.uber.org/zap v1.27.0 +) + +require google.golang.org/protobuf v1.34.2 // indirect + +require ( + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect + github.com/json-iterator/go v1.1.12 // 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.1.1 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.19.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + go.opentelemetry.io/collector v0.104.1-0.20240709093154-e7ce1d50fb5e // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.104.1-0.20240709093154-e7ce1d50fb5e // indirect + go.opentelemetry.io/collector/featuregate v1.11.1-0.20240709093154-e7ce1d50fb5e // indirect + go.opentelemetry.io/collector/internal/featuregates v0.0.0-20240705161705-b127da089038 // indirect + go.opentelemetry.io/otel v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.50.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/sdk v1.28.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/net v0.27.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/grpc v1.65.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/receiver/googlecloudmonitoringreceiver/go.sum b/receiver/googlecloudmonitoringreceiver/go.sum new file mode 100644 index 000000000000..2c61da0159cc --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/go.sum @@ -0,0 +1,148 @@ +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +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/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +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/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= +github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= +github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= +github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/collector v0.104.1-0.20240709093154-e7ce1d50fb5e h1:/hai7gwBOn554YYd3akgdlNpnnaMKf6mGLFxOqYdYSQ= +go.opentelemetry.io/collector v0.104.1-0.20240709093154-e7ce1d50fb5e/go.mod h1:dEn7vf0kKbXaAz8JyP5PvZrBpP4hJDyKaQJcz1iALes= +go.opentelemetry.io/collector/component v0.104.1-0.20240709093154-e7ce1d50fb5e h1:tDDX89XAniXsT+qXhp944GJZMvmO+VdfzDy75HQyyi8= +go.opentelemetry.io/collector/component v0.104.1-0.20240709093154-e7ce1d50fb5e/go.mod h1:wNSXz6AG8zbQAtg/xv64lu6D6QH7CZjLOOlvaTvZur8= +go.opentelemetry.io/collector/config/configtelemetry v0.104.1-0.20240709093154-e7ce1d50fb5e h1:wdiEfdMDRcyfbu5+1K6w3wXlh8t9a9lTuhWE+ff/FB8= +go.opentelemetry.io/collector/config/configtelemetry v0.104.1-0.20240709093154-e7ce1d50fb5e/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= +go.opentelemetry.io/collector/confmap v0.104.1-0.20240709093154-e7ce1d50fb5e h1:GnNWi+3+x0Gw6sboUO0LT9xls8Y/hSCUgPHN/u3pBeg= +go.opentelemetry.io/collector/confmap v0.104.1-0.20240709093154-e7ce1d50fb5e/go.mod h1:wmKSXPfOatdKyqVi0L/OaJsH2isw7NzPqYpGbtkaZIY= +go.opentelemetry.io/collector/consumer v0.104.1-0.20240709093154-e7ce1d50fb5e h1:WsemnOTwUXfd1Vej7btVuBN4k1D9r55Y1KNJbUEL/y4= +go.opentelemetry.io/collector/consumer v0.104.1-0.20240709093154-e7ce1d50fb5e/go.mod h1:Q+JdSWmE9N9sBo7PS7mSsSdc91z82kGrJDGLNNKrGys= +go.opentelemetry.io/collector/featuregate v1.11.1-0.20240709093154-e7ce1d50fb5e h1:w8LTeE34P13kjznyjvdF6WoxtXJORV9DA59EJfxFO8A= +go.opentelemetry.io/collector/featuregate v1.11.1-0.20240709093154-e7ce1d50fb5e/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= +go.opentelemetry.io/collector/internal/featuregates v0.0.0-20240705161705-b127da089038 h1:gQ4Fncp80vh+WvGgRQEmQmibdg7rRGWH/EWf1YIrrUQ= +go.opentelemetry.io/collector/internal/featuregates v0.0.0-20240705161705-b127da089038/go.mod h1:lC66DIONH2+irSDc+lVazcyCvLNlW+K5IWI/TdmZtPI= +go.opentelemetry.io/collector/pdata v1.11.1-0.20240709093154-e7ce1d50fb5e h1:hn4O6kuZNIWD05YqL8lemL5gdbFoYqeiIRoPzLMC3d8= +go.opentelemetry.io/collector/pdata v1.11.1-0.20240709093154-e7ce1d50fb5e/go.mod h1:MYeB0MmMAxeM0hstCFrCqWLzdyeYySim2dG6pDT6nYI= +go.opentelemetry.io/collector/pdata/pprofile v0.104.0 h1:MYOIHvPlKEJbWLiBKFQWGD0xd2u22xGVLt4jPbdxP4Y= +go.opentelemetry.io/collector/pdata/pprofile v0.104.0/go.mod h1:7WpyHk2wJZRx70CGkBio8klrYTTXASbyIhf+rH4FKnA= +go.opentelemetry.io/collector/pdata/testdata v0.104.0 h1:BKTZ7hIyAX5DMPecrXkVB2e86HwWtJyOlXn/5vSVXNw= +go.opentelemetry.io/collector/pdata/testdata v0.104.0/go.mod h1:3SnYKu8gLfxURJMWS/cFEUFs+jEKS6jvfqKXnOZsdkQ= +go.opentelemetry.io/collector/receiver v0.104.0 h1:URL1ExkYYd+qbndm7CdGvI2mxzsv/pNfmwJ+1QSQ9/o= +go.opentelemetry.io/collector/receiver v0.104.0/go.mod h1:+enTCZQLf6dRRANWvykXEzrlRw2JDppXJtoYWd/Dd54= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/exporters/prometheus v0.50.0 h1:2Ewsda6hejmbhGFyUvWZjUThC98Cf8Zy6g0zkIimOng= +go.opentelemetry.io/otel/exporters/prometheus v0.50.0/go.mod h1:pMm5PkUo5YwbLiuEf7t2xg4wbP0/eSJrMxIMxKosynY= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= +go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/receiver/googlecloudmonitoringreceiver/internal/metadata/generated_status.go b/receiver/googlecloudmonitoringreceiver/internal/metadata/generated_status.go new file mode 100644 index 000000000000..d1dfe66bd6a6 --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/internal/metadata/generated_status.go @@ -0,0 +1,15 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package metadata + +import ( + "go.opentelemetry.io/collector/component" +) + +var ( + Type = component.MustNewType("googlecloudmonitoring") +) + +const ( + MetricsStability = component.StabilityLevelDevelopment +) diff --git a/receiver/googlecloudmonitoringreceiver/metadata.yaml b/receiver/googlecloudmonitoringreceiver/metadata.yaml new file mode 100644 index 000000000000..4ae0478b3839 --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/metadata.yaml @@ -0,0 +1,15 @@ +type: googlecloudmonitoring +scope_name: otelcol/googlecloudmonitoringreceiver + +status: + class: receiver + stability: + development: [metrics] + distributions: [contrib] + codeowners: + active: [dashpole, TylerHelmuth, abhishek-at-cloudwerx] + +tests: + config: + goleak: + skip: true diff --git a/receiver/googlecloudmonitoringreceiver/receiver.go b/receiver/googlecloudmonitoringreceiver/receiver.go new file mode 100644 index 000000000000..7d407c1a50c8 --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/receiver.go @@ -0,0 +1,52 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package googlecloudmonitoringreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudmonitoringreceiver" + +import ( + "context" + + "go.uber.org/zap" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pdata/pmetric" +) + +type monitoringReceiver struct { + config *Config + logger *zap.Logger + cancel context.CancelFunc +} + +func newGoogleCloudMonitoringReceiver(cfg *Config, logger *zap.Logger) *monitoringReceiver { + return &monitoringReceiver{ + config: cfg, + logger: logger, + } +} + +func (m *monitoringReceiver) Scrape(ctx context.Context) (pmetric.Metrics, error) { + metrics := pmetric.NewMetrics() + m.logger.Debug("Scrape metrics ") + + return metrics, nil +} + +func (m *monitoringReceiver) Start(ctx context.Context, _ component.Host) error { + ctx, m.cancel = context.WithCancel(ctx) + err := m.initialize(ctx) + if err != nil { + return err + } + return nil +} + +func (m *monitoringReceiver) Shutdown(context.Context) error { + m.logger.Debug("shutting down googlecloudmonitoringreceiver receiver") + return nil +} + +func (m *monitoringReceiver) initialize(ctx context.Context) error { + // Implement the logic for handling metrics here. + return nil +} diff --git a/receiver/googlecloudmonitoringreceiver/testdata/config.yaml b/receiver/googlecloudmonitoringreceiver/testdata/config.yaml new file mode 100644 index 000000000000..e828b066b5d2 --- /dev/null +++ b/receiver/googlecloudmonitoringreceiver/testdata/config.yaml @@ -0,0 +1,12 @@ +googlecloudmonitoring: + collection_interval: 120s + region: us-central1 + project_id: my-project-id + service_account_key: "path/to/service_account.json" + services: + - service_name: "compute" + delay: 60s # Second + metric_name: "compute.googleapis.com/instance/cpu/usage_time" + - service_name: "connectors" + delay: 60s # Second + metric_name: "connectors.googleapis.com/flex/instance/cpu/usage_time" diff --git a/versions.yaml b/versions.yaml index 2ce962920448..f757442adf08 100644 --- a/versions.yaml +++ b/versions.yaml @@ -211,6 +211,7 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/flinkmetricsreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver + - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudmonitoringreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudpubsubreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudspannerreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver