Skip to content

Commit

Permalink
Merge pull request #300 from SiaFoundation/bustedware/prometheus-updates
Browse files Browse the repository at this point in the history
Prometheus updates
  • Loading branch information
n8maninger authored Feb 8, 2024
2 parents 3767237 + 3749f0a commit 3ba5781
Show file tree
Hide file tree
Showing 5 changed files with 388 additions and 132 deletions.
13 changes: 7 additions & 6 deletions api/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (a *api) handleGETConsensusState(c jape.Context) {
}

func (a *api) handleGETSyncerAddr(c jape.Context) {
c.Encode(string(a.syncer.Address()))
a.writeResponse(c, http.StatusOK, SyncerAddrResp(a.syncer.Address()))
}

func (a *api) handleGETSyncerPeers(c jape.Context) {
Expand All @@ -110,7 +110,7 @@ func (a *api) handleGETSyncerPeers(c jape.Context) {
Version: peer.Version,
}
}
c.Encode(peers)
a.writeResponse(c, http.StatusOK, PeerResp(peers))
}

func (a *api) handlePUTSyncerPeer(c jape.Context) {
Expand All @@ -132,7 +132,7 @@ func (a *api) handleDeleteSyncerPeer(c jape.Context) {
}

func (a *api) handleGETAlerts(c jape.Context) {
c.Encode(a.alerts.Active())
a.writeResponse(c, http.StatusOK, AlertResp(a.alerts.Active()))
}

func (a *api) handlePOSTAlertsDismiss(c jape.Context) {
Expand Down Expand Up @@ -386,15 +386,16 @@ func (a *api) handleGETWalletTransactions(c jape.Context) {
if !a.checkServerError(c, "failed to get wallet transactions", err) {
return
}
c.Encode(transactions)

a.writeResponse(c, http.StatusOK, WalletTransactionsResp(transactions))
}

func (a *api) handleGETWalletPending(c jape.Context) {
pending, err := a.wallet.UnconfirmedTransactions()
if !a.checkServerError(c, "failed to get wallet pending", err) {
return
}
c.Encode(pending)
a.writeResponse(c, http.StatusOK, WalletPendingResp(pending))
}

func (a *api) handlePOSTWalletSend(c jape.Context) {
Expand Down Expand Up @@ -533,7 +534,7 @@ func (a *api) handlePUTSystemDir(c jape.Context) {
}

func (a *api) handleGETTPoolFee(c jape.Context) {
c.Encode(a.tpool.RecommendedFee())
a.writeResponse(c, http.StatusOK, TPoolResp(a.tpool.RecommendedFee()))
}

func (a *api) handleGETAccounts(c jape.Context) {
Expand Down
Loading

0 comments on commit 3ba5781

Please sign in to comment.