You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[receiver/googlecloudpubsub] Add support for encoding extensions (open-telemetry#37109)
Added support for encoding extensions. Setting the encoding field in the
config now references the extension. If it didn't find the extension it
will fall back to searching the internal encoders.
To make the build in encoders consistent with the extensions they now
have the same interface.
The README is adapted accordingly.
Copy file name to clipboardexpand all lines: receiver/googlecloudpubsubreceiver/config.go
-45
Original file line number
Diff line number
Diff line change
@@ -35,51 +35,6 @@ type Config struct {
35
35
ClientIDstring`mapstructure:"client_id"`
36
36
}
37
37
38
-
func (config*Config) validateForLog() error {
39
-
err:=config.validate()
40
-
iferr!=nil {
41
-
returnerr
42
-
}
43
-
switchconfig.Encoding {
44
-
case"":
45
-
case"otlp_proto_log":
46
-
case"raw_text":
47
-
case"raw_json":
48
-
case"cloud_logging":
49
-
default:
50
-
returnfmt.Errorf("log encoding %v is not supported. supported encoding formats include [otlp_proto_log,raw_text,raw_json,cloud_logging]", config.Encoding)
51
-
}
52
-
returnnil
53
-
}
54
-
55
-
func (config*Config) validateForTrace() error {
56
-
err:=config.validate()
57
-
iferr!=nil {
58
-
returnerr
59
-
}
60
-
switchconfig.Encoding {
61
-
case"":
62
-
case"otlp_proto_trace":
63
-
default:
64
-
returnfmt.Errorf("trace encoding %v is not supported. supported encoding formats include [otlp_proto_trace]", config.Encoding)
65
-
}
66
-
returnnil
67
-
}
68
-
69
-
func (config*Config) validateForMetric() error {
70
-
err:=config.validate()
71
-
iferr!=nil {
72
-
returnerr
73
-
}
74
-
switchconfig.Encoding {
75
-
case"":
76
-
case"otlp_proto_metric":
77
-
default:
78
-
returnfmt.Errorf("metric encoding %v is not supported. supported encoding formats include [otlp_proto_metric]", config.Encoding)
0 commit comments