From 089fa9c8a7b6f9cb3897f7485571ce6c1c4a4fab Mon Sep 17 00:00:00 2001 From: Ganesh Vernekar <15064823+codesome@users.noreply.github.com> Date: Mon, 13 Jul 2020 15:02:31 +0530 Subject: [PATCH] Upgrade Prometheus (#2867) Signed-off-by: Ganesh Vernekar --- CHANGELOG.md | 2 +- go.mod | 2 +- go.sum | 4 +- .../discovery/dockerswarm/dockerswarm.go | 27 +- .../prometheus/pkg/rulefmt/rulefmt.go | 2 +- .../promql/parser/generated_parser.y | 2 +- .../promql/parser/generated_parser.y.go | 489 +++++++++--------- .../prometheus/prometheus/scrape/scrape.go | 4 +- .../prometheus/prometheus/tsdb/head.go | 6 +- vendor/modules.txt | 2 +- 10 files changed, 275 insertions(+), 265 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 724dc3b626..93f0f74a02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,7 +49,7 @@ * `s3.http.idle-conn-timeout` * `s3.http.response-header-timeout` * `s3.http.insecure-skip-verify` -* [ENHANCEMENT] Prometheus upgraded. #2798 #2849 +* [ENHANCEMENT] Prometheus upgraded. #2798 #2849 #2867 * Optimized labels regex matchers for patterns containing literals (eg. `foo.*`, `.*foo`, `.*foo.*`) * [ENHANCEMENT] Experimental Alertmanager: Alertmanager configuration persisted to object storage using an experimental API that accepts and returns YAML-based Alertmanager configuration. #2768 * [BUGFIX] Fixed a bug in the index intersect code causing storage to return more chunks/series than required. #2796 diff --git a/go.mod b/go.mod index 79793c6a38..b903042de6 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/prometheus/client_golang v1.7.1 github.com/prometheus/client_model v0.2.0 github.com/prometheus/common v0.10.0 - github.com/prometheus/prometheus v1.8.2-0.20200707115909-30505a202a4c + github.com/prometheus/prometheus v1.8.2-0.20200711170716-492061b24c00 github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1 github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e github.com/spf13/afero v1.2.2 diff --git a/go.sum b/go.sum index c0a178451a..6e2c64a86d 100644 --- a/go.sum +++ b/go.sum @@ -958,8 +958,8 @@ github.com/prometheus/prometheus v0.0.0-20190818123050-43acd0e2e93f/go.mod h1:rM github.com/prometheus/prometheus v1.8.2-0.20200107122003-4708915ac6ef/go.mod h1:7U90zPoLkWjEIQcy/rweQla82OCTUzxVHE51G3OhJbI= github.com/prometheus/prometheus v1.8.2-0.20200213233353-b90be6f32a33/go.mod h1:fkIPPkuZnkXyopYHmXPxf9rgiPkVgZCN8w9o8+UgBlY= github.com/prometheus/prometheus v1.8.2-0.20200619100132-74207c04655e/go.mod h1:QV6T0PPQi5UFmqcLBJw3JiyIR8r1O7KEv9qlVw4VV40= -github.com/prometheus/prometheus v1.8.2-0.20200707115909-30505a202a4c h1:Iz2q3wgo4xiURb7Ku0MCrM7osAVHX03lF1vHNht1fb8= -github.com/prometheus/prometheus v1.8.2-0.20200707115909-30505a202a4c/go.mod h1:/kMSPIRsxr/apyHxlzYMdFnaPXUXXqILU5uzIoNhOvc= +github.com/prometheus/prometheus v1.8.2-0.20200711170716-492061b24c00 h1:21zZwg0Dd9pf+q9iZg8XjyabBKDEq85TE4egL8o3GtU= +github.com/prometheus/prometheus v1.8.2-0.20200711170716-492061b24c00/go.mod h1:/kMSPIRsxr/apyHxlzYMdFnaPXUXXqILU5uzIoNhOvc= github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1 h1:+kGqA4dNN5hn7WwvKdzHl0rdN5AEkbNZd0VjRltAiZg= github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1/go.mod h1:JaY6n2sDr+z2WTsXkOmNRUfDy6FN0L6Nk7x06ndm4tY= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= diff --git a/vendor/github.com/prometheus/prometheus/discovery/dockerswarm/dockerswarm.go b/vendor/github.com/prometheus/prometheus/discovery/dockerswarm/dockerswarm.go index 3d5241c13e..418eb9d8e7 100644 --- a/vendor/github.com/prometheus/prometheus/discovery/dockerswarm/dockerswarm.go +++ b/vendor/github.com/prometheus/prometheus/discovery/dockerswarm/dockerswarm.go @@ -82,6 +82,7 @@ func (c *SDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { type Discovery struct { *refresh.Discovery client *client.Client + role string port int } @@ -89,6 +90,7 @@ type Discovery struct { func NewDiscovery(conf *SDConfig, logger log.Logger) (*Discovery, error) { d := &Discovery{ port: conf.Port, + role: conf.Role, } rt, err := config_util.NewRoundTripperFromConfig(conf.HTTPClientConfig, "dockerswarm_sd", false) @@ -117,21 +119,24 @@ func NewDiscovery(conf *SDConfig, logger log.Logger) (*Discovery, error) { return nil, fmt.Errorf("error setting up docker swarm client: %w", err) } - var r func(context.Context) ([]*targetgroup.Group, error) - switch conf.Role { - case "services": - r = d.refreshServices - case "nodes": - r = d.refreshNodes - case "tasks": - r = d.refreshTasks - } - d.Discovery = refresh.NewDiscovery( logger, "dockerswarm", time.Duration(conf.RefreshInterval), - r, + d.refresh, ) return d, nil } + +func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) { + switch d.role { + case "services": + return d.refreshServices(ctx) + case "nodes": + return d.refreshNodes(ctx) + case "tasks": + return d.refreshTasks(ctx) + default: + panic(fmt.Errorf("unexpected role %s", d.role)) + } +} diff --git a/vendor/github.com/prometheus/prometheus/pkg/rulefmt/rulefmt.go b/vendor/github.com/prometheus/prometheus/pkg/rulefmt/rulefmt.go index 899ab2738c..0003332170 100644 --- a/vendor/github.com/prometheus/prometheus/pkg/rulefmt/rulefmt.go +++ b/vendor/github.com/prometheus/prometheus/pkg/rulefmt/rulefmt.go @@ -68,7 +68,7 @@ func (g *RuleGroups) Validate(node ruleGroups) (errs []error) { for j, g := range g.Groups { if g.Name == "" { - errs = append(errs, errors.Errorf("%d:%d: Groupname should not be empty", node.Groups[j].Line, node.Groups[j].Column)) + errs = append(errs, errors.Errorf("%d:%d: Groupname must not be empty", node.Groups[j].Line, node.Groups[j].Column)) } if _, ok := set[g.Name]; ok { diff --git a/vendor/github.com/prometheus/prometheus/promql/parser/generated_parser.y b/vendor/github.com/prometheus/prometheus/promql/parser/generated_parser.y index d066a3702c..501545b987 100644 --- a/vendor/github.com/prometheus/prometheus/promql/parser/generated_parser.y +++ b/vendor/github.com/prometheus/prometheus/promql/parser/generated_parser.y @@ -536,7 +536,7 @@ metric : metric_identifier label_set ; -metric_identifier: AVG | BOTTOMK | BY | COUNT | COUNT_VALUES | GROUP | IDENTIFIER | LAND | LOR | LUNLESS | MAX | METRIC_IDENTIFIER | MIN | OFFSET | QUANTILE | STDDEV | STDVAR | SUM | TOPK; +metric_identifier: AVG | BOTTOMK | BY | COUNT | COUNT_VALUES | GROUP | IDENTIFIER | LAND | LOR | LUNLESS | MAX | METRIC_IDENTIFIER | MIN | OFFSET | QUANTILE | STDDEV | STDVAR | SUM | TOPK | WITHOUT; label_set : LEFT_BRACE label_set_list RIGHT_BRACE { $$ = labels.New($2...) } diff --git a/vendor/github.com/prometheus/prometheus/promql/parser/generated_parser.y.go b/vendor/github.com/prometheus/prometheus/promql/parser/generated_parser.y.go index 75470a8079..1acb4dc6bb 100644 --- a/vendor/github.com/prometheus/prometheus/promql/parser/generated_parser.y.go +++ b/vendor/github.com/prometheus/prometheus/promql/parser/generated_parser.y.go @@ -192,241 +192,248 @@ var yyExca = [...]int{ -1, 1, 1, -1, -2, 0, - -1, 32, - 1, 120, - 10, 120, - 22, 120, + -1, 33, + 1, 121, + 10, 121, + 22, 121, -2, 0, - -1, 54, - 2, 132, - 15, 132, - 60, 132, - 66, 132, - -2, 89, -1, 55, 2, 133, 15, 133, 60, 133, 66, 133, - -2, 90, + -2, 89, -1, 56, 2, 134, 15, 134, 60, 134, 66, 134, - -2, 92, + -2, 90, -1, 57, 2, 135, 15, 135, 60, 135, 66, 135, - -2, 93, + -2, 92, -1, 58, 2, 136, 15, 136, 60, 136, 66, 136, - -2, 94, + -2, 93, -1, 59, 2, 137, 15, 137, 60, 137, 66, 137, - -2, 99, + -2, 94, -1, 60, 2, 138, 15, 138, 60, 138, 66, 138, - -2, 101, + -2, 99, -1, 61, 2, 139, 15, 139, 60, 139, 66, 139, - -2, 103, + -2, 101, -1, 62, 2, 140, 15, 140, 60, 140, 66, 140, - -2, 104, + -2, 103, -1, 63, 2, 141, 15, 141, 60, 141, 66, 141, - -2, 105, + -2, 104, -1, 64, 2, 142, 15, 142, 60, 142, 66, 142, - -2, 106, + -2, 105, -1, 65, 2, 143, 15, 143, 60, 143, 66, 143, + -2, 106, + -1, 66, + 2, 144, + 15, 144, + 60, 144, + 66, 144, -2, 107, - -1, 175, - 12, 183, - 13, 183, - 16, 183, - 17, 183, - 23, 183, - 26, 183, - 32, 183, - 33, 183, - 36, 183, - 42, 183, - 45, 183, - 46, 183, - 47, 183, - 48, 183, - 49, 183, - 50, 183, - 51, 183, - 52, 183, - 53, 183, - 54, 183, - 55, 183, - 56, 183, - 60, 183, - 64, 183, - -2, 0, -1, 176, - 12, 183, - 13, 183, - 16, 183, - 17, 183, - 23, 183, - 26, 183, - 32, 183, - 33, 183, - 36, 183, - 42, 183, - 45, 183, - 46, 183, - 47, 183, - 48, 183, - 49, 183, - 50, 183, - 51, 183, - 52, 183, - 53, 183, - 54, 183, - 55, 183, - 56, 183, - 60, 183, - 64, 183, + 12, 184, + 13, 184, + 16, 184, + 17, 184, + 23, 184, + 26, 184, + 32, 184, + 33, 184, + 36, 184, + 42, 184, + 45, 184, + 46, 184, + 47, 184, + 48, 184, + 49, 184, + 50, 184, + 51, 184, + 52, 184, + 53, 184, + 54, 184, + 55, 184, + 56, 184, + 60, 184, + 64, 184, + 66, 184, -2, 0, - -1, 192, - 19, 181, + -1, 177, + 12, 184, + 13, 184, + 16, 184, + 17, 184, + 23, 184, + 26, 184, + 32, 184, + 33, 184, + 36, 184, + 42, 184, + 45, 184, + 46, 184, + 47, 184, + 48, 184, + 49, 184, + 50, 184, + 51, 184, + 52, 184, + 53, 184, + 54, 184, + 55, 184, + 56, 184, + 60, 184, + 64, 184, + 66, 184, -2, 0, - -1, 240, + -1, 193, 19, 182, -2, 0, + -1, 241, + 19, 183, + -2, 0, } const yyPrivate = 57344 -const yyLast = 543 +const yyLast = 598 var yyAct = [...]int{ - 246, 196, 34, 135, 236, 237, 167, 168, 107, 73, - 98, 96, 95, 175, 176, 120, 99, 198, 173, 230, - 174, 170, 249, 97, 114, 229, 115, 208, 228, 53, - 109, 214, 162, 250, 247, 252, 100, 171, 100, 244, - 108, 169, 224, 6, 243, 68, 225, 210, 211, 227, - 113, 212, 102, 161, 103, 223, 94, 242, 116, 101, - 199, 201, 203, 204, 205, 213, 215, 218, 219, 220, - 221, 222, 94, 30, 200, 202, 206, 207, 209, 216, - 217, 98, 104, 91, 78, 79, 80, 99, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 138, 91, - 92, 144, 7, 148, 142, 145, 93, 140, 241, 141, - 2, 3, 4, 5, 143, 137, 139, 251, 77, 172, - 31, 160, 93, 137, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 121, 122, + 247, 197, 35, 136, 237, 238, 168, 169, 108, 74, + 97, 96, 99, 174, 121, 175, 98, 250, 100, 176, + 177, 230, 95, 54, 231, 229, 171, 48, 69, 101, + 50, 22, 49, 163, 245, 148, 251, 248, 51, 244, + 116, 67, 172, 6, 170, 101, 228, 18, 19, 92, + 115, 20, 243, 103, 162, 104, 69, 68, 117, 102, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 94, 95, 99, 13, 114, 105, 31, 24, + 100, 30, 7, 252, 8, 79, 80, 81, 33, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 139, + 92, 93, 225, 145, 149, 143, 146, 141, 110, 142, + 2, 3, 4, 5, 242, 224, 144, 78, 109, 32, + 173, 138, 161, 94, 226, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 1, 193, 198, 164, 154, 192, 152, 75, - 226, 10, 166, 151, 208, 239, 44, 169, 214, 74, - 191, 70, 195, 231, 150, 159, 170, 232, 233, 234, - 235, 238, 155, 157, 210, 211, 43, 52, 212, 45, - 9, 9, 171, 156, 158, 69, 240, 199, 201, 203, - 204, 205, 213, 215, 218, 219, 220, 221, 222, 42, - 41, 200, 202, 206, 207, 209, 216, 217, 47, 68, - 112, 49, 22, 48, 109, 111, 147, 245, 136, 50, - 119, 248, 66, 75, 108, 137, 110, 8, 18, 19, - 106, 32, 20, 74, 40, 253, 39, 38, 67, 72, - 254, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 117, 146, 37, 13, 118, 36, 33, - 24, 47, 68, 35, 49, 22, 48, 165, 76, 163, - 194, 71, 50, 51, 197, 66, 153, 46, 105, 0, - 0, 18, 19, 0, 0, 20, 0, 0, 0, 0, - 0, 67, 0, 0, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 0, 47, 68, 13, - 49, 22, 48, 24, 0, 0, 0, 0, 50, 0, - 0, 66, 0, 0, 0, 0, 0, 18, 19, 0, - 0, 20, 17, 68, 0, 0, 22, 67, 0, 0, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 18, 19, 0, 13, 20, 17, 30, 24, - 0, 22, 0, 0, 0, 11, 12, 14, 15, 16, - 21, 23, 25, 26, 27, 28, 29, 18, 19, 0, - 13, 20, 0, 0, 24, 0, 0, 0, 0, 0, + 133, 134, 135, 153, 46, 140, 10, 137, 152, 1, + 70, 227, 138, 155, 138, 240, 71, 45, 44, 151, + 34, 95, 48, 69, 232, 50, 22, 49, 233, 234, + 235, 236, 239, 51, 80, 43, 67, 194, 42, 156, + 158, 193, 18, 19, 89, 90, 20, 241, 92, 120, + 157, 159, 68, 41, 192, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 40, 165, 76, + 13, 94, 39, 118, 24, 167, 30, 147, 246, 75, + 170, 38, 249, 48, 69, 160, 50, 22, 49, 171, + 113, 119, 110, 37, 51, 112, 254, 67, 36, 76, + 166, 255, 109, 18, 19, 172, 111, 20, 107, 75, + 77, 164, 195, 68, 72, 73, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 199, 53, + 52, 13, 9, 9, 198, 24, 154, 30, 209, 47, + 106, 0, 215, 0, 0, 0, 253, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, + 0, 0, 213, 0, 0, 0, 0, 0, 0, 0, + 0, 200, 202, 204, 205, 206, 214, 216, 219, 220, + 221, 222, 223, 199, 0, 201, 203, 207, 208, 210, + 217, 218, 0, 209, 0, 0, 0, 215, 0, 0, + 0, 196, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 211, 212, 0, 0, 213, 0, 0, + 0, 0, 0, 0, 0, 0, 200, 202, 204, 205, + 206, 214, 216, 219, 220, 221, 222, 223, 0, 0, + 201, 203, 207, 208, 210, 217, 218, 17, 69, 0, + 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 18, 19, 0, + 0, 20, 17, 31, 0, 0, 22, 0, 0, 0, 11, 12, 14, 15, 16, 21, 23, 25, 26, 27, - 28, 29, 94, 0, 0, 13, 0, 0, 149, 24, - 0, 0, 0, 0, 78, 79, 80, 0, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 0, 91, - 92, 0, 0, 94, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 78, 79, 80, 0, 81, - 82, 83, 93, 85, 86, 87, 88, 89, 90, 0, - 91, 92, 0, 0, 94, 0, 0, 0, 0, 0, - 0, 0, 0, 94, 0, 0, 78, 79, 80, 0, - 81, 82, 94, 93, 85, 86, 79, 88, 89, 90, - 0, 91, 92, 0, 78, 79, 88, 89, 0, 0, - 91, 0, 0, 0, 0, 88, 89, 0, 0, 91, - 92, 0, 0, 0, 93, 0, 0, 0, 0, 0, - 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, - 0, 0, 93, + 28, 29, 18, 19, 0, 13, 20, 0, 0, 24, + 0, 30, 0, 0, 0, 11, 12, 14, 15, 16, + 21, 23, 25, 26, 27, 28, 29, 95, 0, 0, + 13, 0, 0, 150, 24, 0, 30, 0, 0, 79, + 80, 81, 0, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 0, 92, 93, 0, 0, 95, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 79, 80, 81, 0, 82, 83, 84, 94, 86, 87, + 88, 89, 90, 91, 0, 92, 93, 0, 0, 95, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 79, 80, 81, 0, 82, 83, 95, 94, 86, + 87, 0, 89, 90, 91, 0, 92, 93, 0, 79, + 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 89, 90, 0, 0, 92, 93, 0, 0, 0, 94, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 94, } var yyPact = [...]int{ - 41, 92, 355, 355, 259, 330, -1000, -1000, -1000, 60, + 41, 72, 410, 410, 160, 385, -1000, -1000, -1000, 65, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - 231, -1000, 116, -1000, 58, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, 21, 23, -1000, 305, - -1000, 305, 32, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 222, -1000, - -1000, 218, -1000, -1000, 22, -1000, 4, -1000, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, 226, 114, 23, -50, -1000, 99, 99, - 206, -1000, 398, 42, -1000, 156, -1000, -1000, 154, -1000, - -1000, 157, -1000, 30, -1000, 150, 305, -1000, -45, -48, - -1000, 305, 305, 305, 305, 305, 305, 305, 305, 305, - 305, 305, 305, 305, 305, -1000, -1000, -1000, 151, -1000, - -1000, -1000, -1000, 152, -1000, -1000, 35, -1000, 58, -1000, - -1000, 28, -1000, 26, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, 1, -5, -1000, -1000, -1000, -1000, - 24, 24, 469, 99, 99, 99, 99, 42, 478, 478, - 478, 460, 429, 478, 478, 460, 42, 42, 478, 42, - 469, -1000, 106, -1000, 37, -1000, -1000, -1000, -1000, -1000, + -1000, 247, -1000, 115, -1000, 59, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, 14, 30, -1000, + 221, -1000, 221, 43, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 240, + -1000, -1000, 238, -1000, -1000, 48, -1000, 18, -1000, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, 155, 153, 30, -48, -1000, 101, + 101, 15, -1000, 453, 8, -1000, 151, -1000, -1000, 161, + -1000, -1000, 217, -1000, 31, -1000, 213, 221, -1000, -50, + -42, -1000, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, -1000, -1000, -1000, 185, + -1000, -1000, -1000, -1000, 331, -1000, -1000, 95, -1000, 59, + -1000, -1000, 106, -1000, 23, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -3, 0, -1000, -1000, -1000, + -1000, 27, 27, 157, 101, 101, 101, 101, 8, 533, + 533, 533, 515, 484, 533, 533, 515, 8, 8, 533, + 8, 157, -1000, 112, -1000, 32, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, 305, -1000, -1000, -1000, -1000, 17, - 17, -2, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 14, - 115, -1000, -1000, 15, -1000, 58, -1000, -1000, -1000, 17, - -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, 221, -1000, -1000, -1000, -1000, + 20, 20, -7, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + 17, 81, -1000, -1000, 276, -1000, 59, -1000, -1000, -1000, + 20, -1000, -1000, -1000, -1000, -1000, } var yyPgo = [...]int{ - 0, 288, 8, 287, 1, 286, 284, 187, 283, 161, - 281, 237, 9, 280, 5, 4, 279, 278, 0, 6, - 277, 7, 273, 12, 58, 268, 267, 2, 265, 264, - 11, 263, 29, 247, 246, 244, 230, 210, 209, 186, - 166, 189, 3, 165, 152, 120, + 0, 290, 8, 289, 1, 286, 284, 279, 280, 156, + 264, 84, 9, 262, 5, 4, 261, 260, 0, 6, + 250, 7, 248, 11, 58, 243, 241, 2, 231, 227, + 10, 223, 23, 222, 217, 203, 199, 188, 185, 168, + 167, 154, 3, 165, 159, 119, } var yyR1 = [...]int{ @@ -440,15 +447,15 @@ var yyR1 = [...]int{ 39, 39, 39, 40, 41, 41, 41, 32, 32, 32, 1, 1, 1, 2, 2, 2, 2, 11, 11, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, - 9, 9, 10, 10, 10, 12, 12, 12, 12, 45, - 17, 17, 17, 17, 16, 16, 16, 16, 16, 20, - 20, 20, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, + 9, 9, 9, 10, 10, 10, 12, 12, 12, 12, + 45, 17, 17, 17, 17, 16, 16, 16, 16, 16, + 20, 20, 20, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, - 5, 5, 5, 5, 34, 19, 21, 21, 18, 42, - 38, 43, 43, 15, 15, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, + 8, 5, 5, 5, 5, 34, 19, 21, 21, 18, + 42, 38, 43, 43, 15, 15, } var yyR2 = [...]int{ @@ -462,73 +469,73 @@ var yyR2 = [...]int{ 5, 4, 3, 2, 2, 1, 1, 3, 4, 2, 3, 1, 2, 3, 3, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, - 2, 0, 3, 1, 2, 3, 3, 2, 1, 2, - 0, 3, 2, 1, 1, 3, 1, 3, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 4, 2, 0, 3, 1, 2, 3, 3, 2, 1, + 2, 0, 3, 2, 1, 1, 3, 1, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, - 1, 0, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, + 1, 1, 0, 1, 0, 1, } var yyChk = [...]int{ -1000, -44, 69, 70, 71, 72, 2, 10, -11, -7, -9, 45, 46, 60, 47, 48, 49, 12, 32, 33, 36, 50, 16, 51, 64, 52, 53, 54, 55, 56, - 13, -45, -11, 10, -27, -22, -25, -28, -33, -34, - -35, -37, -38, -39, -40, -41, -3, 12, 17, 15, - 23, -8, -7, -32, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 26, 42, 13, -41, - -9, -10, 18, -12, 12, 2, -17, 2, 26, 27, - 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 41, 42, 64, 14, -23, -30, 2, 60, 66, - 15, -30, -27, -27, -32, -1, 18, -2, 12, 2, - 18, 7, 2, 28, 2, 22, -24, -31, -26, -36, - 59, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -42, 2, 9, -42, 2, - -30, -23, -14, 15, 2, -14, -29, 20, -27, 20, - 18, 7, 2, -5, 2, 28, 39, 29, 40, 18, - -12, 23, 2, -16, 5, -20, 12, -19, -21, 17, - 26, 42, -27, 63, 65, 61, 62, -27, -27, -27, + 66, 13, -45, -11, 10, -27, -22, -25, -28, -33, + -34, -35, -37, -38, -39, -40, -41, -3, 12, 17, + 15, 23, -8, -7, -32, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 26, 42, 13, + -41, -9, -10, 18, -12, 12, 2, -17, 2, 26, + 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 41, 42, 64, 14, -23, -30, 2, 60, + 66, 15, -30, -27, -27, -32, -1, 18, -2, 12, + 2, 18, 7, 2, 28, 2, 22, -24, -31, -26, + -36, 59, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -42, 2, 9, -42, + 2, -30, -23, -14, 15, 2, -14, -29, 20, -27, + 20, 18, 7, 2, -5, 2, 28, 39, 29, 40, + 18, -12, 23, 2, -16, 5, -20, 12, -19, -21, + 17, 26, 42, -27, 63, 65, 61, 62, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, - -27, 19, 6, 2, -13, 20, -4, -6, 2, 45, - 59, 46, 60, 47, 48, 49, 61, 62, 12, 63, - 32, 33, 36, 50, 16, 51, 64, 65, 52, 53, - 54, 55, 56, 20, 7, 18, -2, 23, 2, 24, - 24, -21, -19, -19, -14, -14, -15, -14, -15, -43, - -42, 2, 20, 7, 2, -27, -18, 17, -18, 24, - 19, 2, 20, -4, -18, + -27, -27, 19, 6, 2, -13, 20, -4, -6, 2, + 45, 59, 46, 60, 47, 48, 49, 61, 62, 12, + 63, 32, 33, 36, 50, 16, 51, 64, 65, 52, + 53, 54, 55, 56, 20, 7, 18, -2, 23, 2, + 24, 24, -21, -19, -19, -14, -14, -15, -14, -15, + -43, -42, 2, 20, 7, 2, -27, -18, 17, -18, + 24, 19, 2, 20, -4, -18, } var yyDef = [...]int{ - 0, -2, 111, 111, 0, 0, 7, 6, 1, 111, + 0, -2, 112, 112, 0, 0, 7, 6, 1, 112, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 0, 2, -2, 3, 4, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 0, 95, 174, 0, - 180, 0, 75, 76, -2, -2, -2, -2, -2, -2, - -2, -2, -2, -2, -2, -2, 168, 169, 0, 5, - 87, 0, 110, 113, 0, 118, 119, 123, 41, 41, + 108, 0, 2, -2, 3, 4, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 0, 95, 175, + 0, 181, 0, 75, 76, -2, -2, -2, -2, -2, + -2, -2, -2, -2, -2, -2, -2, 169, 170, 0, + 5, 87, 0, 111, 114, 0, 119, 120, 124, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 0, 0, 0, 21, 22, 0, 0, - 0, 58, 0, 73, 74, 0, 79, 81, 0, 86, - 108, 0, 114, 0, 117, 122, 0, 40, 45, 46, - 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 65, 66, 179, 0, 72, - 19, 20, 23, 0, 52, 24, 0, 60, 62, 64, - 77, 0, 82, 0, 85, 170, 171, 172, 173, 109, - 112, 115, 116, 121, 124, 126, 129, 130, 131, 175, - 0, 0, 25, 0, 0, -2, -2, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 67, -2, 71, 0, 51, 54, 56, 57, 144, + 41, 41, 41, 41, 0, 0, 0, 21, 22, 0, + 0, 0, 58, 0, 73, 74, 0, 79, 81, 0, + 86, 109, 0, 115, 0, 118, 123, 0, 40, 45, + 46, 42, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 65, 66, 180, 0, + 72, 19, 20, 23, 0, 52, 24, 0, 60, 62, + 64, 77, 0, 82, 0, 85, 171, 172, 173, 174, + 110, 113, 116, 117, 122, 125, 127, 130, 131, 132, + 176, 0, 0, 25, 0, 0, -2, -2, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 67, -2, 71, 0, 51, 54, 56, 57, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 59, 63, 78, 80, 83, 84, 0, - 0, 0, 176, 177, 43, 44, 47, 184, 48, 0, - -2, 70, 49, 0, 55, 61, 125, 178, 127, 0, - 68, 69, 50, 53, 128, + 165, 166, 167, 168, 59, 63, 78, 80, 83, 84, + 0, 0, 0, 177, 178, 43, 44, 47, 185, 48, + 0, -2, 70, 49, 0, 55, 61, 126, 179, 128, + 0, 68, 69, 50, 53, 129, } var yyTok1 = [...]int{ @@ -1421,77 +1428,77 @@ yydefault: { yyVAL.labels = yyDollar[1].labels } - case 108: + case 109: yyDollar = yyS[yypt-3 : yypt+1] //line generated_parser.y:542 { yyVAL.labels = labels.New(yyDollar[2].labels...) } - case 109: + case 110: yyDollar = yyS[yypt-4 : yypt+1] //line generated_parser.y:544 { yyVAL.labels = labels.New(yyDollar[2].labels...) } - case 110: + case 111: yyDollar = yyS[yypt-2 : yypt+1] //line generated_parser.y:546 { yyVAL.labels = labels.New() } - case 111: + case 112: yyDollar = yyS[yypt-0 : yypt+1] //line generated_parser.y:548 { yyVAL.labels = labels.New() } - case 112: + case 113: yyDollar = yyS[yypt-3 : yypt+1] //line generated_parser.y:552 { yyVAL.labels = append(yyDollar[1].labels, yyDollar[3].label) } - case 113: + case 114: yyDollar = yyS[yypt-1 : yypt+1] //line generated_parser.y:554 { yyVAL.labels = []labels.Label{yyDollar[1].label} } - case 114: + case 115: yyDollar = yyS[yypt-2 : yypt+1] //line generated_parser.y:556 { yylex.(*parser).unexpected("label set", "\",\" or \"}\"") yyVAL.labels = yyDollar[1].labels } - case 115: + case 116: yyDollar = yyS[yypt-3 : yypt+1] //line generated_parser.y:561 { yyVAL.label = labels.Label{Name: yyDollar[1].item.Val, Value: yylex.(*parser).unquoteString(yyDollar[3].item.Val)} } - case 116: + case 117: yyDollar = yyS[yypt-3 : yypt+1] //line generated_parser.y:563 { yylex.(*parser).unexpected("label set", "string") yyVAL.label = labels.Label{} } - case 117: + case 118: yyDollar = yyS[yypt-2 : yypt+1] //line generated_parser.y:565 { yylex.(*parser).unexpected("label set", "\"=\"") yyVAL.label = labels.Label{} } - case 118: + case 119: yyDollar = yyS[yypt-1 : yypt+1] //line generated_parser.y:567 { yylex.(*parser).unexpected("label set", "identifier or \"}\"") yyVAL.label = labels.Label{} } - case 119: + case 120: yyDollar = yyS[yypt-2 : yypt+1] //line generated_parser.y:575 { @@ -1500,38 +1507,38 @@ yydefault: values: yyDollar[2].series, } } - case 120: + case 121: yyDollar = yyS[yypt-0 : yypt+1] //line generated_parser.y:584 { yyVAL.series = []SequenceValue{} } - case 121: + case 122: yyDollar = yyS[yypt-3 : yypt+1] //line generated_parser.y:586 { yyVAL.series = append(yyDollar[1].series, yyDollar[3].series...) } - case 122: + case 123: yyDollar = yyS[yypt-2 : yypt+1] //line generated_parser.y:588 { yyVAL.series = yyDollar[1].series } - case 123: + case 124: yyDollar = yyS[yypt-1 : yypt+1] //line generated_parser.y:590 { yylex.(*parser).unexpected("series values", "") yyVAL.series = nil } - case 124: + case 125: yyDollar = yyS[yypt-1 : yypt+1] //line generated_parser.y:594 { yyVAL.series = []SequenceValue{{Omitted: true}} } - case 125: + case 126: yyDollar = yyS[yypt-3 : yypt+1] //line generated_parser.y:596 { @@ -1540,13 +1547,13 @@ yydefault: yyVAL.series = append(yyVAL.series, SequenceValue{Omitted: true}) } } - case 126: + case 127: yyDollar = yyS[yypt-1 : yypt+1] //line generated_parser.y:603 { yyVAL.series = []SequenceValue{{Value: yyDollar[1].float}} } - case 127: + case 128: yyDollar = yyS[yypt-3 : yypt+1] //line generated_parser.y:605 { @@ -1555,7 +1562,7 @@ yydefault: yyVAL.series = append(yyVAL.series, SequenceValue{Value: yyDollar[1].float}) } } - case 128: + case 129: yyDollar = yyS[yypt-4 : yypt+1] //line generated_parser.y:612 { @@ -1565,7 +1572,7 @@ yydefault: yyDollar[1].float += yyDollar[2].float } } - case 129: + case 130: yyDollar = yyS[yypt-1 : yypt+1] //line generated_parser.y:622 { @@ -1574,7 +1581,7 @@ yydefault: } yyVAL.float = math.Float64frombits(value.StaleNaN) } - case 174: + case 175: yyDollar = yyS[yypt-1 : yypt+1] //line generated_parser.y:653 { @@ -1583,25 +1590,25 @@ yydefault: PosRange: yyDollar[1].item.PositionRange(), } } - case 175: + case 176: yyDollar = yyS[yypt-1 : yypt+1] //line generated_parser.y:661 { yyVAL.float = yylex.(*parser).number(yyDollar[1].item.Val) } - case 176: + case 177: yyDollar = yyS[yypt-2 : yypt+1] //line generated_parser.y:663 { yyVAL.float = yyDollar[2].float } - case 177: + case 178: yyDollar = yyS[yypt-2 : yypt+1] //line generated_parser.y:664 { yyVAL.float = -yyDollar[2].float } - case 178: + case 179: yyDollar = yyS[yypt-1 : yypt+1] //line generated_parser.y:668 { @@ -1611,7 +1618,7 @@ yydefault: yylex.(*parser).addParseErrf(yyDollar[1].item.PositionRange(), "invalid repetition in series values: %s", err) } } - case 179: + case 180: yyDollar = yyS[yypt-1 : yypt+1] //line generated_parser.y:678 { @@ -1621,7 +1628,7 @@ yydefault: yylex.(*parser).addParseErr(yyDollar[1].item.PositionRange(), err) } } - case 180: + case 181: yyDollar = yyS[yypt-1 : yypt+1] //line generated_parser.y:689 { @@ -1630,13 +1637,13 @@ yydefault: PosRange: yyDollar[1].item.PositionRange(), } } - case 181: + case 182: yyDollar = yyS[yypt-0 : yypt+1] //line generated_parser.y:702 { yyVAL.duration = 0 } - case 183: + case 184: yyDollar = yyS[yypt-0 : yypt+1] //line generated_parser.y:706 { diff --git a/vendor/github.com/prometheus/prometheus/scrape/scrape.go b/vendor/github.com/prometheus/prometheus/scrape/scrape.go index 4c6d3bab00..3b792d4692 100644 --- a/vendor/github.com/prometheus/prometheus/scrape/scrape.go +++ b/vendor/github.com/prometheus/prometheus/scrape/scrape.go @@ -161,7 +161,7 @@ type scrapePool struct { appendable storage.Appendable logger log.Logger - mtx sync.RWMutex + mtx sync.Mutex config *config.ScrapeConfig client *http.Client // Targets and loops must always be synchronized to have the same @@ -1188,7 +1188,7 @@ loop: } // Increment added even if there's an error so we correctly report the - // number of samples remaining after relabelling. + // number of samples remaining after relabeling. added++ } diff --git a/vendor/github.com/prometheus/prometheus/tsdb/head.go b/vendor/github.com/prometheus/prometheus/tsdb/head.go index a21f5ad317..3b1d4ad057 100644 --- a/vendor/github.com/prometheus/prometheus/tsdb/head.go +++ b/vendor/github.com/prometheus/prometheus/tsdb/head.go @@ -1692,6 +1692,8 @@ func (h *Head) getOrCreateWithID(id, hash uint64, lset labels.Labels) (*memSerie h.metrics.seriesCreated.Inc() atomic.AddUint64(&h.numSeries, 1) + h.postings.Add(id, lset) + h.symMtx.Lock() defer h.symMtx.Unlock() @@ -1707,10 +1709,6 @@ func (h *Head) getOrCreateWithID(id, hash uint64, lset labels.Labels) (*memSerie h.symbols[l.Value] = struct{}{} } - // Postings should be set after setting the symbols (or after holding - // the symbol mtx) to avoid race during compaction of seeing partial symbols. - h.postings.Add(id, lset) - return s, true, nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index 099c9fa40e..d5fe3ddf68 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -528,7 +528,7 @@ github.com/prometheus/node_exporter/https github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util -# github.com/prometheus/prometheus v1.8.2-0.20200707115909-30505a202a4c +# github.com/prometheus/prometheus v1.8.2-0.20200711170716-492061b24c00 ## explicit github.com/prometheus/prometheus/config github.com/prometheus/prometheus/discovery