-
Notifications
You must be signed in to change notification settings - Fork 396
feat(telemetry): Add url data to operator updates on telemetry service #1136
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
Merged
Merged
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
475b43a
chore: initial telemetry api setup
JuArce 4bd1025
chore: verify signature from operator
JuArce 2df7f20
refactor: add comments to signature_verifier.ex
JuArce 74757b8
chore: update operator endpoint
JuArce 7c8413e
chore: add targets
JuArce c63f797
docs: update README.md
JuArce d53b6ae
chore: update Makefile
JuArce d0ccfa9
feat: create and finish traces for specified merkle root
JuArce 9561780
feat(tracker): update operators' version if they already exist (#1070)
avilagaston9 7bac49f
feat: add operator identity check on registry manager contract before…
JulianVentura c796740
feat(telemetry): modify the aggregator to use the elixir Tracker (#1105)
avilagaston9 54eb9fb
feat: Add operators data fetch at startup (#1108)
JulianVentura 2b6d382
Merge branch 'refs/heads/998-refactortracker-rewrite-operator_tracker…
JuArce b99b9bf
Merge branch 'refs/heads/staging' into 998-refactortracker-rewrite-op…
JuArce 335a448
Merge branch 'refs/heads/998-refactortracker-rewrite-operator_tracker…
JuArce 49b9646
chore: upload mix lock
JuArce f60ebf1
fix: parse operator id correctly
JuArce 948565c
Merge branch 'refs/heads/998-refactortracker-rewrite-operator_tracker…
JuArce fca58d2
Add operators url data update
57e0776
fix: encode address to lowercase
JuArce 8da05e6
nit
JuArce 6b71469
feat(telemetry): add operators details on OperatorResponse event (#1135)
JuArce a659000
Add api key filtering from operator url report to telemetry
b13eab8
Create new database migration keeping reverting changes on the last one
12c391c
Merge
4b15e43
feat(telemetry): add event showing missing operators (#1145)
avilagaston9 fc00cc5
nit
JuArce 79ac895
Merge branch 'refs/heads/998-refactortracker-rewrite-operator_tracker…
JuArce fdc9bc1
feat: show quorum percentage on traces (#1143)
JuArce 7c23219
fix: address comments
avilagaston9 7138c28
nit
JuArce 365616b
Add operators data periodic fetcher
2b9faab
Add operator test on BaseUrlOnly function
dd905f6
Remove endpoint json body keys requirement
4e66b2b
Format golang operator code
8af8c2f
Merge
3d47d50
docs: add telemetry_create_env to readme
avilagaston9 e911d64
refactor: remove dead code
avilagaston9 d6dedbd
refactor: rename clean_list_errors to check_list_status
avilagaston9 4bf7a57
Merge
b58580e
refactor: change how we invoke get_operator_state
avilagaston9 2b5c22b
refactor: improve tracker error handling (#1141)
avilagaston9 46fa064
add telemetry_run_db to telemetry_start target
avilagaston9 42dc801
Fix operator_fetcher error message and method name
abd3690
feat: Add operators data periodic fetcher (#1152)
avilagaston9 d58c300
chore: use port 4001 instead of 4000
JuArce 4a1578a
chore: disable dashboard
JuArce aa43de0
fix: telemetry dump db
JuArce 6321a6a
Merge branch 'refs/heads/998-refactortracker-rewrite-operator_tracker…
JuArce e50f17b
Fix typo
Oppen 6d977da
fix: update tracker port for the aggregator
avilagaston9 6aa94d7
Merge branch 'staging' into 1075-feattelemetry-implement-telemetry-fo…
avilagaston9 933b21f
fix: merge
avilagaston9 0715560
fix: aggregator
avilagaston9 4ad650e
fix: race condition on tracker
avilagaston9 f4db582
fix: format issues
avilagaston9 1f3d1c8
fix: add missing alias
avilagaston9 8c280c3
Merge branch '1075-feattelemetry-implement-telemetry-for-aggregator' …
c61c980
Solve requested changes
ed73a77
Merge branch 'staging' into feat/telemetry-operator-url-data
0fb9f21
Fix formatting
7d45fe9
Merge branch 'staging' into feat/telemetry-operator-url-data
c2183ff
Update eigenlayer-middleware submodule pointer
7cf92ea
refactor: move utils file into the operator pkg
avilagaston9 fac4ced
refactor: restore update_operator
avilagaston9 cecebc2
Merge branch 'staging' into feat/telemetry-operator-url-data
avilagaston9 c2ee08c
refactor: remove unused functions
avilagaston9 f02d279
refactor: remove unused alias
avilagaston9 6414762
feat: handle urls with long path
avilagaston9 f05310f
refactor: make sendTelemetryData an operator method
avilagaston9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,33 @@ | ||
| package operator | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "regexp" | ||
| "strings" | ||
| ) | ||
|
|
||
| func BaseUrlOnly(input string) (string, error) { | ||
| // Define a regex pattern to match the URL format | ||
| // The pattern captures the scheme, host, and path | ||
| pattern := `^(?P<scheme>[^:]+)://(?P<host>[^/]+)(?P<path>/.*)?$` | ||
| re := regexp.MustCompile(pattern) | ||
|
|
||
| matches := re.FindStringSubmatch(input) | ||
|
|
||
| if matches == nil { | ||
| return "", fmt.Errorf("invalid URL: %s", input) | ||
| } | ||
|
|
||
| host := matches[2] | ||
| path := matches[3] | ||
|
|
||
| // If the path is not empty, append the path without the last segment (api_key) | ||
| if path != "" { | ||
| pathSegments := strings.Split(path, "/") | ||
| if len(pathSegments) > 1 { | ||
| return host + strings.Join(pathSegments[:len(pathSegments)-1], "/"), nil | ||
| } | ||
| } | ||
|
|
||
| return host, nil | ||
| } |
This file contains hidden or 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,47 @@ | ||
| package operator | ||
|
|
||
| import ( | ||
| "testing" | ||
| ) | ||
|
|
||
| func TestBaseUrlOnlyHappyPath(t *testing.T) { | ||
| // Format "<protocol>://<base_url>/<api_key>" | ||
|
|
||
| urls := [...][2]string{ | ||
| {"http://localhost:8545/asdfoij2a7831has89%342jddav98j2748", "localhost:8545"}, | ||
| {"ws://test.com/23r2f98hkjva0udhvi1j%342jddav98j2748", "test.com"}, | ||
| {"http://localhost:8545", "localhost:8545"}, | ||
| {"https://myservice.com/holesky/ApiKey", "myservice.com/holesky"}, | ||
| } | ||
|
|
||
| for _, pair := range urls { | ||
| url := pair[0] | ||
| expectedBaseUrl := pair[1] | ||
|
|
||
| baseUrl, err := BaseUrlOnly(url) | ||
|
|
||
| if err != nil { | ||
| t.Errorf("Unexpected error for URL %s: %v", url, err) | ||
| } | ||
|
|
||
| if baseUrl != expectedBaseUrl { | ||
| t.Errorf("Expected base URL %s, got %s for URL %s", expectedBaseUrl, baseUrl, url) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| func TestBaseUrlOnlyFailureCases(t *testing.T) { | ||
|
|
||
| urls := [...]string{ | ||
| "localhost:8545/asdfoij2a7831has89%342jddav98j2748", | ||
| "this-is-all-wrong", | ||
| } | ||
|
|
||
| for _, url := range urls { | ||
| baseUrl, err := BaseUrlOnly(url) | ||
|
|
||
| if err == nil { | ||
| t.Errorf("An error was expected, but received %s", baseUrl) | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
12 changes: 12 additions & 0 deletions
12
telemetry_api/priv/repo/migrations/20241002135112_add_operator_url_data.exs
This file contains hidden or 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,12 @@ | ||
| defmodule TelemetryApi.Repo.Migrations.AddOperatorUrlData do | ||
| use Ecto.Migration | ||
|
|
||
| def change do | ||
| alter table(:operators) do | ||
| add :eth_rpc_url, :string | ||
| add :eth_rpc_url_fallback, :string | ||
| add :eth_ws_url, :string | ||
| add :eth_ws_url_fallback, :string | ||
| end | ||
| end | ||
| end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.