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

[Access] Fixed REST API metrics #375

Merged
merged 9 commits into from
Jun 1, 2023
Merged

[Access] Fixed REST API metrics #375

merged 9 commits into from
Jun 1, 2023

Conversation

Guitarheroua
Copy link
Collaborator

onflow/flow-go#3971

Added modifications due to changes in rest server creation. Now it has one more argument RestMetrics.

@turbolent
Copy link
Member

turbolent commented May 15, 2023

Is it correct that this PR depends on onflow/flow-go#4288?

@Guitarheroua
Copy link
Collaborator Author

Is it correct that this PR depends on onflow/flow-go#4288?

Yes, this is correct.

Copy link
Contributor

@peterargue peterargue left a comment

Choose a reason for hiding this comment

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

this looks good from the AN side. Note: it will disable collecting rest server metrics

go.mod Outdated Show resolved Hide resolved
@bluesign
Copy link
Collaborator

this looks good from the AN side. Note: it will disable collecting rest server metrics

oh lets not disable please, waiting for it long time :) #226

debugLogger := zerolog.Logger{}
if debug {
debugLogger = zerolog.New(os.Stdout)
}

srv, err := rest.NewServer(backend.NewAdapter(be), fmt.Sprintf("%s:3333", host), debugLogger, chain)
restCollector := metrics.NewNoopCollector()
Copy link
Contributor

@peterargue peterargue May 17, 2023

Choose a reason for hiding this comment

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

sounds like @bluesign would these turned on by default

Suggested change
restCollector := metrics.NewNoopCollector()
restCollector := metrics.NewRestCollector(metricsProm.Config{Prefix: "access_rest_api"})

also needs to import metricsProm

Copy link
Contributor

Choose a reason for hiding this comment

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

not necessarily by default, but support an option to enable it

Copy link
Contributor

@peterargue peterargue May 17, 2023

Choose a reason for hiding this comment

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

that's fair, but fwiw it is enabled by default for grpc

grpcprometheus.Register(grpcServer)

sounds like we need a followup issue to make metrics configurable for both

Copy link
Contributor

Choose a reason for hiding this comment

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

We can separate this in another PR yeah.

go.sum Outdated Show resolved Hide resolved
@peterargue
Copy link
Contributor

peterargue commented May 30, 2023

@Guitarheroua looks like go.mod updates were still needed

@codecov-commenter
Copy link

Codecov Report

Merging #375 (fe89267) into master (228f755) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #375      +/-   ##
==========================================
+ Coverage   46.30%   46.31%   +0.01%     
==========================================
  Files          27       27              
  Lines        3555     3556       +1     
==========================================
+ Hits         1646     1647       +1     
  Misses       1766     1766              
  Partials      143      143              
Flag Coverage Δ
unittests 46.31% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/rest.go 27.50% <100.00%> (+1.85%) ⬆️
storage/remote/store.go 41.60% <100.00%> (ø)

@peterargue
Copy link
Contributor

@turbolent could you take one final look? I'm not a contributor to this repo and there was a change required for the flow-go version update.

Copy link
Contributor

@janezpodhostnik janezpodhostnik left a comment

Choose a reason for hiding this comment

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

approved, but check the typo I mentioned before merging

storage/redis/store.go Outdated Show resolved Hide resolved
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

@peterargue I don't really know anything about the changes here (FVM state vs snapshot, REST API / metrics), so leave review to who is knowledgeable

@durkmurder durkmurder merged commit 1b1b36a into onflow:master Jun 1, 2023
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.

8 participants