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: add boostd-data metrics #1784

Merged
merged 14 commits into from
Nov 1, 2023
Merged

feat: add boostd-data metrics #1784

merged 14 commits into from
Nov 1, 2023

Conversation

LexLuthr
Copy link
Collaborator

@LexLuthr LexLuthr commented Oct 27, 2023

Closes #1781

Pending tasks

  • Fix tests
  • Remove older dashboards
  • Fix boost-data dashboard
  • Explore if any other panels are required
  • Update grafana config to use a default dashboard
  • document all metrics and how can users scrape them
  • update docker monitoring docs
  • setup alertmanager X Deferred for a later PR
  • Add permanent storage for tempo and prometheus

The updated documents will be merged only after this PR is merged as some of the referenced files do no exist in the current main branch.

@LexLuthr LexLuthr marked this pull request as draft October 27, 2023 06:56
@LexLuthr LexLuthr requested review from nonsense and ischasny and removed request for nonsense and ischasny October 27, 2023 07:37
metrics/metrics.go Outdated Show resolved Hide resolved
@LexLuthr
Copy link
Collaborator Author

LexLuthr commented Oct 27, 2023

Booster-Bitswap Service metrics

 curl http://localhost:9696/metrics
# HELP booster_bitswap_info Boost service information
# TYPE booster_bitswap_info gauge
booster_bitswap_info{commit="+git.0741e86.dirty",node_type="booster-bitswap",version="2.1.0-rc2"} 1

Booster-HTTP service metrics

root@15ec3d838894:/app# curl http://localhost:7777/metrics
# HELP booster_http_info Boost service information
# TYPE booster_http_info gauge
booster_http_info{commit="+git.0741e86.dirty",node_type="booster-http",version="2.1.0-rc2"} 1

Boostd Service metrics

root@3926a0e5b9f6:/app# curl http://boost:1288/metrics
# HELP boost_info Boost service information
# TYPE boost_info gauge
boost_info{commit="+git.0741e86.dirty",node_type="boostd",version="2.1.0-rc2"} 1

Boostd-data service metrics

root@3926a0e5b9f6:/app# curl http://boost:8044/metrics
# HELP boostd_data_info Boost service information
# TYPE boostd_data_info gauge
boostd_data_info{commit="",node_type="boostd-data",version="2.1.0-rc2"} 1

Boostd-data method metrics

root@3926a0e5b9f6:/app# curl http://boost:8044/metrics
# HELP boostd_data_boostddata_success_next_pieces_to_check_count Counter of next pieces to check success
# TYPE boostd_data_boostddata_success_next_pieces_to_check_count counter
boostd_data_boostddata_success_next_pieces_to_check_count 13

Boostd API request duration metrics

root@3926a0e5b9f6:/app# curl http://boost:1288/metrics
# HELP boost_api_request_duration_ms Duration of API requests
# TYPE boost_api_request_duration_ms histogram
boost_api_request_duration_ms_bucket{api="boost",endpoint="OnlineBackup",le="0.01"} 0
.........
boost_api_request_duration_ms_sum{api="boost",endpoint="OnlineBackup"} 7.061916
boost_api_request_duration_ms_count{api="boost",endpoint="OnlineBackup"} 1

@LexLuthr LexLuthr marked this pull request as ready for review October 31, 2023 10:56
Comment on lines 183 to 184
ctxx := lcli.ReqContext(cctx)
var ctx context.Context
Copy link
Member

Choose a reason for hiding this comment

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

Nit, but you don't need ctxx and you don't need else statement

Suggested change
ctxx := lcli.ReqContext(cctx)
var ctx context.Context
ctx := lcli.ReqContext(cctx)


var offset, size uint64
qry := `SELECT BlockOffset, BlockSize FROM PieceBlockOffsetSize WHERE PieceCid = ? AND PayloadMultihash = ?`
err := s.session.Query(qry, pieceCid.Bytes(), hash).WithContext(ctx).Scan(&offset, &size)
if err != nil {
err = normalizePieceCidError(pieceCid, err)
stats.Record(s.ctx, metrics.FailureGetOffsetSizeCount.M(1))
Copy link
Member

Choose a reason for hiding this comment

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

Why do we increment twice that metric -- once here and once in the defer statement?


var offset, size uint64
qry := `SELECT BlockOffset, BlockSize FROM PieceBlockOffsetSize WHERE PieceCid = ? AND PayloadMultihash = ?`
err := s.session.Query(qry, pieceCid.Bytes(), hash).WithContext(ctx).Scan(&offset, &size)
if err != nil {
err = normalizePieceCidError(pieceCid, err)
stats.Record(s.ctx, metrics.FailureGetOffsetSizeCount.M(1))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
stats.Record(s.ctx, metrics.FailureGetOffsetSizeCount.M(1))

@LexLuthr LexLuthr merged commit 059e592 into main Nov 1, 2023
21 checks passed
@LexLuthr LexLuthr deleted the feat/boostd-data-metrics branch November 1, 2023 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Create metrics for boostd-data
2 participants