@@ -68,6 +68,9 @@ func NewCTStorage(logStorage *tessera.Appender, issuerStorage IssuerStorage, ded
68
68
69
69
// Add stores CT entries.
70
70
func (cts * CTStorage ) Add (ctx context.Context , entry * ctonly.Entry ) tessera.IndexFuture {
71
+ ctx , span := tracer .Start (ctx , "tesseract.storage.Add" )
72
+ defer span .End ()
73
+
71
74
// TODO(phboneff): add deduplication and chain storage
72
75
return cts .storeData (ctx , entry )
73
76
}
@@ -76,6 +79,9 @@ func (cts *CTStorage) Add(ctx context.Context, entry *ctonly.Entry) tessera.Inde
76
79
//
77
80
// If an object is already stored under this hash, continues.
78
81
func (cts * CTStorage ) AddIssuerChain (ctx context.Context , chain []* x509.Certificate ) error {
82
+ ctx , span := tracer .Start (ctx , "tesseract.storage.AddIssuerChain" )
83
+ defer span .End ()
84
+
79
85
kvs := []KV {}
80
86
for _ , c := range chain {
81
87
id := sha256 .Sum256 (c .Raw )
@@ -125,6 +131,9 @@ func cachedStoreIssuers(s IssuerStorage) func(context.Context, []KV) error {
125
131
126
132
// AddCertDedupInfo stores <cert_hash, SCTDedupInfo> in the deduplication storage.
127
133
func (cts CTStorage ) AddCertDedupInfo (ctx context.Context , c * x509.Certificate , sctDedupInfo dedup.SCTDedupInfo ) error {
134
+ ctx , span := tracer .Start (ctx , "tesseract.storage.AddCertDedupInfo" )
135
+ defer span .End ()
136
+
128
137
key := sha256 .Sum256 (c .Raw )
129
138
if err := cts .dedupStorage .Add (ctx , []dedup.LeafDedupInfo {{LeafID : key [:], SCTDedupInfo : sctDedupInfo }}); err != nil {
130
139
return fmt .Errorf ("error storing SCTDedupInfo %+v of \" %x\" : %v" , sctDedupInfo , key , err )
@@ -134,6 +143,9 @@ func (cts CTStorage) AddCertDedupInfo(ctx context.Context, c *x509.Certificate,
134
143
135
144
// GetCertDedupInfo fetches the SCTDedupInfo of a given certificate from the deduplication storage.
136
145
func (cts CTStorage ) GetCertDedupInfo (ctx context.Context , c * x509.Certificate ) (dedup.SCTDedupInfo , bool , error ) {
146
+ ctx , span := tracer .Start (ctx , "tesseract.storageGetCertDedupInfo" )
147
+ defer span .End ()
148
+
137
149
key := sha256 .Sum256 (c .Raw )
138
150
sctC , ok , err := cts .dedupStorage .Get (ctx , key [:])
139
151
if err != nil {
0 commit comments