Remove validation for telemetry logger encoding (#4533)

This commit is contained in:
Lukasz Byczynski 2021-12-21 23:47:12 +01:00 committed by GitHub
parent eb6f0519e8
commit 1aa81d75e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 48 deletions

View File

@ -16,6 +16,7 @@
- `confighttp`: add client-side compression support. (#4441)
- Each exporter should remove `compression` field if they have and should use `confighttp.HTTPClientSettings`
- Allow more zap logger configs: `disable_caller`, `disable_stacktrace`, `output_paths`, `error_output_paths`, `initial_fields` (#1048)
- Allow the custom zap logger encoding (#4532)
- Collector self-metrics may now be configured through the configuration file. (#4069)
- CLI flags for configuring self-metrics are deprecated and will be removed
in a future release.
@ -240,7 +241,7 @@
- Rename `configloader` interface to `configunmarshaler` (#3774)
- Remove `LabelsMap` from all the metrics points (#3706)
- Update generated K8S attribute labels to fix capitalization (#3823)
- Update generated K8S attribute labels to fix capitalization (#3823)
## 💡 Enhancements 💡
@ -340,28 +341,28 @@ This release is marked as "bad" since the metrics pipelines will produce bad dat
- zipkinv1 implement directly Unmarshaler interface (#3504)
- zipkinv2 implement directly Marshaler/Unmarshaler interface (#3505)
- Change exporterhelper to accept ExporterCreateSettings instead of just logger (#3569)
- Deprecate Resize() from pdata slice APIs (#3573)
- Deprecate Resize() from pdata slice APIs (#3573)
- Use Func pattern in processorhelper, consistent with others (#3570)
## 💡 Enhancements 💡
- Update OTLP to v0.8.0 (#3572)
- Migrate from OpenCensus to OpenTelemetry for internal tracing (#3567)
- Move internal/pdatagrpc to model/otlpgrpc (#3507)
- Migrate from OpenCensus to OpenTelemetry for internal tracing (#3567)
- Move internal/pdatagrpc to model/otlpgrpc (#3507)
- Move internal/otlp to model/otlp (#3508)
- Create http Server via Config, enable cors and decompression (#3513)
- Allow users to set min and max TLS versions (#3591)
- Support setting ballast size in percentage of total Mem in ballast extension (#3456)
- Publish go.opentelemetry.io/collector/model as a separate module (#3530)
- Pass a TracerProvider via construct settings to all the components (#3592)
- Pass a TracerProvider via construct settings to all the components (#3592)
- Make graceful shutdown optional (#3577)
## 🧰 Bug fixes 🧰
- `scraperhelper`: Include the scraper name in log messages (#3487)
- `scraperhelper`: fix case when returned pdata is empty (#3520)
- Record the correct number of points not metrics in Kafka receiver (#3553)
- Validate the Prometheus configuration (#3589)
- `scraperhelper`: fix case when returned pdata is empty (#3520)
- Record the correct number of points not metrics in Kafka receiver (#3553)
- Validate the Prometheus configuration (#3589)
## v0.29.0 Beta
@ -1159,8 +1160,8 @@ Released 2020-06-16
## 🛑 Breaking changes 🛑
- `isEnabled` configuration option removed (#909)
- `thrift_tchannel` protocol moved from `jaeger` receiver to `jaeger_legacy` in contrib (#636)
- `isEnabled` configuration option removed (#909)
- `thrift_tchannel` protocol moved from `jaeger` receiver to `jaeger_legacy` in contrib (#636)
## ⚠️ Major changes ⚠️
@ -1176,24 +1177,24 @@ Released 2020-06-16
- Receivers
- `hostmetrics` receiver with CPU (#862), disk (#921), load (#974), filesystem (#926), memory (#911), network (#930), and virtual memory (#989) support
- Processors
- `batch` for batching received metrics (#1060)
- `filter` for filtering (dropping) received metrics (#1001)
- `batch` for batching received metrics (#1060)
- `filter` for filtering (dropping) received metrics (#1001)
## 💡 Enhancements 💡
- `otlp` receiver implement HTTP X-Protobuf (#1021)
- Exporters: Support mTLS in gRPC exporters (#927)
- Extensions: Add `zpages` for service (servicez, pipelinez, extensions) (#894)
- Exporters: Support mTLS in gRPC exporters (#927)
- Extensions: Add `zpages` for service (servicez, pipelinez, extensions) (#894)
## 🧰 Bug fixes 🧰
- Add missing logging for metrics at `debug` level (#1108)
- Fix setting internal status code in `jaeger` receivers (#1105)
- `zipkin` export fails on span without timestamp when used with `queued_retry` (#1068)
- Fix `zipkin` receiver status code conversion (#996)
- Add missing logging for metrics at `debug` level (#1108)
- Fix setting internal status code in `jaeger` receivers (#1105)
- `zipkin` export fails on span without timestamp when used with `queued_retry` (#1068)
- Fix `zipkin` receiver status code conversion (#996)
- Remove extra send/receive annotations with using `zipkin` v1 (#960)
- Fix resource attribute mutation bug when exporting in `jaeger` proto (#907)
- Fix metric/spans count, add tests for nil entries in the slices (#787)
- Fix resource attribute mutation bug when exporting in `jaeger` proto (#907)
- Fix metric/spans count, add tests for nil entries in the slices (#787)
## 🧩 Components 🧩
@ -1233,14 +1234,14 @@ Released 2020-03-30
### Breaking changes
- Make prometheus receiver config loading strict. #697
- Make prometheus receiver config loading strict. #697
Prometheus receiver will now fail fast if the config contains unused keys in it.
### Changes and fixes
- Enable best effort serve by default of Prometheus Exporter (https://github.com/orijtech/prometheus-go-metrics-exporter/pull/6)
- Fix null pointer exception in the logging exporter #743
- Remove unnecessary condition to have at least one processor #744
- Fix null pointer exception in the logging exporter #743
- Remove unnecessary condition to have at least one processor #744
### Components
@ -1262,7 +1263,7 @@ Alpha v0.2.8 of OpenTelemetry Collector
- Implemented OTLP receiver and exporter.
- Added ability to pass config to the service programmatically (useful for custom builds).
- Improved own metrics / observability.
- Refactored component and factory interface definitions (breaking change #683)
- Refactored component and factory interface definitions (breaking change #683)
## v0.2.7 Alpha

View File

@ -85,6 +85,15 @@ func TestConfigValidate(t *testing.T) {
cfgFn: generateConfig,
expected: nil,
},
{
name: "custom-service-telemetry-encoding",
cfgFn: func() *Config {
cfg := generateConfig()
cfg.Service.Telemetry.Logs.Encoding = "test_encoding"
return cfg
},
expected: nil,
},
{
name: "missing-exporters",
cfgFn: func() *Config {
@ -215,15 +224,6 @@ func TestConfigValidate(t *testing.T) {
},
expected: fmt.Errorf(`extension "nop" has invalid configuration: %w`, errInvalidExtConfig),
},
{
name: "invalid-service-telemetry-encoding",
cfgFn: func() *Config {
cfg := generateConfig()
cfg.Service.Telemetry.Logs.Encoding = "unknown"
return cfg
},
expected: errors.New(`service telemetry logs invalid encoding: "unknown", valid values are "json" and "console"`),
},
}
for _, test := range testCases {

View File

@ -15,8 +15,6 @@
package config // import "go.opentelemetry.io/collector/config"
import (
"fmt"
"go.uber.org/zap/zapcore"
"go.opentelemetry.io/collector/config/configtelemetry"
@ -41,10 +39,6 @@ type ServiceTelemetry struct {
}
func (srvT *ServiceTelemetry) validate() error {
if err := srvT.Logs.validate(); err != nil {
return err
}
return srvT.Metrics.validate()
}
@ -62,8 +56,7 @@ type ServiceTelemetryLogs struct {
Development bool `mapstructure:"development"`
// Encoding sets the logger's encoding.
// Valid values are "json" and "console".
// (default = "console")
// Example values are "json", "console".
Encoding string `mapstructure:"encoding"`
// DisableCaller stops annotating logs with the calling function's file
@ -107,13 +100,6 @@ type ServiceTelemetryLogs struct {
InitialFields map[string]interface{} `mapstructure:"initial_fields"`
}
func (srvTL *ServiceTelemetryLogs) validate() error {
if srvTL.Encoding != "json" && srvTL.Encoding != "console" {
return fmt.Errorf(`service telemetry logs invalid encoding: %q, valid values are "json" and "console"`, srvTL.Encoding)
}
return nil
}
// ServiceTelemetryMetrics exposes the common Telemetry configuration for one component.
// Experimental: *NOTE* this structure is subject to change or removal in the future.
type ServiceTelemetryMetrics struct {