Skip to content

Commit

Permalink
Making mapperConfigDefaults public, so that Grafana Agent can instant…
Browse files Browse the repository at this point in the history
…iate MetricMapper without using InitFromYAMLString directly.

Signed-off-by: Gabriel Antunes <[email protected]>
  • Loading branch information
gaantunes committed Mar 13, 2023
1 parent 14d18d8 commit b7afa88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/mapper/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var (

type MetricMapper struct {
Registerer prometheus.Registerer
Defaults mapperConfigDefaults `yaml:"defaults"`
Defaults MapperConfigDefaults `yaml:"defaults"`
Mappings []MetricMapping `yaml:"mappings"`
FSM *fsm.FSM
doFSM bool
Expand Down
4 changes: 2 additions & 2 deletions pkg/mapper/mapper_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package mapper

import "time"

type mapperConfigDefaults struct {
type MapperConfigDefaults struct {
ObserverType ObserverType `yaml:"observer_type"`
MatchType MatchType `yaml:"match_type"`
GlobDisableOrdering bool `yaml:"glob_disable_ordering"`
Expand All @@ -39,7 +39,7 @@ type mapperConfigDefaultsAlias struct {

// UnmarshalYAML is a custom unmarshal function to allow use of deprecated config keys
// observer_type will override timer_type
func (d *mapperConfigDefaults) UnmarshalYAML(unmarshal func(interface{}) error) error {
func (d *MapperConfigDefaults) UnmarshalYAML(unmarshal func(interface{}) error) error {
var tmp mapperConfigDefaultsAlias
if err := unmarshal(&tmp); err != nil {
return err
Expand Down

0 comments on commit b7afa88

Please sign in to comment.