Skip to content

Commit

Permalink
fix: follow up with doc fixes and config path creation (#1291)
Browse files Browse the repository at this point in the history
## Description

quick follow up for the last tracing PR
  • Loading branch information
evan-forbes authored Apr 9, 2024
1 parent 63cefe4 commit 0af1e15
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
7 changes: 4 additions & 3 deletions config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,10 @@ trace_type = "{{ .Instrumentation.TraceType }}"
# The size of the batches that are sent to the database.
trace_push_batch_size = {{ .Instrumentation.TraceBufferSize }}
# The list of tables that are updated when tracing. All available tables and
# their schema can be found in the pkg/trace/schema package. It is represented as a
# comma separate string. For example: "consensus_round_state,mempool_tx".
# The list of tables that are updated when tracing. Tables not included will
# not be traced. All available tables and their schema can be found in the
# pkg/trace/schema package. It is represented as a comma separate string.
# For example: "consensus_round_state,mempool_tx".
tracing_tables = "{{ .Instrumentation.TracingTables }}"
# The URL of the pyroscope instance to use for continuous profiling.
Expand Down
8 changes: 2 additions & 6 deletions pkg/trace/fileserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package trace
import (
"bufio"
"encoding/json"
"errors"
"fmt"
"io"
"mime"
Expand Down Expand Up @@ -177,12 +176,9 @@ type S3Config struct {
}

// readS3Config reads an S3Config from a file in the given directory.
func readS3Config(dir string) (S3Config, error) {
func readS3Config(path string) (S3Config, error) {
cfg := S3Config{}
f, err := os.Open(filepath.Join(dir, "s3.json"))
if errors.Is(err, os.ErrNotExist) {
return cfg, nil
}
f, err := os.Open(path)
if err != nil {
return cfg, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/trace/schema/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
MempoolTxTable = "mempool_tx"
)

// MemPoolTx describes the schema for the "mempool_tx" table.
// MempoolTx describes the schema for the "mempool_tx" table.
type MempoolTx struct {
TxHash string `json:"tx_hash"`
Peer p2p.ID `json:"peer"`
Expand Down

0 comments on commit 0af1e15

Please sign in to comment.