diff --git a/app/vmalert/config/config.go b/app/vmalert/config/config.go index f027dad59..cd40af7af 100644 --- a/app/vmalert/config/config.go +++ b/app/vmalert/config/config.go @@ -41,7 +41,7 @@ func (g *Group) UnmarshalYAML(unmarshal func(interface{}) error) error { } b, err := yaml.Marshal(g) if err != nil { - return fmt.Errorf("failed to marshal group configuration for checksum: %s", err) + return fmt.Errorf("failed to marshal group configuration for checksum: %w", err) } h := md5.New() h.Write(b) diff --git a/app/vmstorage/transport/server.go b/app/vmstorage/transport/server.go index cc5bdecbc..ea6f52fea 100644 --- a/app/vmstorage/transport/server.go +++ b/app/vmstorage/transport/server.go @@ -724,7 +724,7 @@ func (s *Server) processVMSelectTagValueSuffixes(ctx *vmselectRequestCtx) error tagValuePrefix := append([]byte{}, ctx.dataBuf...) delimiter, err := ctx.readByte() if err != nil { - return fmt.Errorf("cannot read delimiter: %s", err) + return fmt.Errorf("cannot read delimiter: %w", err) } // Search for tag value suffixes diff --git a/lib/promscrape/discovery/ec2/api_test.go b/lib/promscrape/discovery/ec2/api_test.go index a37c33ce5..b067880b1 100644 --- a/lib/promscrape/discovery/ec2/api_test.go +++ b/lib/promscrape/discovery/ec2/api_test.go @@ -114,7 +114,7 @@ func TestParseARNCredentialsSuccess(t *testing.T) { func mustParseRFC3339(s string) time.Time { expTime, err := time.Parse(time.RFC3339, s) if err != nil { - panic(fmt.Errorf("unexpected error when parsing time from %q: %s", s, err)) + panic(fmt.Errorf("unexpected error when parsing time from %q: %w", s, err)) } return expTime }