Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Main Metrics Readme #278

Merged
merged 5 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
Binary file added assets/side_car_aggregated_price.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/side_car_aggregated_price_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/side_car_api_http_status_code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/side_car_provider_price.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/side_car_provider_price_coinbase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions cmd/config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ var (
// ----------------------Metrics Config----------------------- //
// ----------------------------------------------------------- //
Metrics: config.MetricsConfig{},
UpdateInterval: 1500 * time.Millisecond,
UpdateInterval: 500 * time.Millisecond,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lowering the interval since dYdX block time is less than 1s

MaxPriceAge: 2 * time.Minute,
Providers: []config.ProviderConfig{
// ----------------------------------------------------------- //
Expand Down Expand Up @@ -284,7 +284,7 @@ func init() {
&updateInterval,
"update-interval",
"",
1500*time.Millisecond,
500*time.Millisecond,
"interval at which the oracle will update the prices. this should be set to the interval desired by the chain.",
)
rootCmd.Flags().DurationVarP(
Expand Down
9 changes: 9 additions & 0 deletions cmd/oracle/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ func runOracle() error {
}
}

logger.Info(
"successfully read in configs",
zap.String("oracle_config_path", oracleCfgPath),
zap.String("market_config_path", marketCfgPath),
)

metrics := oraclemetrics.NewMetricsFromConfig(cfg.Metrics)

// Define the orchestrator and oracle options. These determine how the orchestrator and oracle are created & executed.
Expand All @@ -152,6 +158,8 @@ func runOracle() error {

orchestratorOpts = append(orchestratorOpts, customOrchestratorOps...)
oracleOpts = append(oracleOpts, customOracleOpts...)
} else {
logger.Warn("no custom orchestrator or oracle options for chain; running default version")
}

// Create the orchestrator and start the orchestrator.
Expand Down Expand Up @@ -227,6 +235,7 @@ func dydxOptions(
metrics oraclemetrics.Metrics,
) ([]orchestrator.Option, []oracle.Option, error) {
// dYdX uses the median index price aggregation strategy.
logger.Info("running dYdX sidecar; adding custom options for orchestrator and oracle")
aggregator, err := oraclemath.NewMedianAggregator(
logger,
marketCfg,
Expand Down
4 changes: 2 additions & 2 deletions config/dydx/oracle.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"updateInterval": 1500000000,
"updateInterval": 500000000,
"maxPriceAge": 120000000000,
"providers": [
{
Expand Down Expand Up @@ -401,7 +401,7 @@
"reconnectTimeout": 2000000000,
"maxQueries": 1,
"atomic": true,
"url": "localhost:1317",
"url": "https://dydx-api.polkachu.com",
"name": "dydx_api"
},
"webSocket": {
Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ services:
context: .
dockerfile: contrib/images/slinky.sidecar.e2e.Dockerfile
volumes:
- ./config/local/oracle.json:/oracle/oracle.json
- ./config/local/market.json:/oracle/market.json
- ./config/dydx/oracle.json:/oracle/oracle.json
- ./config/dydx/market.json:/oracle/market.json
Comment on lines +13 to +14
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the docker-compose used in again? e2e tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing, just running locally

entrypoint: [
"oracle",
"--oracle-config-path", "/etc/slinky/default_config/oracle.json",
"--market-config-path", "/etc/slinky/default_config/market.json",
"--chain-id", "dydx-mainnet-1",
"--pprof-port", "6060",
"--run-pprof", "true",
"--run-pprof",
]
ports:
- "8080:8080" # main oracle port
Expand Down
241 changes: 241 additions & 0 deletions metrics.md

Large diffs are not rendered by default.

73 changes: 0 additions & 73 deletions oracle/metrics/README.md

This file was deleted.

68 changes: 0 additions & 68 deletions providers/base/api/metrics/README.md

This file was deleted.

101 changes: 0 additions & 101 deletions providers/base/metrics/README.md

This file was deleted.

Loading
Loading