Hash YAML instead of JSON
But it doesn't work either because of secret fields.
@@ -17,12 +17,12 @@ import (
"context"
"crypto/md5"
"encoding/hex"
- "encoding/json"
"fmt"
"sync"
"time"
"github.com/go-kit/kit/log"
+ "gopkg.in/yaml.v2"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/model"
@@ -174,7 +174,7 @@ func labelsToEqualityMatchers(ls model.LabelSet) []*labels.Matcher {
// Used for hashing configs and diff'ing hashes in ApplyConfig.
func toHash(data interface{}) (string, error) {
- bytes, err := json.Marshal(data)
+ bytes, err := yaml.Marshal(data)
if err != nil {
return "", err
}
