Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

PMM-9510 Remove tail from job #994

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/victoriametrics/scrape_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func jobNameMapping(r rune) rune {
}

func jobName(agent *models.Agent, intervalName string, interval time.Duration) string {
return fmt.Sprintf("%s%s_%s-%s", agent.AgentType, strings.Map(jobNameMapping, agent.AgentID), intervalName, interval)
return fmt.Sprintf("%s%s_%s", agent.AgentType, strings.Map(jobNameMapping, agent.AgentID), intervalName)
}

func httpClientConfig(agent *models.Agent) config.HTTPClientConfig {
Expand Down
42 changes: 21 additions & 21 deletions services/victoriametrics/scrape_configs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestScrapeConfig(t *testing.T) {
}

expected := []*config.ScrapeConfig{{
JobName: "node_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr-5s",
JobName: "node_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr",
ScrapeInterval: config.Duration(s.HR),
ScrapeTimeout: scrapeTimeout(s.HR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -99,7 +99,7 @@ func TestScrapeConfig(t *testing.T) {
"vmstat",
}},
}, {
JobName: "node_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr-5s",
JobName: "node_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr",
ScrapeInterval: config.Duration(s.MR),
ScrapeTimeout: scrapeTimeout(s.MR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -128,7 +128,7 @@ func TestScrapeConfig(t *testing.T) {
"textfile.mr",
}},
}, {
JobName: "node_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr-1m0s",
JobName: "node_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr",
ScrapeInterval: config.Duration(s.LR),
ScrapeTimeout: scrapeTimeout(s.LR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -189,7 +189,7 @@ func TestScrapeConfig(t *testing.T) {
}

expected := []*config.ScrapeConfig{{
JobName: "node_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr-5s",
JobName: "node_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr",
ScrapeInterval: config.Duration(s.HR),
ScrapeTimeout: scrapeTimeout(s.HR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -258,7 +258,7 @@ func TestScrapeConfig(t *testing.T) {
}

expected := []*config.ScrapeConfig{{
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr-5s",
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr",
ScrapeInterval: config.Duration(s.HR),
ScrapeTimeout: scrapeTimeout(s.HR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -292,7 +292,7 @@ func TestScrapeConfig(t *testing.T) {
"standard.process",
}},
}, {
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr-5s",
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr",
ScrapeInterval: config.Duration(s.MR),
ScrapeTimeout: scrapeTimeout(s.MR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -331,7 +331,7 @@ func TestScrapeConfig(t *testing.T) {
"slave_status",
}},
}, {
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr-1m0s",
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr",
ScrapeInterval: config.Duration(s.LR),
ScrapeTimeout: scrapeTimeout(s.LR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -411,7 +411,7 @@ func TestScrapeConfig(t *testing.T) {
}

expected := []*config.ScrapeConfig{{
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr-5s",
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr",
ScrapeInterval: config.Duration(s.HR),
ScrapeTimeout: scrapeTimeout(s.HR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -444,7 +444,7 @@ func TestScrapeConfig(t *testing.T) {
"standard.process",
}},
}, {
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr-5s",
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr",
ScrapeInterval: config.Duration(s.MR),
ScrapeTimeout: scrapeTimeout(s.MR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -481,7 +481,7 @@ func TestScrapeConfig(t *testing.T) {
"slave_status",
}},
}, {
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr-1m0s",
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr",
ScrapeInterval: config.Duration(s.LR),
ScrapeTimeout: scrapeTimeout(s.LR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -557,7 +557,7 @@ func TestScrapeConfig(t *testing.T) {
}

expected := []*config.ScrapeConfig{{
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr-5s",
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr",
ScrapeInterval: config.Duration(s.HR),
ScrapeTimeout: scrapeTimeout(s.HR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -588,7 +588,7 @@ func TestScrapeConfig(t *testing.T) {
"standard.process",
}},
}, {
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr-5s",
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr",
ScrapeInterval: config.Duration(s.MR),
ScrapeTimeout: scrapeTimeout(s.MR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -623,7 +623,7 @@ func TestScrapeConfig(t *testing.T) {
"slave_status",
}},
}, {
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr-1m0s",
JobName: "mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr",
ScrapeInterval: config.Duration(s.LR),
ScrapeTimeout: scrapeTimeout(s.LR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -714,7 +714,7 @@ func TestScrapeConfig(t *testing.T) {

expected := []*config.ScrapeConfig{
{
JobName: "mongodb_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr-5s",
JobName: "mongodb_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr",
ScrapeInterval: config.Duration(s.HR),
ScrapeTimeout: scrapeTimeout(s.HR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -744,7 +744,7 @@ func TestScrapeConfig(t *testing.T) {
}},
},
}, {
JobName: "mongodb_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr-1m0s",
JobName: "mongodb_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr",
ScrapeInterval: config.Duration(s.LR),
ScrapeTimeout: scrapeTimeout(s.LR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -832,7 +832,7 @@ func TestScrapeConfig(t *testing.T) {
}

expected := []*config.ScrapeConfig{{
JobName: "postgres_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr-5s",
JobName: "postgres_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr",
ScrapeInterval: config.Duration(s.HR),
ScrapeTimeout: scrapeTimeout(s.HR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -864,7 +864,7 @@ func TestScrapeConfig(t *testing.T) {
"standard.go",
}},
}, {
JobName: "postgres_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr-5s",
JobName: "postgres_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr",
ScrapeInterval: config.Duration(s.MR),
ScrapeTimeout: scrapeTimeout(s.MR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -894,7 +894,7 @@ func TestScrapeConfig(t *testing.T) {
"custom_query.mr",
}},
}, {
JobName: "postgres_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr-1m0s",
JobName: "postgres_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr",
ScrapeInterval: config.Duration(s.LR),
ScrapeTimeout: scrapeTimeout(s.LR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -976,7 +976,7 @@ func TestScrapeConfig(t *testing.T) {
}

expected := []*config.ScrapeConfig{{
JobName: "proxysql_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr-5s",
JobName: "proxysql_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr",
ScrapeInterval: config.Duration(s.HR),
ScrapeTimeout: scrapeTimeout(s.HR),
MetricsPath: "/metrics",
Expand Down Expand Up @@ -1158,7 +1158,7 @@ func TestScrapeConfig(t *testing.T) {
}

expected := []*config.ScrapeConfig{{
JobName: "external-exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr-5s",
JobName: "external-exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr",
ScrapeInterval: config.Duration(s.HR),
ScrapeTimeout: scrapeTimeout(s.HR),
ServiceDiscoveryConfig: config.ServiceDiscoveryConfig{
Expand Down Expand Up @@ -1206,7 +1206,7 @@ func TestScrapeConfig(t *testing.T) {
}

expected := []*config.ScrapeConfig{{
JobName: "external-exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr-5s",
JobName: "external-exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr",
ScrapeInterval: config.Duration(s.HR),
ScrapeTimeout: scrapeTimeout(s.HR),
MetricsPath: "/some-metric-path",
Expand Down
24 changes: 12 additions & 12 deletions services/victoriametrics/victoriametrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ scrape_configs:
- 127.0.0.1:9933
labels:
instance: pmm-server
- job_name: mongodb_exporter_agent_id_cfec996c-4fe6-41d9-83cb-e1a3b1fe10a8_hr-5s
- job_name: mongodb_exporter_agent_id_cfec996c-4fe6-41d9-83cb-e1a3b1fe10a8_hr
honor_timestamps: false
scrape_interval: 5s
scrape_timeout: 4500ms
Expand All @@ -341,7 +341,7 @@ scrape_configs:
basic_auth:
username: pmm
password: /agent_id/cfec996c-4fe6-41d9-83cb-e1a3b1fe10a8
- job_name: mongodb_exporter_agent_id_ecd8995a-d479-4b4d-bfb7-865bac4ac2fb_hr-5s
- job_name: mongodb_exporter_agent_id_ecd8995a-d479-4b4d-bfb7-865bac4ac2fb_hr
honor_timestamps: false
params:
collect[]:
Expand Down Expand Up @@ -370,7 +370,7 @@ scrape_configs:
basic_auth:
username: pmm
password: /agent_id/ecd8995a-d479-4b4d-bfb7-865bac4ac2fb
- job_name: mongodb_exporter_agent_id_ecd8995a-d479-4b4d-bfb7-865bac4ac2fb_lr-1m0s
- job_name: mongodb_exporter_agent_id_ecd8995a-d479-4b4d-bfb7-865bac4ac2fb_lr
honor_timestamps: false
params:
collect[]:
Expand Down Expand Up @@ -399,7 +399,7 @@ scrape_configs:
basic_auth:
username: pmm
password: /agent_id/ecd8995a-d479-4b4d-bfb7-865bac4ac2fb
- job_name: mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr-5s
- job_name: mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_hr
honor_timestamps: false
params:
collect[]:
Expand Down Expand Up @@ -430,7 +430,7 @@ scrape_configs:
basic_auth:
username: pmm
password: /agent_id/75bb30d3-ef4a-4147-97a8-621a996611dd
- job_name: mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr-10s
- job_name: mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_mr
honor_timestamps: false
params:
collect[]:
Expand Down Expand Up @@ -466,7 +466,7 @@ scrape_configs:
basic_auth:
username: pmm
password: /agent_id/75bb30d3-ef4a-4147-97a8-621a996611dd
- job_name: mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr-1m0s
- job_name: mysqld_exporter_agent_id_75bb30d3-ef4a-4147-97a8-621a996611dd_lr
honor_timestamps: false
params:
collect[]:
Expand Down Expand Up @@ -507,7 +507,7 @@ scrape_configs:
basic_auth:
username: pmm
password: /agent_id/75bb30d3-ef4a-4147-97a8-621a996611dd
- job_name: mysqld_exporter_agent_id_f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a_hr-5s
- job_name: mysqld_exporter_agent_id_f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a_hr
honor_timestamps: false
params:
collect[]:
Expand Down Expand Up @@ -538,7 +538,7 @@ scrape_configs:
basic_auth:
username: pmm
password: /agent_id/f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a
- job_name: mysqld_exporter_agent_id_f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a_mr-10s
- job_name: mysqld_exporter_agent_id_f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a_mr
honor_timestamps: false
params:
collect[]:
Expand Down Expand Up @@ -574,7 +574,7 @@ scrape_configs:
basic_auth:
username: pmm
password: /agent_id/f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a
- job_name: mysqld_exporter_agent_id_f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a_lr-1m0s
- job_name: mysqld_exporter_agent_id_f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a_lr
honor_timestamps: false
params:
collect[]:
Expand Down Expand Up @@ -615,7 +615,7 @@ scrape_configs:
basic_auth:
username: pmm
password: /agent_id/f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a
- job_name: postgres_exporter_agent_id_29e14468-d479-4b4d-bfb7-4ac2fb865bac_hr-5s
- job_name: postgres_exporter_agent_id_29e14468-d479-4b4d-bfb7-4ac2fb865bac_hr
honor_timestamps: false
params:
collect[]:
Expand Down Expand Up @@ -646,7 +646,7 @@ scrape_configs:
username: pmm
password: /agent_id/29e14468-d479-4b4d-bfb7-4ac2fb865bac
stream_parse: true
- job_name: postgres_exporter_agent_id_29e14468-d479-4b4d-bfb7-4ac2fb865bac_mr-10s
- job_name: postgres_exporter_agent_id_29e14468-d479-4b4d-bfb7-4ac2fb865bac_mr
honor_timestamps: false
params:
collect[]:
Expand Down Expand Up @@ -674,7 +674,7 @@ scrape_configs:
username: pmm
password: /agent_id/29e14468-d479-4b4d-bfb7-4ac2fb865bac
stream_parse: true
- job_name: postgres_exporter_agent_id_29e14468-d479-4b4d-bfb7-4ac2fb865bac_lr-1m0s
- job_name: postgres_exporter_agent_id_29e14468-d479-4b4d-bfb7-4ac2fb865bac_lr
honor_timestamps: false
params:
collect[]:
Expand Down