@@ -164,6 +164,13 @@ var (
164164 "mac" ,
165165 "retries" ,
166166 )
167+ opensslDataEventsCounter = defineMetric (
168+ "openssl_data_events_total" ,
169+ "Number of OpenSSL data events" ,
170+ TypeCounter ,
171+ "openssl_type" ,
172+ "data_len" ,
173+ )
167174)
168175
169176func (def * MetricDefinition ) mapLabels (labels []string ) prometheus.Labels {
@@ -194,16 +201,17 @@ type Metrics struct {
194201 Settings * Settings
195202
196203 // Shared metrics:
197- EvictionCounter * EvictionCounter
198- EvictedFlowsCounter * EvictionCounter
199- EvictedPacketsCounter * EvictionCounter
200- DroppedFlowsCounter * EvictionCounter
201- FilteredFlowsCounter * EvictionCounter
202- NetworkEventsCounter * EvictionCounter
203- FlowBufferSizeGauge * FlowBufferSizeGauge
204- Errors * ErrorCounter
205- FlowEnrichmentCounter * FlowEnrichmentCounter
206- InterfaceEventsCounter * InterfaceEventsCounter
204+ EvictionCounter * EvictionCounter
205+ EvictedFlowsCounter * EvictionCounter
206+ EvictedPacketsCounter * EvictionCounter
207+ DroppedFlowsCounter * EvictionCounter
208+ FilteredFlowsCounter * EvictionCounter
209+ NetworkEventsCounter * EvictionCounter
210+ FlowBufferSizeGauge * FlowBufferSizeGauge
211+ Errors * ErrorCounter
212+ FlowEnrichmentCounter * FlowEnrichmentCounter
213+ InterfaceEventsCounter * InterfaceEventsCounter
214+ OpenSSLDataEventsCounter * OpenSSLDataEventsCounter
207215}
208216
209217func NewMetrics (settings * Settings ) * Metrics {
@@ -220,6 +228,7 @@ func NewMetrics(settings *Settings) *Metrics {
220228 m .Errors = & ErrorCounter {vec : m .NewCounterVec (& errorsCounter )}
221229 m .FlowEnrichmentCounter = & FlowEnrichmentCounter {vec : m .NewCounterVec (& flowEnrichmentCounter )}
222230 m .InterfaceEventsCounter = newInterfaceEventsCounter (m .NewCounterVec (& interfaceEventsCounter ), settings .Level )
231+ m .OpenSSLDataEventsCounter = & OpenSSLDataEventsCounter {vec : m .NewCounterVec (& opensslDataEventsCounter )}
223232 return m
224233}
225234
@@ -346,6 +355,14 @@ type InterfaceEventsCounter struct {
346355 Increase func (typez , ifname string , ifindex int , netns string , mac [6 ]uint8 , retries int )
347356}
348357
358+ type OpenSSLDataEventsCounter struct {
359+ vec * prometheus.CounterVec
360+ }
361+
362+ func (c * OpenSSLDataEventsCounter ) Increase (sslType string , dataLen int ) {
363+ c .vec .WithLabelValues (sslType , strconv .Itoa (dataLen )).Inc ()
364+ }
365+
349366func newInterfaceEventsCounter (vec * prometheus.CounterVec , lvl Level ) * InterfaceEventsCounter {
350367 switch lvl {
351368 case LevelTrace :
0 commit comments