@@ -1709,12 +1709,6 @@ func (h *Handler) handlePostMetric(ctx context.Context, ai accessInfo, _ string,
17091709 return format.MetricMetaValue {},
17101710 httpErr (http .StatusForbidden , fmt .Errorf ("can't edit metric %q" , old .Name ))
17111711 }
1712- if diffContainsRawTagChanges (* old , metric ) {
1713- if isAdmin := ai .isAdmin () || ai .insecureMode ; ! isAdmin {
1714- return format.MetricMetaValue {}, httpErr (http .StatusForbidden ,
1715- fmt .Errorf ("raw tags can only be edited by administrators, please contact the support group" ))
1716- }
1717- }
17181712 resp , err = h .metadataLoader .SaveMetric (ctx , metric , ai .toMetadata ())
17191713 if err != nil {
17201714 if metajournal .IsUserRequestError (err ) {
@@ -1727,26 +1721,6 @@ func (h *Handler) handlePostMetric(ctx context.Context, ai accessInfo, _ string,
17271721 return resp , nil
17281722}
17291723
1730- func diffContainsRawTagChanges (old , new format.MetricMetaValue ) bool {
1731- for i := 0 ; i < len (old .Tags ) && i < len (new .Tags ); i ++ {
1732- if old .Tags [i ].Raw != new .Tags [i ].Raw {
1733- return true // edit
1734- }
1735- if old .Tags [i ].Raw64 () != new .Tags [i ].Raw64 () {
1736- return true // edit
1737- }
1738- }
1739- for i := len (new .Tags ); i < len (old .Tags ); i ++ {
1740- if old .Tags [i ].Raw {
1741- return true // removal
1742- }
1743- if old .Tags [i ].Raw64 () {
1744- return true // removal
1745- }
1746- }
1747- return false
1748- }
1749-
17501724func HandleGetMetricTagValues (r * httpRequestHandler ) {
17511725 ctx , cancel := context .WithTimeout (r .Context (), r .querySelectTimeout )
17521726 defer cancel ()
0 commit comments