-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cmp_clarify_job
- Loading branch information
Showing
15 changed files
with
264 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,16 +12,16 @@ jobs: | |
- name: Update procedure | ||
if: github.repository != 'grafana/writers-toolkit' | ||
run: | | ||
BRANCH=update-make-docs | ||
git checkout -b "${BRANCH}" | ||
curl -s -Lo docs/docs.mk https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/docs.mk | ||
curl -s -Lo docs/make-docs https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/make-docs | ||
if git diff --exit-code; then exit 0; fi | ||
BRANCH="$(date +%Y-%m-%d)/update-make-docs" | ||
git checkout -b "${BRANCH}" | ||
git add . | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "grafanabot" | ||
git commit -m "Update \`make docs\` procedure" | ||
git push -v origin "refs/heads/${BRANCH}" | ||
gh pr create --fill | ||
gh pr create --fill || true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 11 additions & 11 deletions
22
converter/internal/staticconvert/internal/build/agent_exporter.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
package build | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/grafana/agent/component/discovery" | ||
"github.com/grafana/agent/component/prometheus/exporter/agent" | ||
"github.com/grafana/agent/converter/internal/common" | ||
agent_exporter "github.com/grafana/agent/pkg/integrations/agent" | ||
agent_exporter_v2 "github.com/grafana/agent/pkg/integrations/v2/agent" | ||
) | ||
|
||
func (b *IntegrationsConfigBuilder) appendAgentExporter(config *agent_exporter.Config) discovery.Exports { | ||
args := toAgentExporter(config) | ||
compLabel := common.LabelForParts(b.globalCtx.LabelPrefix, config.Name()) | ||
b.f.Body().AppendBlock(common.NewBlockWithOverride( | ||
[]string{"prometheus", "exporter", "agent"}, | ||
compLabel, | ||
args, | ||
)) | ||
|
||
return common.NewDiscoveryExports(fmt.Sprintf("prometheus.exporter.agent.%s.targets", compLabel)) | ||
return b.appendExporterBlock(args, config.Name(), "agent") | ||
} | ||
|
||
func toAgentExporter(config *agent_exporter.Config) *agent.Arguments { | ||
return &agent.Arguments{} | ||
} | ||
|
||
func (b *IntegrationsConfigBuilder) appendAgentExporterV2(config *agent_exporter_v2.Config) discovery.Exports { | ||
args := toAgentExporterV2(config) | ||
return b.appendExporterBlock(args, config.Name(), "agent") | ||
} | ||
|
||
func toAgentExporterV2(config *agent_exporter_v2.Config) *agent.Arguments { | ||
return &agent.Arguments{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
prometheus.remote_write "metrics_default" { | ||
endpoint { | ||
name = "default-8be96f" | ||
url = "http://localhost:9009/api/prom/push" | ||
|
||
queue_config { } | ||
|
||
metadata_config { } | ||
} | ||
} | ||
|
||
prometheus.exporter.agent "integrations_agent" { } | ||
|
||
discovery.relabel "integrations_agent" { | ||
targets = prometheus.exporter.agent.integrations_agent.targets | ||
|
||
rule { | ||
source_labels = ["__address__"] | ||
target_label = "test_label" | ||
replacement = "test_label_value" | ||
} | ||
|
||
rule { | ||
source_labels = ["__address__"] | ||
target_label = "test_label_2" | ||
replacement = "test_label_value_2" | ||
} | ||
} | ||
|
||
prometheus.scrape "integrations_agent" { | ||
targets = discovery.relabel.integrations_agent.output | ||
forward_to = [prometheus.remote_write.metrics_default.receiver] | ||
job_name = "integrations/agent" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
converter/internal/staticconvert/testdata-v2/missing_metrics_config.diags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(Critical) integration agent is looking for an undefined metrics config: not_default | ||
(Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. |
12 changes: 12 additions & 0 deletions
12
converter/internal/staticconvert/testdata-v2/missing_metrics_config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
metrics: | ||
global: | ||
remote_write: | ||
- url: http://localhost:9009/api/prom/push | ||
configs: | ||
- name: default | ||
|
||
integrations: | ||
agent: | ||
instance: "default" | ||
autoscrape: | ||
metrics_instance: "not_default" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.