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

Add diagnostics endpoint for flags #7417

Merged
merged 4 commits into from
May 1, 2023
Merged

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented May 1, 2023

To expose context flags through diagnostic endpoint /debug/metrics/flags.

The current /debug/metrics/cmdline only provides the command run by user. In the case when user runs Erigon using config file, cmdline’s info does not truly reflect the ‘launch setting' and flags set that Erigon is running on.

Example

Command

erigon --datadir /tmp/data --config test.yaml

Pseudo config file (in yaml)

datadir : '/tmp/data'
chain : "sepolia"
http : true
metrics: true
private.api.addr : "localhost:9090"

http.api : ["eth","debug","net"]

Output

SUCCESS
chain=sepolia
config=test.yaml
datadir=/tmp/data
http=true
http.api=eth,debug,net
metrics=true
private.api.addr=localhost:9090

@AlexeyAkhunov
Copy link
Contributor

Thank you! Could you also modify diagnostics/version.go to increment Version variable, and add the comment about what changed in the version 2 (added metrics/flags).

@ensi321
Copy link
Contributor Author

ensi321 commented May 1, 2023

Thank you! Could you also modify diagnostics/version.go to increment Version variable, and add the comment about what changed in the version 2 (added metrics/flags).

I have added a changelog file specifically for diagnostics. Let me know if you think changelog is appropriate or just a small comment in version.go describing the change is enough.

I have noticed erigon support has a similar versioning system and it is currently at version 1 as well. Maybe we can sync up the version incrementing practice/procedure for these two places

@AlexeyAkhunov
Copy link
Contributor

I have noticed erigon support has a similar versioning system and it is currently at version 1 as well. Maybe we can sync up the version incrementing practice/procedure for these two places

Yes, erigon support has its own versioning and it is distinct from the versioning in the Erigon node, because it is possible to run Erigon node in one version, and erigon support in another, and we should be able to detect that and deal with it. However, I do not expect erigon support version change very often, because it simply provides the tunnel from the diagnostics system to the node, regardless of what metrics APIs are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants