Skip to content

Commit

Permalink
expfmt/encoder: Allow opt-in for OM created lines
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
  • Loading branch information
ArthurSens committed Dec 12, 2023
1 parent 913b8f0 commit bdac7de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions expfmt/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func NegotiateIncludingOpenMetrics(h http.Header) Format {
// for FmtOpenMetrics, but a future (breaking) release will add the Close method
// to the Encoder interface directly. The current version of the Encoder
// interface is kept for backwards compatibility.
func NewEncoder(w io.Writer, format Format) Encoder {
func NewEncoder(w io.Writer, format Format, options ...ToOpenMetricsOption) Encoder {
switch format {
case FmtProtoDelim:
return encoderCloser{
Expand Down Expand Up @@ -152,7 +152,7 @@ func NewEncoder(w io.Writer, format Format) Encoder {
case FmtOpenMetrics_0_0_1, FmtOpenMetrics_1_0_0:
return encoderCloser{
encode: func(v *dto.MetricFamily) error {
_, err := MetricFamilyToOpenMetrics(w, v)
_, err := MetricFamilyToOpenMetrics(w, v, options...)
return err
},
close: func() error {
Expand Down

0 comments on commit bdac7de

Please sign in to comment.