From f9ac8f8c98642fbfe9ae3159344bd4bcbf0f4816 Mon Sep 17 00:00:00 2001 From: Sam Calder-Mason Date: Wed, 6 Dec 2023 12:57:43 +1000 Subject: [PATCH 1/2] fix: Add client name to sage events --- example_sage.yaml | 2 ++ pkg/sage/config.go | 2 ++ pkg/sage/sage.go | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/example_sage.yaml b/example_sage.yaml index f55c6732..555247f6 100644 --- a/example_sage.yaml +++ b/example_sage.yaml @@ -2,6 +2,8 @@ logging: "debug" # panic,fatal,warn,info,debug,trace metricsAddr: ":9095" pprofAddr: ":6065" # optional. if supplied it enables pprof server +name: example-instance + armiarmaUrl: http://localhost:9099/events # workers is the number of workers to use for processing events. diff --git a/pkg/sage/config.go b/pkg/sage/config.go index c0a0f293..876e3a2e 100644 --- a/pkg/sage/config.go +++ b/pkg/sage/config.go @@ -17,6 +17,8 @@ type Config struct { PProfAddr *string `yaml:"pprofAddr"` // MetricsAddr is the address to server prometheus metrics on. MetricsAddr string `yaml:"metricsAddr" default:":9093"` + // Name is the name of the service. + Name string `yaml:"name" default:"xatu-sage"` // Outputs configuration Outputs []output.Config `yaml:"outputs"` // ArmiarmaURL configuration diff --git a/pkg/sage/sage.go b/pkg/sage/sage.go index 738260ab..38337ad3 100644 --- a/pkg/sage/sage.go +++ b/pkg/sage/sage.go @@ -245,7 +245,7 @@ func (a *Sage) createNewClientMeta(ctx context.Context) (*xatu.ClientMeta, error } return &xatu.ClientMeta{ - Name: "sage", + Name: a.config.Name, Version: xatu.Short(), Id: a.id.String(), Implementation: xatu.Implementation, From 06233dd91f0e7935d7d43249fa287181b6e2ee28 Mon Sep 17 00:00:00 2001 From: Sam Calder-Mason Date: Wed, 6 Dec 2023 14:39:53 +1000 Subject: [PATCH 2/2] fix: Use correct ethereum package --- pkg/sage/ethereum/beacon.go | 4 ++-- pkg/sage/ethereum/services/metadata.go | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/sage/ethereum/beacon.go b/pkg/sage/ethereum/beacon.go index 70fe0140..2ee6cf44 100644 --- a/pkg/sage/ethereum/beacon.go +++ b/pkg/sage/ethereum/beacon.go @@ -7,7 +7,7 @@ import ( "time" "github.com/ethpandaops/beacon/pkg/beacon" - "github.com/ethpandaops/xatu/pkg/sentry/ethereum/services" + "github.com/ethpandaops/xatu/pkg/sage/ethereum/services" "github.com/go-co-op/gocron" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -40,7 +40,7 @@ func NewBeaconNode(ctx context.Context, name string, config *Config, log logrus. Headers: config.BeaconNodeHeaders, }, "xatu_sentry", opts) - metadata := services.NewMetadataService(log, node) + metadata := services.NewMetadataService(log, node, config.OverrideNetworkName) duties := services.NewDutiesService(log, node, &metadata) svcs := []services.Service{ diff --git a/pkg/sage/ethereum/services/metadata.go b/pkg/sage/ethereum/services/metadata.go index ca97953d..12945a07 100644 --- a/pkg/sage/ethereum/services/metadata.go +++ b/pkg/sage/ethereum/services/metadata.go @@ -57,6 +57,13 @@ func (m *MetadataService) Start(ctx context.Context) error { return err } + m.log.WithFields(logrus.Fields{ + "genesis_time": m.Genesis.GenesisTime, + "network": m.Network.Name, + "deposit_chain_id": m.Spec.DepositChainID, + "config_name": m.Spec.ConfigName, + }).Info("Metadata is ready") + return nil }