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
2 changes: 2 additions & 0 deletions framework/.changeset/v0.10.24.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- On chain metrics scrape targets
- Allow to specify custom names for blockchain containers
9 changes: 5 additions & 4 deletions framework/components/blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ const (
// Input is a blockchain network configuration params
type Input struct {
// Common EVM fields
Type string `toml:"type" validate:"required,oneof=anvil geth besu solana aptos tron sui ton" envconfig:"net_type"`
Image string `toml:"image"`
PullImage bool `toml:"pull_image"`
Port string `toml:"port"`
Type string `toml:"type" validate:"required,oneof=anvil geth besu solana aptos tron sui ton" envconfig:"net_type"`
Image string `toml:"image"`
PullImage bool `toml:"pull_image"`
Port string `toml:"port"`
ContainerName string `toml:"container_name"`
// Not applicable to Solana, ws port for Solana is +1 of port
WSPort string `toml:"port_ws"`
ChainID string `toml:"chain_id"`
Expand Down
3 changes: 3 additions & 0 deletions framework/components/blockchain/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const (

func baseRequest(in *Input, useWS ExposeWs) testcontainers.ContainerRequest {
containerName := framework.DefaultTCName("blockchain-node")
if in.ContainerName != "" {
containerName = in.ContainerName
}
bindPort := fmt.Sprintf("%s/tcp", in.Port)
exposedPorts := []string{bindPort}
if useWS {
Expand Down
5 changes: 5 additions & 0 deletions framework/observability/compose/conf/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ global:
scrape_interval: 10s

scrape_configs:
- job_name: 'on-chain-metrics'
metrics_path: /on-chain-metrics
scrape_interval: 2s
static_configs:
- targets: [ 'host.docker.internal:9112', '172.17.0.1:9112']
- job_name: 'otel-collector'
scrape_interval: 10s
static_configs:
Expand Down
Loading