diff --git a/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/linux-gpu/error b/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/linux-gpu/error index c66532e09f..3cc5e56814 100644 --- a/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/linux-gpu/error +++ b/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/linux-gpu/error @@ -1,7 +1,6 @@ -[15:1] unknown field "logs" - 12 | # See the License for the specific language governing permissions and +[16:13] value is not allowed in this context 13 | # limitations under the License. 14 | -> 15 | logs: - ^ - 16 | files: "b"c \ No newline at end of file + 15 | logs: +> 16 | files: "b"c + ^ diff --git a/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/linux/error b/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/linux/error index c66532e09f..3cc5e56814 100644 --- a/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/linux/error +++ b/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/linux/error @@ -1,7 +1,6 @@ -[15:1] unknown field "logs" - 12 | # See the License for the specific language governing permissions and +[16:13] value is not allowed in this context 13 | # limitations under the License. 14 | -> 15 | logs: - ^ - 16 | files: "b"c \ No newline at end of file + 15 | logs: +> 16 | files: "b"c + ^ diff --git a/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/windows-2012/error b/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/windows-2012/error index c66532e09f..3cc5e56814 100644 --- a/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/windows-2012/error +++ b/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/windows-2012/error @@ -1,7 +1,6 @@ -[15:1] unknown field "logs" - 12 | # See the License for the specific language governing permissions and +[16:13] value is not allowed in this context 13 | # limitations under the License. 14 | -> 15 | logs: - ^ - 16 | files: "b"c \ No newline at end of file + 15 | logs: +> 16 | files: "b"c + ^ diff --git a/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/windows/error b/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/windows/error index c66532e09f..3cc5e56814 100644 --- a/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/windows/error +++ b/confgenerator/testdata/goldens/invalid-all-not_in_yaml_format/golden/windows/error @@ -1,7 +1,6 @@ -[15:1] unknown field "logs" - 12 | # See the License for the specific language governing permissions and +[16:13] value is not allowed in this context 13 | # limitations under the License. 14 | -> 15 | logs: - ^ - 16 | files: "b"c \ No newline at end of file + 15 | logs: +> 16 | files: "b"c + ^ diff --git a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/linux-gpu/error b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/linux-gpu/error index e1e35dd203..58338cd39b 100644 --- a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/linux-gpu/error +++ b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/linux-gpu/error @@ -4,6 +4,6 @@ 19 | collection_interval: 60s > 20 | endpoint: tcp://localhost:8080 ^ - 22 | - 23 | service: - 24 | pipelines: \ No newline at end of file + 22 | service: + 23 | pipelines: + 24 | elasticsearch: \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/linux/error b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/linux/error index e1e35dd203..58338cd39b 100644 --- a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/linux/error +++ b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/linux/error @@ -4,6 +4,6 @@ 19 | collection_interval: 60s > 20 | endpoint: tcp://localhost:8080 ^ - 22 | - 23 | service: - 24 | pipelines: \ No newline at end of file + 22 | service: + 23 | pipelines: + 24 | elasticsearch: \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/windows-2012/error b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/windows-2012/error index e1e35dd203..58338cd39b 100644 --- a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/windows-2012/error +++ b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/windows-2012/error @@ -4,6 +4,6 @@ 19 | collection_interval: 60s > 20 | endpoint: tcp://localhost:8080 ^ - 22 | - 23 | service: - 24 | pipelines: \ No newline at end of file + 22 | service: + 23 | pipelines: + 24 | elasticsearch: \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/windows/error b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/windows/error index e1e35dd203..58338cd39b 100644 --- a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/windows/error +++ b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_bad_scheme/golden/windows/error @@ -4,6 +4,6 @@ 19 | collection_interval: 60s > 20 | endpoint: tcp://localhost:8080 ^ - 22 | - 23 | service: - 24 | pipelines: \ No newline at end of file + 22 | service: + 23 | pipelines: + 24 | elasticsearch: \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/linux-gpu/error b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/linux-gpu/error index 060a1319a9..0199267a36 100644 --- a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/linux-gpu/error +++ b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/linux-gpu/error @@ -4,6 +4,6 @@ 19 | collection_interval: 60s > 20 | endpoint: localhost:8080 ^ - 22 | - 23 | service: - 24 | pipelines: \ No newline at end of file + 22 | service: + 23 | pipelines: + 24 | elasticsearch: \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/linux/error b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/linux/error index 060a1319a9..0199267a36 100644 --- a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/linux/error +++ b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/linux/error @@ -4,6 +4,6 @@ 19 | collection_interval: 60s > 20 | endpoint: localhost:8080 ^ - 22 | - 23 | service: - 24 | pipelines: \ No newline at end of file + 22 | service: + 23 | pipelines: + 24 | elasticsearch: \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/windows-2012/error b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/windows-2012/error index 060a1319a9..0199267a36 100644 --- a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/windows-2012/error +++ b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/windows-2012/error @@ -4,6 +4,6 @@ 19 | collection_interval: 60s > 20 | endpoint: localhost:8080 ^ - 22 | - 23 | service: - 24 | pipelines: \ No newline at end of file + 22 | service: + 23 | pipelines: + 24 | elasticsearch: \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/windows/error b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/windows/error index 060a1319a9..0199267a36 100644 --- a/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/windows/error +++ b/confgenerator/testdata/goldens/invalid-metrics-receiver_elasticsearch_host_port/golden/windows/error @@ -4,6 +4,6 @@ 19 | collection_interval: 60s > 20 | endpoint: localhost:8080 ^ - 22 | - 23 | service: - 24 | pipelines: \ No newline at end of file + 22 | service: + 23 | pipelines: + 24 | elasticsearch: \ No newline at end of file diff --git a/go.mod b/go.mod index b072082805..cc1e0ae2c0 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/blang/semver v3.5.1+incompatible github.com/cenkalti/backoff/v4 v4.3.0 github.com/go-playground/validator/v10 v10.11.1 - github.com/goccy/go-yaml v1.11.2 + github.com/goccy/go-yaml v1.14.1 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 github.com/googleapis/gax-go/v2 v2.13.0 diff --git a/go.sum b/go.sum index b759dbabd3..c13ae02939 100644 --- a/go.sum +++ b/go.sum @@ -210,6 +210,8 @@ github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/goccy/go-yaml v1.11.2 h1:joq77SxuyIs9zzxEjgyLBugMQ9NEgTWxXfz2wVqwAaQ= github.com/goccy/go-yaml v1.11.2/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU= +github.com/goccy/go-yaml v1.14.1 h1:NJ9Ch49K/WichY7pAtSvIJbvGjmBDjHVQxuWBbPSOPg= +github.com/goccy/go-yaml v1.14.1/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= diff --git a/integration_test/metadata/integration_metadata.go b/integration_test/metadata/integration_metadata.go index 8d349999bd..7e6b0fb196 100644 --- a/integration_test/metadata/integration_metadata.go +++ b/integration_test/metadata/integration_metadata.go @@ -155,7 +155,7 @@ func UnmarshalAndValidate(fullPath string, data []byte, i interface{}) error { v := NewIntegrationMetadataValidator() // Note: Unmarshaler does not protect when only the key being declared. // https://github.com/goccy/go-yaml/issues/313 - if err := yaml.UnmarshalWithOptions(data, i, yaml.DisallowUnknownField(), yaml.DisallowDuplicateKey(), yaml.Validator(v)); err != nil { + if err := yaml.UnmarshalWithOptions(data, i, yaml.DisallowUnknownField(), yaml.Validator(v)); err != nil { return fmt.Errorf("%s%w", fullPath, err) } return nil diff --git a/tasks.mak b/tasks.mak index 562b2b00ff..c03924fa95 100644 --- a/tasks.mak +++ b/tasks.mak @@ -39,6 +39,9 @@ build: mkdir -p /tmp/google-cloud-ops-agent DOCKER_BUILDKIT=1 docker build -o /tmp/google-cloud-ops-agent . $(ARGS) +.PHONY: rebuild_submodules +rebuild_submodules: fluent_bit_local otelopscol_local + .PHONY: fluent_bit_local fluent_bit_local: bash ./builds/fluent_bit.sh $(PWD)/dist diff --git a/transformation_test/testdata/ops_agent_test-TestLogEntrySpecialFields/output_otel.yaml b/transformation_test/testdata/ops_agent_test-TestLogEntrySpecialFields/output_otel.yaml index fdba6f2e8a..d1fa37cb40 100644 --- a/transformation_test/testdata/ops_agent_test-TestLogEntrySpecialFields/output_otel.yaml +++ b/transformation_test/testdata/ops_agent_test-TestLogEntrySpecialFields/output_otel.yaml @@ -6,42 +6,42 @@ rejected_items: 1.0 stacktrace: |- go.opentelemetry.io/collector/exporter/exporterhelper/internal.(*BaseExporter).Send - go.opentelemetry.io/collector/exporter@v0.112.0/exporterhelper/internal/base_exporter.go:130 + go.opentelemetry.io/collector/exporter@v0.112.0/exporterhelper/internal/base_exporter.go:130 go.opentelemetry.io/collector/exporter/exporterhelper.NewLogsRequest.func1 - go.opentelemetry.io/collector/exporter@v0.112.0/exporterhelper/logs.go:138 + go.opentelemetry.io/collector/exporter@v0.112.0/exporterhelper/logs.go:138 go.opentelemetry.io/collector/consumer.ConsumeLogsFunc.ConsumeLogs - go.opentelemetry.io/collector/consumer@v0.112.0/logs.go:26 + go.opentelemetry.io/collector/consumer@v0.112.0/logs.go:26 go.opentelemetry.io/collector/internal/fanoutconsumer.(*logsConsumer).ConsumeLogs - go.opentelemetry.io/collector@v0.112.0/internal/fanoutconsumer/logs.go:62 + go.opentelemetry.io/collector@v0.112.0/internal/fanoutconsumer/logs.go:62 go.opentelemetry.io/collector/processor/processorhelper.NewLogs.func1 - go.opentelemetry.io/collector/processor@v0.112.0/processorhelper/logs.go:66 + go.opentelemetry.io/collector/processor@v0.112.0/processorhelper/logs.go:66 go.opentelemetry.io/collector/consumer.ConsumeLogsFunc.ConsumeLogs - go.opentelemetry.io/collector/consumer@v0.112.0/logs.go:26 + go.opentelemetry.io/collector/consumer@v0.112.0/logs.go:26 go.opentelemetry.io/collector/processor/processorhelper.NewLogs.func1 - go.opentelemetry.io/collector/processor@v0.112.0/processorhelper/logs.go:66 + go.opentelemetry.io/collector/processor@v0.112.0/processorhelper/logs.go:66 go.opentelemetry.io/collector/consumer.ConsumeLogsFunc.ConsumeLogs - go.opentelemetry.io/collector/consumer@v0.112.0/logs.go:26 + go.opentelemetry.io/collector/consumer@v0.112.0/logs.go:26 go.opentelemetry.io/collector/consumer.ConsumeLogsFunc.ConsumeLogs - go.opentelemetry.io/collector/consumer@v0.112.0/logs.go:26 + go.opentelemetry.io/collector/consumer@v0.112.0/logs.go:26 go.opentelemetry.io/collector/internal/fanoutconsumer.(*logsConsumer).ConsumeLogs - go.opentelemetry.io/collector@v0.112.0/internal/fanoutconsumer/logs.go:62 + go.opentelemetry.io/collector@v0.112.0/internal/fanoutconsumer/logs.go:62 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/consumerretry.(*logsConsumer).ConsumeLogs - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal@v0.112.0/consumerretry/logs.go:37 + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal@v0.112.0/consumerretry/logs.go:37 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/adapter.(*receiver).consumerLoop - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.112.0/adapter/receiver.go:110 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.112.0/adapter/receiver.go:110 - caller: consumerretry/logs.go:39 error: "could not process attribute gcp.source_location: json: cannot unmarshal string into Go struct field LogEntrySourceLocation.line of type int64" level: error msg: ConsumeLogs() failed. Enable retry_on_failure to slow down reading logs and avoid dropping. stacktrace: |- github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/consumerretry.(*logsConsumer).ConsumeLogs - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal@v0.112.0/consumerretry/logs.go:39 + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal@v0.112.0/consumerretry/logs.go:39 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/adapter.(*receiver).consumerLoop - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.112.0/adapter/receiver.go:110 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.112.0/adapter/receiver.go:110 - caller: adapter/receiver.go:112 error: "could not process attribute gcp.source_location: json: cannot unmarshal string into Go struct field LogEntrySourceLocation.line of type int64" level: error msg: ConsumeLogs() failed stacktrace: |- github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/adapter.(*receiver).consumerLoop - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.112.0/adapter/receiver.go:112 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.112.0/adapter/receiver.go:112 diff --git a/transformation_test/transformation_test.go b/transformation_test/transformation_test.go index 34e5abb37a..f8b5cce07b 100644 --- a/transformation_test/transformation_test.go +++ b/transformation_test/transformation_test.go @@ -569,7 +569,7 @@ func sanitizeWriteLogEntriesRequest(t *testing.T, r *logpb.WriteLogEntriesReques func sanitizeStacktrace(t *testing.T, input string) string { // We need to remove non-deterministic information from stacktraces so the goldens don't keep changing. // Remove $GOPATH - result := regexp.MustCompile(`(?m)^\t(.*?)pkg/mod/`).ReplaceAllString(input, "\t") + result := regexp.MustCompile(`(?m)^\t(.*?)pkg/mod/`).ReplaceAllString(input, " ") // Remove function arguments result = regexp.MustCompile(`(?m)^(.*)\(.+\)$`).ReplaceAllString(result, "$1(...)") // Remove anything that looks like an address