-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wire up the agent integration for the static converter (#5545)
* wire up the agent integration for the static converter Signed-off-by: erikbaranowski <[email protected]> --------- Signed-off-by: erikbaranowski <[email protected]>
- Loading branch information
1 parent
b5429c3
commit f4e6ac4
Showing
10 changed files
with
103 additions
and
11 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
26 changes: 26 additions & 0 deletions
26
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 |
---|---|---|
@@ -0,0 +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" | ||
) | ||
|
||
func (b *IntegrationsV1ConfigBuilder) 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)) | ||
} | ||
|
||
func toAgentExporter(config *agent_exporter.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
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,3 +1,2 @@ | ||
(Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. | ||
(Warning) The converter does not support converting the provided metrics wal_directory config: Use the run command flag --storage.path for Flow mode instead. | ||
(Error) The converter does not support converting the provided agent integration. | ||
(Warning) The converter does not support converting the provided metrics wal_directory config: Use the run command flag --storage.path for Flow mode instead. |
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
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