Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
31 changes: 21 additions & 10 deletions cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,23 @@ func getNetworkConfig(network string) networksConfig.NetworkConfig {
return networksConfig.NewSSVConfig()
// Add cases for other networks here
default:
log.Fatalf("Unsupported network: %s", network)
LoadNetworkConfig()
return nil
// log.Fatalf("Unsupported network: %s", network)
// return nil
}
}

func generateFullConfig(config TelescopeConfig, networkScrapeConfigs []networksConfig.ScrapeConfig) Config {
cNetwork := viper.GetString("network")
cProjectId := viper.GetString("project-id")
cProjectName := viper.GetString("project-name")
cTelescopeUsername := viper.GetString("telescope-username")
cTelescopePassword := viper.GetString("telescope-password")
cRemoteWriteUrl := viper.GetString("remote-write-url")
// isEnableLogs := viper.GetString("enable-logs")
// cLogSinkURL := viper.GetString("logs-sink-url")

// Convert networksConfig.ScrapeConfig to local ScrapeConfig
scrapeConfigs := make([]ScrapeConfig, len(networkScrapeConfigs))
for i, nsc := range networkScrapeConfigs {
Expand All @@ -211,22 +222,22 @@ func generateFullConfig(config TelescopeConfig, networkScrapeConfigs []networksC
Global: GlobalConfig{
ScrapeInterval: "15s",
ExternalLabels: map[string]string{
"project_id": config.ProjectId,
"project_name": config.ProjectName,
"project_id": cProjectId,
"project_name": cProjectName,
},
RemoteWrite: []RemoteWrite{
{
URL: config.RemoteWriteUrl,
URL: cRemoteWriteUrl,
BasicAuth: map[string]string{
"username": config.TelescopeUsername,
"password": config.TelescopePassword,
"username": cTelescopeUsername,
"password": cTelescopePassword,
},
},
},
},
Configs: []MetricConfig{
{
Name: toLowerAndEscape(config.ProjectName + "_" + config.Network + "_metrics"),
Name: toLowerAndEscape(cProjectName + "_" + cNetwork + "_metrics"),
HostFilter: false,
ScrapeConfigs: scrapeConfigs,
},
Expand Down Expand Up @@ -514,9 +525,9 @@ func main() {

network = viper.GetString("network")
projectName := viper.GetString("project-name")
if network == "" {
log.Fatal("Unsupported network: network argument is missing")
}
// if network == "" {
// log.Fatal("Unsupported network: network argument is missing")
// }
networkConfig := getNetworkConfig(network)

fmt.Println("Starting Telescope Agent", networkConfig)
Expand Down
5 changes: 5 additions & 0 deletions internal/static/config/networks/ssv.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ package networks

import (
"fmt"
// "github.com/ethpandaops/beacon/pkg/beacon"
// "github.com/ethpandaops/ethereum-metrics-exporter/pkg/exporter/execution"
// "github.com/prometheus/client_golang/prometheus/promhttp"
// "github.com/sirupsen/logrus"

)

type NodeConfig struct {
Expand Down
12 changes: 6 additions & 6 deletions telescope_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ metrics:
global:
scrape_interval: 15s
external_labels:
project_id: ""
project_name: ""
project_id: calvin-454
project_name: frtejd6
remote_write:
- url: ""
- url: https://thanos-receiver.blockops.network/api/v1/receive
basic_auth:
password: ""
username: ""
password: test
username: dsssds
wal_directory: /tmp/telescope
configs:
- name: __metrics
- name: frtejd6_ssv_metrics
host_filter: false
scrape_configs:
- job_name: ssv_client_execution
Expand Down