generated_metrics.go 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389
  1. // Code generated by mdatagen. DO NOT EDIT.
  2. package metadata
  3. import (
  4. "time"
  5. "go.opentelemetry.io/collector/component"
  6. "go.opentelemetry.io/collector/pdata/pcommon"
  7. "go.opentelemetry.io/collector/pdata/pmetric"
  8. "go.opentelemetry.io/collector/receiver"
  9. )
  10. // AttributeBindType specifies the a value bind_type attribute.
  11. type AttributeBindType int
  12. const (
  13. _ AttributeBindType = iota
  14. AttributeBindTypeServer
  15. AttributeBindTypeClient
  16. )
  17. // String returns the string representation of the AttributeBindType.
  18. func (av AttributeBindType) String() string {
  19. switch av {
  20. case AttributeBindTypeServer:
  21. return "server"
  22. case AttributeBindTypeClient:
  23. return "client"
  24. }
  25. return ""
  26. }
  27. // MapAttributeBindType is a helper map of string to AttributeBindType attribute value.
  28. var MapAttributeBindType = map[string]AttributeBindType{
  29. "server": AttributeBindTypeServer,
  30. "client": AttributeBindTypeClient,
  31. }
  32. // AttributeDirection specifies the a value direction attribute.
  33. type AttributeDirection int
  34. const (
  35. _ AttributeDirection = iota
  36. AttributeDirectionSent
  37. AttributeDirectionReceived
  38. )
  39. // String returns the string representation of the AttributeDirection.
  40. func (av AttributeDirection) String() string {
  41. switch av {
  42. case AttributeDirectionSent:
  43. return "sent"
  44. case AttributeDirectionReceived:
  45. return "received"
  46. }
  47. return ""
  48. }
  49. // MapAttributeDirection is a helper map of string to AttributeDirection attribute value.
  50. var MapAttributeDirection = map[string]AttributeDirection{
  51. "sent": AttributeDirectionSent,
  52. "received": AttributeDirectionReceived,
  53. }
  54. // AttributeNetworkDataType specifies the a value network_data_type attribute.
  55. type AttributeNetworkDataType int
  56. const (
  57. _ AttributeNetworkDataType = iota
  58. AttributeNetworkDataTypeCompressed
  59. AttributeNetworkDataTypeUncompressed
  60. )
  61. // String returns the string representation of the AttributeNetworkDataType.
  62. func (av AttributeNetworkDataType) String() string {
  63. switch av {
  64. case AttributeNetworkDataTypeCompressed:
  65. return "compressed"
  66. case AttributeNetworkDataTypeUncompressed:
  67. return "uncompressed"
  68. }
  69. return ""
  70. }
  71. // MapAttributeNetworkDataType is a helper map of string to AttributeNetworkDataType attribute value.
  72. var MapAttributeNetworkDataType = map[string]AttributeNetworkDataType{
  73. "compressed": AttributeNetworkDataTypeCompressed,
  74. "uncompressed": AttributeNetworkDataTypeUncompressed,
  75. }
  76. // AttributeOperationType specifies the a value operation_type attribute.
  77. type AttributeOperationType int
  78. const (
  79. _ AttributeOperationType = iota
  80. AttributeOperationTypeRead
  81. AttributeOperationTypeWrite
  82. AttributeOperationTypeSearch
  83. )
  84. // String returns the string representation of the AttributeOperationType.
  85. func (av AttributeOperationType) String() string {
  86. switch av {
  87. case AttributeOperationTypeRead:
  88. return "read"
  89. case AttributeOperationTypeWrite:
  90. return "write"
  91. case AttributeOperationTypeSearch:
  92. return "search"
  93. }
  94. return ""
  95. }
  96. // MapAttributeOperationType is a helper map of string to AttributeOperationType attribute value.
  97. var MapAttributeOperationType = map[string]AttributeOperationType{
  98. "read": AttributeOperationTypeRead,
  99. "write": AttributeOperationTypeWrite,
  100. "search": AttributeOperationTypeSearch,
  101. }
  102. // AttributeSuboperationType specifies the a value suboperation_type attribute.
  103. type AttributeSuboperationType int
  104. const (
  105. _ AttributeSuboperationType = iota
  106. AttributeSuboperationTypeSecurityDescriptorPropagationsEvent
  107. AttributeSuboperationTypeSearch
  108. )
  109. // String returns the string representation of the AttributeSuboperationType.
  110. func (av AttributeSuboperationType) String() string {
  111. switch av {
  112. case AttributeSuboperationTypeSecurityDescriptorPropagationsEvent:
  113. return "security_descriptor_propagations_event"
  114. case AttributeSuboperationTypeSearch:
  115. return "search"
  116. }
  117. return ""
  118. }
  119. // MapAttributeSuboperationType is a helper map of string to AttributeSuboperationType attribute value.
  120. var MapAttributeSuboperationType = map[string]AttributeSuboperationType{
  121. "security_descriptor_propagations_event": AttributeSuboperationTypeSecurityDescriptorPropagationsEvent,
  122. "search": AttributeSuboperationTypeSearch,
  123. }
  124. // AttributeSyncResult specifies the a value sync_result attribute.
  125. type AttributeSyncResult int
  126. const (
  127. _ AttributeSyncResult = iota
  128. AttributeSyncResultSuccess
  129. AttributeSyncResultSchemaMismatch
  130. AttributeSyncResultOther
  131. )
  132. // String returns the string representation of the AttributeSyncResult.
  133. func (av AttributeSyncResult) String() string {
  134. switch av {
  135. case AttributeSyncResultSuccess:
  136. return "success"
  137. case AttributeSyncResultSchemaMismatch:
  138. return "schema_mismatch"
  139. case AttributeSyncResultOther:
  140. return "other"
  141. }
  142. return ""
  143. }
  144. // MapAttributeSyncResult is a helper map of string to AttributeSyncResult attribute value.
  145. var MapAttributeSyncResult = map[string]AttributeSyncResult{
  146. "success": AttributeSyncResultSuccess,
  147. "schema_mismatch": AttributeSyncResultSchemaMismatch,
  148. "other": AttributeSyncResultOther,
  149. }
  150. // AttributeValueType specifies the a value value_type attribute.
  151. type AttributeValueType int
  152. const (
  153. _ AttributeValueType = iota
  154. AttributeValueTypeDistingushedNames
  155. AttributeValueTypeOther
  156. )
  157. // String returns the string representation of the AttributeValueType.
  158. func (av AttributeValueType) String() string {
  159. switch av {
  160. case AttributeValueTypeDistingushedNames:
  161. return "distingushed_names"
  162. case AttributeValueTypeOther:
  163. return "other"
  164. }
  165. return ""
  166. }
  167. // MapAttributeValueType is a helper map of string to AttributeValueType attribute value.
  168. var MapAttributeValueType = map[string]AttributeValueType{
  169. "distingushed_names": AttributeValueTypeDistingushedNames,
  170. "other": AttributeValueTypeOther,
  171. }
  172. type metricActiveDirectoryDsBindRate struct {
  173. data pmetric.Metric // data buffer for generated metric.
  174. config MetricConfig // metric config provided by user.
  175. capacity int // max observed number of data points added to the metric.
  176. }
  177. // init fills active_directory.ds.bind.rate metric with initial data.
  178. func (m *metricActiveDirectoryDsBindRate) init() {
  179. m.data.SetName("active_directory.ds.bind.rate")
  180. m.data.SetDescription("The number of binds per second serviced by this domain controller.")
  181. m.data.SetUnit("{binds}/s")
  182. m.data.SetEmptySum()
  183. m.data.Sum().SetIsMonotonic(false)
  184. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  185. m.data.Sum().DataPoints().EnsureCapacity(m.capacity)
  186. }
  187. func (m *metricActiveDirectoryDsBindRate) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, bindTypeAttributeValue string) {
  188. if !m.config.Enabled {
  189. return
  190. }
  191. dp := m.data.Sum().DataPoints().AppendEmpty()
  192. dp.SetStartTimestamp(start)
  193. dp.SetTimestamp(ts)
  194. dp.SetDoubleValue(val)
  195. dp.Attributes().PutStr("type", bindTypeAttributeValue)
  196. }
  197. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  198. func (m *metricActiveDirectoryDsBindRate) updateCapacity() {
  199. if m.data.Sum().DataPoints().Len() > m.capacity {
  200. m.capacity = m.data.Sum().DataPoints().Len()
  201. }
  202. }
  203. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  204. func (m *metricActiveDirectoryDsBindRate) emit(metrics pmetric.MetricSlice) {
  205. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  206. m.updateCapacity()
  207. m.data.MoveTo(metrics.AppendEmpty())
  208. m.init()
  209. }
  210. }
  211. func newMetricActiveDirectoryDsBindRate(cfg MetricConfig) metricActiveDirectoryDsBindRate {
  212. m := metricActiveDirectoryDsBindRate{config: cfg}
  213. if cfg.Enabled {
  214. m.data = pmetric.NewMetric()
  215. m.init()
  216. }
  217. return m
  218. }
  219. type metricActiveDirectoryDsLdapBindLastSuccessfulTime struct {
  220. data pmetric.Metric // data buffer for generated metric.
  221. config MetricConfig // metric config provided by user.
  222. capacity int // max observed number of data points added to the metric.
  223. }
  224. // init fills active_directory.ds.ldap.bind.last_successful.time metric with initial data.
  225. func (m *metricActiveDirectoryDsLdapBindLastSuccessfulTime) init() {
  226. m.data.SetName("active_directory.ds.ldap.bind.last_successful.time")
  227. m.data.SetDescription("The amount of time taken for the last successful LDAP bind.")
  228. m.data.SetUnit("ms")
  229. m.data.SetEmptyGauge()
  230. }
  231. func (m *metricActiveDirectoryDsLdapBindLastSuccessfulTime) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) {
  232. if !m.config.Enabled {
  233. return
  234. }
  235. dp := m.data.Gauge().DataPoints().AppendEmpty()
  236. dp.SetStartTimestamp(start)
  237. dp.SetTimestamp(ts)
  238. dp.SetIntValue(val)
  239. }
  240. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  241. func (m *metricActiveDirectoryDsLdapBindLastSuccessfulTime) updateCapacity() {
  242. if m.data.Gauge().DataPoints().Len() > m.capacity {
  243. m.capacity = m.data.Gauge().DataPoints().Len()
  244. }
  245. }
  246. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  247. func (m *metricActiveDirectoryDsLdapBindLastSuccessfulTime) emit(metrics pmetric.MetricSlice) {
  248. if m.config.Enabled && m.data.Gauge().DataPoints().Len() > 0 {
  249. m.updateCapacity()
  250. m.data.MoveTo(metrics.AppendEmpty())
  251. m.init()
  252. }
  253. }
  254. func newMetricActiveDirectoryDsLdapBindLastSuccessfulTime(cfg MetricConfig) metricActiveDirectoryDsLdapBindLastSuccessfulTime {
  255. m := metricActiveDirectoryDsLdapBindLastSuccessfulTime{config: cfg}
  256. if cfg.Enabled {
  257. m.data = pmetric.NewMetric()
  258. m.init()
  259. }
  260. return m
  261. }
  262. type metricActiveDirectoryDsLdapBindRate struct {
  263. data pmetric.Metric // data buffer for generated metric.
  264. config MetricConfig // metric config provided by user.
  265. capacity int // max observed number of data points added to the metric.
  266. }
  267. // init fills active_directory.ds.ldap.bind.rate metric with initial data.
  268. func (m *metricActiveDirectoryDsLdapBindRate) init() {
  269. m.data.SetName("active_directory.ds.ldap.bind.rate")
  270. m.data.SetDescription("The number of successful LDAP binds per second.")
  271. m.data.SetUnit("{binds}/s")
  272. m.data.SetEmptySum()
  273. m.data.Sum().SetIsMonotonic(false)
  274. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  275. }
  276. func (m *metricActiveDirectoryDsLdapBindRate) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64) {
  277. if !m.config.Enabled {
  278. return
  279. }
  280. dp := m.data.Sum().DataPoints().AppendEmpty()
  281. dp.SetStartTimestamp(start)
  282. dp.SetTimestamp(ts)
  283. dp.SetDoubleValue(val)
  284. }
  285. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  286. func (m *metricActiveDirectoryDsLdapBindRate) updateCapacity() {
  287. if m.data.Sum().DataPoints().Len() > m.capacity {
  288. m.capacity = m.data.Sum().DataPoints().Len()
  289. }
  290. }
  291. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  292. func (m *metricActiveDirectoryDsLdapBindRate) emit(metrics pmetric.MetricSlice) {
  293. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  294. m.updateCapacity()
  295. m.data.MoveTo(metrics.AppendEmpty())
  296. m.init()
  297. }
  298. }
  299. func newMetricActiveDirectoryDsLdapBindRate(cfg MetricConfig) metricActiveDirectoryDsLdapBindRate {
  300. m := metricActiveDirectoryDsLdapBindRate{config: cfg}
  301. if cfg.Enabled {
  302. m.data = pmetric.NewMetric()
  303. m.init()
  304. }
  305. return m
  306. }
  307. type metricActiveDirectoryDsLdapClientSessionCount struct {
  308. data pmetric.Metric // data buffer for generated metric.
  309. config MetricConfig // metric config provided by user.
  310. capacity int // max observed number of data points added to the metric.
  311. }
  312. // init fills active_directory.ds.ldap.client.session.count metric with initial data.
  313. func (m *metricActiveDirectoryDsLdapClientSessionCount) init() {
  314. m.data.SetName("active_directory.ds.ldap.client.session.count")
  315. m.data.SetDescription("The number of connected LDAP client sessions.")
  316. m.data.SetUnit("{sessions}")
  317. m.data.SetEmptySum()
  318. m.data.Sum().SetIsMonotonic(false)
  319. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  320. }
  321. func (m *metricActiveDirectoryDsLdapClientSessionCount) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) {
  322. if !m.config.Enabled {
  323. return
  324. }
  325. dp := m.data.Sum().DataPoints().AppendEmpty()
  326. dp.SetStartTimestamp(start)
  327. dp.SetTimestamp(ts)
  328. dp.SetIntValue(val)
  329. }
  330. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  331. func (m *metricActiveDirectoryDsLdapClientSessionCount) updateCapacity() {
  332. if m.data.Sum().DataPoints().Len() > m.capacity {
  333. m.capacity = m.data.Sum().DataPoints().Len()
  334. }
  335. }
  336. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  337. func (m *metricActiveDirectoryDsLdapClientSessionCount) emit(metrics pmetric.MetricSlice) {
  338. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  339. m.updateCapacity()
  340. m.data.MoveTo(metrics.AppendEmpty())
  341. m.init()
  342. }
  343. }
  344. func newMetricActiveDirectoryDsLdapClientSessionCount(cfg MetricConfig) metricActiveDirectoryDsLdapClientSessionCount {
  345. m := metricActiveDirectoryDsLdapClientSessionCount{config: cfg}
  346. if cfg.Enabled {
  347. m.data = pmetric.NewMetric()
  348. m.init()
  349. }
  350. return m
  351. }
  352. type metricActiveDirectoryDsLdapSearchRate struct {
  353. data pmetric.Metric // data buffer for generated metric.
  354. config MetricConfig // metric config provided by user.
  355. capacity int // max observed number of data points added to the metric.
  356. }
  357. // init fills active_directory.ds.ldap.search.rate metric with initial data.
  358. func (m *metricActiveDirectoryDsLdapSearchRate) init() {
  359. m.data.SetName("active_directory.ds.ldap.search.rate")
  360. m.data.SetDescription("The number of LDAP searches per second.")
  361. m.data.SetUnit("{searches}/s")
  362. m.data.SetEmptySum()
  363. m.data.Sum().SetIsMonotonic(false)
  364. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  365. }
  366. func (m *metricActiveDirectoryDsLdapSearchRate) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64) {
  367. if !m.config.Enabled {
  368. return
  369. }
  370. dp := m.data.Sum().DataPoints().AppendEmpty()
  371. dp.SetStartTimestamp(start)
  372. dp.SetTimestamp(ts)
  373. dp.SetDoubleValue(val)
  374. }
  375. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  376. func (m *metricActiveDirectoryDsLdapSearchRate) updateCapacity() {
  377. if m.data.Sum().DataPoints().Len() > m.capacity {
  378. m.capacity = m.data.Sum().DataPoints().Len()
  379. }
  380. }
  381. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  382. func (m *metricActiveDirectoryDsLdapSearchRate) emit(metrics pmetric.MetricSlice) {
  383. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  384. m.updateCapacity()
  385. m.data.MoveTo(metrics.AppendEmpty())
  386. m.init()
  387. }
  388. }
  389. func newMetricActiveDirectoryDsLdapSearchRate(cfg MetricConfig) metricActiveDirectoryDsLdapSearchRate {
  390. m := metricActiveDirectoryDsLdapSearchRate{config: cfg}
  391. if cfg.Enabled {
  392. m.data = pmetric.NewMetric()
  393. m.init()
  394. }
  395. return m
  396. }
  397. type metricActiveDirectoryDsNameCacheHitRate struct {
  398. data pmetric.Metric // data buffer for generated metric.
  399. config MetricConfig // metric config provided by user.
  400. capacity int // max observed number of data points added to the metric.
  401. }
  402. // init fills active_directory.ds.name_cache.hit_rate metric with initial data.
  403. func (m *metricActiveDirectoryDsNameCacheHitRate) init() {
  404. m.data.SetName("active_directory.ds.name_cache.hit_rate")
  405. m.data.SetDescription("The percentage of directory object name component lookups that are satisfied by the Directory System Agent's name cache.")
  406. m.data.SetUnit("%")
  407. m.data.SetEmptyGauge()
  408. }
  409. func (m *metricActiveDirectoryDsNameCacheHitRate) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64) {
  410. if !m.config.Enabled {
  411. return
  412. }
  413. dp := m.data.Gauge().DataPoints().AppendEmpty()
  414. dp.SetStartTimestamp(start)
  415. dp.SetTimestamp(ts)
  416. dp.SetDoubleValue(val)
  417. }
  418. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  419. func (m *metricActiveDirectoryDsNameCacheHitRate) updateCapacity() {
  420. if m.data.Gauge().DataPoints().Len() > m.capacity {
  421. m.capacity = m.data.Gauge().DataPoints().Len()
  422. }
  423. }
  424. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  425. func (m *metricActiveDirectoryDsNameCacheHitRate) emit(metrics pmetric.MetricSlice) {
  426. if m.config.Enabled && m.data.Gauge().DataPoints().Len() > 0 {
  427. m.updateCapacity()
  428. m.data.MoveTo(metrics.AppendEmpty())
  429. m.init()
  430. }
  431. }
  432. func newMetricActiveDirectoryDsNameCacheHitRate(cfg MetricConfig) metricActiveDirectoryDsNameCacheHitRate {
  433. m := metricActiveDirectoryDsNameCacheHitRate{config: cfg}
  434. if cfg.Enabled {
  435. m.data = pmetric.NewMetric()
  436. m.init()
  437. }
  438. return m
  439. }
  440. type metricActiveDirectoryDsNotificationQueued struct {
  441. data pmetric.Metric // data buffer for generated metric.
  442. config MetricConfig // metric config provided by user.
  443. capacity int // max observed number of data points added to the metric.
  444. }
  445. // init fills active_directory.ds.notification.queued metric with initial data.
  446. func (m *metricActiveDirectoryDsNotificationQueued) init() {
  447. m.data.SetName("active_directory.ds.notification.queued")
  448. m.data.SetDescription("The number of pending update notifications that have been queued to push to clients.")
  449. m.data.SetUnit("{notifications}")
  450. m.data.SetEmptySum()
  451. m.data.Sum().SetIsMonotonic(false)
  452. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  453. }
  454. func (m *metricActiveDirectoryDsNotificationQueued) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) {
  455. if !m.config.Enabled {
  456. return
  457. }
  458. dp := m.data.Sum().DataPoints().AppendEmpty()
  459. dp.SetStartTimestamp(start)
  460. dp.SetTimestamp(ts)
  461. dp.SetIntValue(val)
  462. }
  463. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  464. func (m *metricActiveDirectoryDsNotificationQueued) updateCapacity() {
  465. if m.data.Sum().DataPoints().Len() > m.capacity {
  466. m.capacity = m.data.Sum().DataPoints().Len()
  467. }
  468. }
  469. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  470. func (m *metricActiveDirectoryDsNotificationQueued) emit(metrics pmetric.MetricSlice) {
  471. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  472. m.updateCapacity()
  473. m.data.MoveTo(metrics.AppendEmpty())
  474. m.init()
  475. }
  476. }
  477. func newMetricActiveDirectoryDsNotificationQueued(cfg MetricConfig) metricActiveDirectoryDsNotificationQueued {
  478. m := metricActiveDirectoryDsNotificationQueued{config: cfg}
  479. if cfg.Enabled {
  480. m.data = pmetric.NewMetric()
  481. m.init()
  482. }
  483. return m
  484. }
  485. type metricActiveDirectoryDsOperationRate struct {
  486. data pmetric.Metric // data buffer for generated metric.
  487. config MetricConfig // metric config provided by user.
  488. capacity int // max observed number of data points added to the metric.
  489. }
  490. // init fills active_directory.ds.operation.rate metric with initial data.
  491. func (m *metricActiveDirectoryDsOperationRate) init() {
  492. m.data.SetName("active_directory.ds.operation.rate")
  493. m.data.SetDescription("The number of operations performed per second.")
  494. m.data.SetUnit("{operations}/s")
  495. m.data.SetEmptySum()
  496. m.data.Sum().SetIsMonotonic(false)
  497. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  498. m.data.Sum().DataPoints().EnsureCapacity(m.capacity)
  499. }
  500. func (m *metricActiveDirectoryDsOperationRate) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, operationTypeAttributeValue string) {
  501. if !m.config.Enabled {
  502. return
  503. }
  504. dp := m.data.Sum().DataPoints().AppendEmpty()
  505. dp.SetStartTimestamp(start)
  506. dp.SetTimestamp(ts)
  507. dp.SetDoubleValue(val)
  508. dp.Attributes().PutStr("type", operationTypeAttributeValue)
  509. }
  510. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  511. func (m *metricActiveDirectoryDsOperationRate) updateCapacity() {
  512. if m.data.Sum().DataPoints().Len() > m.capacity {
  513. m.capacity = m.data.Sum().DataPoints().Len()
  514. }
  515. }
  516. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  517. func (m *metricActiveDirectoryDsOperationRate) emit(metrics pmetric.MetricSlice) {
  518. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  519. m.updateCapacity()
  520. m.data.MoveTo(metrics.AppendEmpty())
  521. m.init()
  522. }
  523. }
  524. func newMetricActiveDirectoryDsOperationRate(cfg MetricConfig) metricActiveDirectoryDsOperationRate {
  525. m := metricActiveDirectoryDsOperationRate{config: cfg}
  526. if cfg.Enabled {
  527. m.data = pmetric.NewMetric()
  528. m.init()
  529. }
  530. return m
  531. }
  532. type metricActiveDirectoryDsReplicationNetworkIo struct {
  533. data pmetric.Metric // data buffer for generated metric.
  534. config MetricConfig // metric config provided by user.
  535. capacity int // max observed number of data points added to the metric.
  536. }
  537. // init fills active_directory.ds.replication.network.io metric with initial data.
  538. func (m *metricActiveDirectoryDsReplicationNetworkIo) init() {
  539. m.data.SetName("active_directory.ds.replication.network.io")
  540. m.data.SetDescription("The amount of network data transmitted by the Directory Replication Agent.")
  541. m.data.SetUnit("By")
  542. m.data.SetEmptySum()
  543. m.data.Sum().SetIsMonotonic(true)
  544. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  545. m.data.Sum().DataPoints().EnsureCapacity(m.capacity)
  546. }
  547. func (m *metricActiveDirectoryDsReplicationNetworkIo) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string, networkDataTypeAttributeValue string) {
  548. if !m.config.Enabled {
  549. return
  550. }
  551. dp := m.data.Sum().DataPoints().AppendEmpty()
  552. dp.SetStartTimestamp(start)
  553. dp.SetTimestamp(ts)
  554. dp.SetIntValue(val)
  555. dp.Attributes().PutStr("direction", directionAttributeValue)
  556. dp.Attributes().PutStr("type", networkDataTypeAttributeValue)
  557. }
  558. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  559. func (m *metricActiveDirectoryDsReplicationNetworkIo) updateCapacity() {
  560. if m.data.Sum().DataPoints().Len() > m.capacity {
  561. m.capacity = m.data.Sum().DataPoints().Len()
  562. }
  563. }
  564. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  565. func (m *metricActiveDirectoryDsReplicationNetworkIo) emit(metrics pmetric.MetricSlice) {
  566. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  567. m.updateCapacity()
  568. m.data.MoveTo(metrics.AppendEmpty())
  569. m.init()
  570. }
  571. }
  572. func newMetricActiveDirectoryDsReplicationNetworkIo(cfg MetricConfig) metricActiveDirectoryDsReplicationNetworkIo {
  573. m := metricActiveDirectoryDsReplicationNetworkIo{config: cfg}
  574. if cfg.Enabled {
  575. m.data = pmetric.NewMetric()
  576. m.init()
  577. }
  578. return m
  579. }
  580. type metricActiveDirectoryDsReplicationObjectRate struct {
  581. data pmetric.Metric // data buffer for generated metric.
  582. config MetricConfig // metric config provided by user.
  583. capacity int // max observed number of data points added to the metric.
  584. }
  585. // init fills active_directory.ds.replication.object.rate metric with initial data.
  586. func (m *metricActiveDirectoryDsReplicationObjectRate) init() {
  587. m.data.SetName("active_directory.ds.replication.object.rate")
  588. m.data.SetDescription("The number of objects transmitted by the Directory Replication Agent per second.")
  589. m.data.SetUnit("{objects}/s")
  590. m.data.SetEmptySum()
  591. m.data.Sum().SetIsMonotonic(false)
  592. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  593. m.data.Sum().DataPoints().EnsureCapacity(m.capacity)
  594. }
  595. func (m *metricActiveDirectoryDsReplicationObjectRate) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, directionAttributeValue string) {
  596. if !m.config.Enabled {
  597. return
  598. }
  599. dp := m.data.Sum().DataPoints().AppendEmpty()
  600. dp.SetStartTimestamp(start)
  601. dp.SetTimestamp(ts)
  602. dp.SetDoubleValue(val)
  603. dp.Attributes().PutStr("direction", directionAttributeValue)
  604. }
  605. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  606. func (m *metricActiveDirectoryDsReplicationObjectRate) updateCapacity() {
  607. if m.data.Sum().DataPoints().Len() > m.capacity {
  608. m.capacity = m.data.Sum().DataPoints().Len()
  609. }
  610. }
  611. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  612. func (m *metricActiveDirectoryDsReplicationObjectRate) emit(metrics pmetric.MetricSlice) {
  613. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  614. m.updateCapacity()
  615. m.data.MoveTo(metrics.AppendEmpty())
  616. m.init()
  617. }
  618. }
  619. func newMetricActiveDirectoryDsReplicationObjectRate(cfg MetricConfig) metricActiveDirectoryDsReplicationObjectRate {
  620. m := metricActiveDirectoryDsReplicationObjectRate{config: cfg}
  621. if cfg.Enabled {
  622. m.data = pmetric.NewMetric()
  623. m.init()
  624. }
  625. return m
  626. }
  627. type metricActiveDirectoryDsReplicationOperationPending struct {
  628. data pmetric.Metric // data buffer for generated metric.
  629. config MetricConfig // metric config provided by user.
  630. capacity int // max observed number of data points added to the metric.
  631. }
  632. // init fills active_directory.ds.replication.operation.pending metric with initial data.
  633. func (m *metricActiveDirectoryDsReplicationOperationPending) init() {
  634. m.data.SetName("active_directory.ds.replication.operation.pending")
  635. m.data.SetDescription("The number of pending replication operations for the Directory Replication Agent.")
  636. m.data.SetUnit("{operations}")
  637. m.data.SetEmptySum()
  638. m.data.Sum().SetIsMonotonic(false)
  639. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  640. }
  641. func (m *metricActiveDirectoryDsReplicationOperationPending) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) {
  642. if !m.config.Enabled {
  643. return
  644. }
  645. dp := m.data.Sum().DataPoints().AppendEmpty()
  646. dp.SetStartTimestamp(start)
  647. dp.SetTimestamp(ts)
  648. dp.SetIntValue(val)
  649. }
  650. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  651. func (m *metricActiveDirectoryDsReplicationOperationPending) updateCapacity() {
  652. if m.data.Sum().DataPoints().Len() > m.capacity {
  653. m.capacity = m.data.Sum().DataPoints().Len()
  654. }
  655. }
  656. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  657. func (m *metricActiveDirectoryDsReplicationOperationPending) emit(metrics pmetric.MetricSlice) {
  658. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  659. m.updateCapacity()
  660. m.data.MoveTo(metrics.AppendEmpty())
  661. m.init()
  662. }
  663. }
  664. func newMetricActiveDirectoryDsReplicationOperationPending(cfg MetricConfig) metricActiveDirectoryDsReplicationOperationPending {
  665. m := metricActiveDirectoryDsReplicationOperationPending{config: cfg}
  666. if cfg.Enabled {
  667. m.data = pmetric.NewMetric()
  668. m.init()
  669. }
  670. return m
  671. }
  672. type metricActiveDirectoryDsReplicationPropertyRate struct {
  673. data pmetric.Metric // data buffer for generated metric.
  674. config MetricConfig // metric config provided by user.
  675. capacity int // max observed number of data points added to the metric.
  676. }
  677. // init fills active_directory.ds.replication.property.rate metric with initial data.
  678. func (m *metricActiveDirectoryDsReplicationPropertyRate) init() {
  679. m.data.SetName("active_directory.ds.replication.property.rate")
  680. m.data.SetDescription("The number of properties transmitted by the Directory Replication Agent per second.")
  681. m.data.SetUnit("{properties}/s")
  682. m.data.SetEmptySum()
  683. m.data.Sum().SetIsMonotonic(false)
  684. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  685. m.data.Sum().DataPoints().EnsureCapacity(m.capacity)
  686. }
  687. func (m *metricActiveDirectoryDsReplicationPropertyRate) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, directionAttributeValue string) {
  688. if !m.config.Enabled {
  689. return
  690. }
  691. dp := m.data.Sum().DataPoints().AppendEmpty()
  692. dp.SetStartTimestamp(start)
  693. dp.SetTimestamp(ts)
  694. dp.SetDoubleValue(val)
  695. dp.Attributes().PutStr("direction", directionAttributeValue)
  696. }
  697. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  698. func (m *metricActiveDirectoryDsReplicationPropertyRate) updateCapacity() {
  699. if m.data.Sum().DataPoints().Len() > m.capacity {
  700. m.capacity = m.data.Sum().DataPoints().Len()
  701. }
  702. }
  703. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  704. func (m *metricActiveDirectoryDsReplicationPropertyRate) emit(metrics pmetric.MetricSlice) {
  705. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  706. m.updateCapacity()
  707. m.data.MoveTo(metrics.AppendEmpty())
  708. m.init()
  709. }
  710. }
  711. func newMetricActiveDirectoryDsReplicationPropertyRate(cfg MetricConfig) metricActiveDirectoryDsReplicationPropertyRate {
  712. m := metricActiveDirectoryDsReplicationPropertyRate{config: cfg}
  713. if cfg.Enabled {
  714. m.data = pmetric.NewMetric()
  715. m.init()
  716. }
  717. return m
  718. }
  719. type metricActiveDirectoryDsReplicationSyncObjectPending struct {
  720. data pmetric.Metric // data buffer for generated metric.
  721. config MetricConfig // metric config provided by user.
  722. capacity int // max observed number of data points added to the metric.
  723. }
  724. // init fills active_directory.ds.replication.sync.object.pending metric with initial data.
  725. func (m *metricActiveDirectoryDsReplicationSyncObjectPending) init() {
  726. m.data.SetName("active_directory.ds.replication.sync.object.pending")
  727. m.data.SetDescription("The number of objects remaining until the full sync completes for the Directory Replication Agent.")
  728. m.data.SetUnit("{objects}")
  729. m.data.SetEmptySum()
  730. m.data.Sum().SetIsMonotonic(false)
  731. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  732. }
  733. func (m *metricActiveDirectoryDsReplicationSyncObjectPending) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) {
  734. if !m.config.Enabled {
  735. return
  736. }
  737. dp := m.data.Sum().DataPoints().AppendEmpty()
  738. dp.SetStartTimestamp(start)
  739. dp.SetTimestamp(ts)
  740. dp.SetIntValue(val)
  741. }
  742. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  743. func (m *metricActiveDirectoryDsReplicationSyncObjectPending) updateCapacity() {
  744. if m.data.Sum().DataPoints().Len() > m.capacity {
  745. m.capacity = m.data.Sum().DataPoints().Len()
  746. }
  747. }
  748. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  749. func (m *metricActiveDirectoryDsReplicationSyncObjectPending) emit(metrics pmetric.MetricSlice) {
  750. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  751. m.updateCapacity()
  752. m.data.MoveTo(metrics.AppendEmpty())
  753. m.init()
  754. }
  755. }
  756. func newMetricActiveDirectoryDsReplicationSyncObjectPending(cfg MetricConfig) metricActiveDirectoryDsReplicationSyncObjectPending {
  757. m := metricActiveDirectoryDsReplicationSyncObjectPending{config: cfg}
  758. if cfg.Enabled {
  759. m.data = pmetric.NewMetric()
  760. m.init()
  761. }
  762. return m
  763. }
  764. type metricActiveDirectoryDsReplicationSyncRequestCount struct {
  765. data pmetric.Metric // data buffer for generated metric.
  766. config MetricConfig // metric config provided by user.
  767. capacity int // max observed number of data points added to the metric.
  768. }
  769. // init fills active_directory.ds.replication.sync.request.count metric with initial data.
  770. func (m *metricActiveDirectoryDsReplicationSyncRequestCount) init() {
  771. m.data.SetName("active_directory.ds.replication.sync.request.count")
  772. m.data.SetDescription("The number of sync requests made by the Directory Replication Agent.")
  773. m.data.SetUnit("{requests}")
  774. m.data.SetEmptySum()
  775. m.data.Sum().SetIsMonotonic(true)
  776. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  777. m.data.Sum().DataPoints().EnsureCapacity(m.capacity)
  778. }
  779. func (m *metricActiveDirectoryDsReplicationSyncRequestCount) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, syncResultAttributeValue string) {
  780. if !m.config.Enabled {
  781. return
  782. }
  783. dp := m.data.Sum().DataPoints().AppendEmpty()
  784. dp.SetStartTimestamp(start)
  785. dp.SetTimestamp(ts)
  786. dp.SetIntValue(val)
  787. dp.Attributes().PutStr("result", syncResultAttributeValue)
  788. }
  789. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  790. func (m *metricActiveDirectoryDsReplicationSyncRequestCount) updateCapacity() {
  791. if m.data.Sum().DataPoints().Len() > m.capacity {
  792. m.capacity = m.data.Sum().DataPoints().Len()
  793. }
  794. }
  795. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  796. func (m *metricActiveDirectoryDsReplicationSyncRequestCount) emit(metrics pmetric.MetricSlice) {
  797. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  798. m.updateCapacity()
  799. m.data.MoveTo(metrics.AppendEmpty())
  800. m.init()
  801. }
  802. }
  803. func newMetricActiveDirectoryDsReplicationSyncRequestCount(cfg MetricConfig) metricActiveDirectoryDsReplicationSyncRequestCount {
  804. m := metricActiveDirectoryDsReplicationSyncRequestCount{config: cfg}
  805. if cfg.Enabled {
  806. m.data = pmetric.NewMetric()
  807. m.init()
  808. }
  809. return m
  810. }
  811. type metricActiveDirectoryDsReplicationValueRate struct {
  812. data pmetric.Metric // data buffer for generated metric.
  813. config MetricConfig // metric config provided by user.
  814. capacity int // max observed number of data points added to the metric.
  815. }
  816. // init fills active_directory.ds.replication.value.rate metric with initial data.
  817. func (m *metricActiveDirectoryDsReplicationValueRate) init() {
  818. m.data.SetName("active_directory.ds.replication.value.rate")
  819. m.data.SetDescription("The number of values transmitted by the Directory Replication Agent per second.")
  820. m.data.SetUnit("{values}/s")
  821. m.data.SetEmptySum()
  822. m.data.Sum().SetIsMonotonic(false)
  823. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  824. m.data.Sum().DataPoints().EnsureCapacity(m.capacity)
  825. }
  826. func (m *metricActiveDirectoryDsReplicationValueRate) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, directionAttributeValue string, valueTypeAttributeValue string) {
  827. if !m.config.Enabled {
  828. return
  829. }
  830. dp := m.data.Sum().DataPoints().AppendEmpty()
  831. dp.SetStartTimestamp(start)
  832. dp.SetTimestamp(ts)
  833. dp.SetDoubleValue(val)
  834. dp.Attributes().PutStr("direction", directionAttributeValue)
  835. dp.Attributes().PutStr("type", valueTypeAttributeValue)
  836. }
  837. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  838. func (m *metricActiveDirectoryDsReplicationValueRate) updateCapacity() {
  839. if m.data.Sum().DataPoints().Len() > m.capacity {
  840. m.capacity = m.data.Sum().DataPoints().Len()
  841. }
  842. }
  843. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  844. func (m *metricActiveDirectoryDsReplicationValueRate) emit(metrics pmetric.MetricSlice) {
  845. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  846. m.updateCapacity()
  847. m.data.MoveTo(metrics.AppendEmpty())
  848. m.init()
  849. }
  850. }
  851. func newMetricActiveDirectoryDsReplicationValueRate(cfg MetricConfig) metricActiveDirectoryDsReplicationValueRate {
  852. m := metricActiveDirectoryDsReplicationValueRate{config: cfg}
  853. if cfg.Enabled {
  854. m.data = pmetric.NewMetric()
  855. m.init()
  856. }
  857. return m
  858. }
  859. type metricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued struct {
  860. data pmetric.Metric // data buffer for generated metric.
  861. config MetricConfig // metric config provided by user.
  862. capacity int // max observed number of data points added to the metric.
  863. }
  864. // init fills active_directory.ds.security_descriptor_propagations_event.queued metric with initial data.
  865. func (m *metricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued) init() {
  866. m.data.SetName("active_directory.ds.security_descriptor_propagations_event.queued")
  867. m.data.SetDescription("The number of security descriptor propagation events that are queued for processing.")
  868. m.data.SetUnit("{events}")
  869. m.data.SetEmptySum()
  870. m.data.Sum().SetIsMonotonic(false)
  871. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  872. }
  873. func (m *metricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) {
  874. if !m.config.Enabled {
  875. return
  876. }
  877. dp := m.data.Sum().DataPoints().AppendEmpty()
  878. dp.SetStartTimestamp(start)
  879. dp.SetTimestamp(ts)
  880. dp.SetIntValue(val)
  881. }
  882. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  883. func (m *metricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued) updateCapacity() {
  884. if m.data.Sum().DataPoints().Len() > m.capacity {
  885. m.capacity = m.data.Sum().DataPoints().Len()
  886. }
  887. }
  888. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  889. func (m *metricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued) emit(metrics pmetric.MetricSlice) {
  890. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  891. m.updateCapacity()
  892. m.data.MoveTo(metrics.AppendEmpty())
  893. m.init()
  894. }
  895. }
  896. func newMetricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued(cfg MetricConfig) metricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued {
  897. m := metricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued{config: cfg}
  898. if cfg.Enabled {
  899. m.data = pmetric.NewMetric()
  900. m.init()
  901. }
  902. return m
  903. }
  904. type metricActiveDirectoryDsSuboperationRate struct {
  905. data pmetric.Metric // data buffer for generated metric.
  906. config MetricConfig // metric config provided by user.
  907. capacity int // max observed number of data points added to the metric.
  908. }
  909. // init fills active_directory.ds.suboperation.rate metric with initial data.
  910. func (m *metricActiveDirectoryDsSuboperationRate) init() {
  911. m.data.SetName("active_directory.ds.suboperation.rate")
  912. m.data.SetDescription("The rate of sub-operations performed.")
  913. m.data.SetUnit("{suboperations}/s")
  914. m.data.SetEmptySum()
  915. m.data.Sum().SetIsMonotonic(false)
  916. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  917. m.data.Sum().DataPoints().EnsureCapacity(m.capacity)
  918. }
  919. func (m *metricActiveDirectoryDsSuboperationRate) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, suboperationTypeAttributeValue string) {
  920. if !m.config.Enabled {
  921. return
  922. }
  923. dp := m.data.Sum().DataPoints().AppendEmpty()
  924. dp.SetStartTimestamp(start)
  925. dp.SetTimestamp(ts)
  926. dp.SetDoubleValue(val)
  927. dp.Attributes().PutStr("type", suboperationTypeAttributeValue)
  928. }
  929. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  930. func (m *metricActiveDirectoryDsSuboperationRate) updateCapacity() {
  931. if m.data.Sum().DataPoints().Len() > m.capacity {
  932. m.capacity = m.data.Sum().DataPoints().Len()
  933. }
  934. }
  935. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  936. func (m *metricActiveDirectoryDsSuboperationRate) emit(metrics pmetric.MetricSlice) {
  937. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  938. m.updateCapacity()
  939. m.data.MoveTo(metrics.AppendEmpty())
  940. m.init()
  941. }
  942. }
  943. func newMetricActiveDirectoryDsSuboperationRate(cfg MetricConfig) metricActiveDirectoryDsSuboperationRate {
  944. m := metricActiveDirectoryDsSuboperationRate{config: cfg}
  945. if cfg.Enabled {
  946. m.data = pmetric.NewMetric()
  947. m.init()
  948. }
  949. return m
  950. }
  951. type metricActiveDirectoryDsThreadCount struct {
  952. data pmetric.Metric // data buffer for generated metric.
  953. config MetricConfig // metric config provided by user.
  954. capacity int // max observed number of data points added to the metric.
  955. }
  956. // init fills active_directory.ds.thread.count metric with initial data.
  957. func (m *metricActiveDirectoryDsThreadCount) init() {
  958. m.data.SetName("active_directory.ds.thread.count")
  959. m.data.SetDescription("The number of threads in use by the directory service.")
  960. m.data.SetUnit("{threads}")
  961. m.data.SetEmptySum()
  962. m.data.Sum().SetIsMonotonic(false)
  963. m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
  964. }
  965. func (m *metricActiveDirectoryDsThreadCount) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) {
  966. if !m.config.Enabled {
  967. return
  968. }
  969. dp := m.data.Sum().DataPoints().AppendEmpty()
  970. dp.SetStartTimestamp(start)
  971. dp.SetTimestamp(ts)
  972. dp.SetIntValue(val)
  973. }
  974. // updateCapacity saves max length of data point slices that will be used for the slice capacity.
  975. func (m *metricActiveDirectoryDsThreadCount) updateCapacity() {
  976. if m.data.Sum().DataPoints().Len() > m.capacity {
  977. m.capacity = m.data.Sum().DataPoints().Len()
  978. }
  979. }
  980. // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
  981. func (m *metricActiveDirectoryDsThreadCount) emit(metrics pmetric.MetricSlice) {
  982. if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
  983. m.updateCapacity()
  984. m.data.MoveTo(metrics.AppendEmpty())
  985. m.init()
  986. }
  987. }
  988. func newMetricActiveDirectoryDsThreadCount(cfg MetricConfig) metricActiveDirectoryDsThreadCount {
  989. m := metricActiveDirectoryDsThreadCount{config: cfg}
  990. if cfg.Enabled {
  991. m.data = pmetric.NewMetric()
  992. m.init()
  993. }
  994. return m
  995. }
  996. // MetricsBuilder provides an interface for scrapers to report metrics while taking care of all the transformations
  997. // required to produce metric representation defined in metadata and user config.
  998. type MetricsBuilder struct {
  999. config MetricsBuilderConfig // config of the metrics builder.
  1000. startTime pcommon.Timestamp // start time that will be applied to all recorded data points.
  1001. metricsCapacity int // maximum observed number of metrics per resource.
  1002. metricsBuffer pmetric.Metrics // accumulates metrics data before emitting.
  1003. buildInfo component.BuildInfo // contains version information.
  1004. metricActiveDirectoryDsBindRate metricActiveDirectoryDsBindRate
  1005. metricActiveDirectoryDsLdapBindLastSuccessfulTime metricActiveDirectoryDsLdapBindLastSuccessfulTime
  1006. metricActiveDirectoryDsLdapBindRate metricActiveDirectoryDsLdapBindRate
  1007. metricActiveDirectoryDsLdapClientSessionCount metricActiveDirectoryDsLdapClientSessionCount
  1008. metricActiveDirectoryDsLdapSearchRate metricActiveDirectoryDsLdapSearchRate
  1009. metricActiveDirectoryDsNameCacheHitRate metricActiveDirectoryDsNameCacheHitRate
  1010. metricActiveDirectoryDsNotificationQueued metricActiveDirectoryDsNotificationQueued
  1011. metricActiveDirectoryDsOperationRate metricActiveDirectoryDsOperationRate
  1012. metricActiveDirectoryDsReplicationNetworkIo metricActiveDirectoryDsReplicationNetworkIo
  1013. metricActiveDirectoryDsReplicationObjectRate metricActiveDirectoryDsReplicationObjectRate
  1014. metricActiveDirectoryDsReplicationOperationPending metricActiveDirectoryDsReplicationOperationPending
  1015. metricActiveDirectoryDsReplicationPropertyRate metricActiveDirectoryDsReplicationPropertyRate
  1016. metricActiveDirectoryDsReplicationSyncObjectPending metricActiveDirectoryDsReplicationSyncObjectPending
  1017. metricActiveDirectoryDsReplicationSyncRequestCount metricActiveDirectoryDsReplicationSyncRequestCount
  1018. metricActiveDirectoryDsReplicationValueRate metricActiveDirectoryDsReplicationValueRate
  1019. metricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued metricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued
  1020. metricActiveDirectoryDsSuboperationRate metricActiveDirectoryDsSuboperationRate
  1021. metricActiveDirectoryDsThreadCount metricActiveDirectoryDsThreadCount
  1022. }
  1023. // metricBuilderOption applies changes to default metrics builder.
  1024. type metricBuilderOption func(*MetricsBuilder)
  1025. // WithStartTime sets startTime on the metrics builder.
  1026. func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption {
  1027. return func(mb *MetricsBuilder) {
  1028. mb.startTime = startTime
  1029. }
  1030. }
  1031. func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSettings, options ...metricBuilderOption) *MetricsBuilder {
  1032. mb := &MetricsBuilder{
  1033. config: mbc,
  1034. startTime: pcommon.NewTimestampFromTime(time.Now()),
  1035. metricsBuffer: pmetric.NewMetrics(),
  1036. buildInfo: settings.BuildInfo,
  1037. metricActiveDirectoryDsBindRate: newMetricActiveDirectoryDsBindRate(mbc.Metrics.ActiveDirectoryDsBindRate),
  1038. metricActiveDirectoryDsLdapBindLastSuccessfulTime: newMetricActiveDirectoryDsLdapBindLastSuccessfulTime(mbc.Metrics.ActiveDirectoryDsLdapBindLastSuccessfulTime),
  1039. metricActiveDirectoryDsLdapBindRate: newMetricActiveDirectoryDsLdapBindRate(mbc.Metrics.ActiveDirectoryDsLdapBindRate),
  1040. metricActiveDirectoryDsLdapClientSessionCount: newMetricActiveDirectoryDsLdapClientSessionCount(mbc.Metrics.ActiveDirectoryDsLdapClientSessionCount),
  1041. metricActiveDirectoryDsLdapSearchRate: newMetricActiveDirectoryDsLdapSearchRate(mbc.Metrics.ActiveDirectoryDsLdapSearchRate),
  1042. metricActiveDirectoryDsNameCacheHitRate: newMetricActiveDirectoryDsNameCacheHitRate(mbc.Metrics.ActiveDirectoryDsNameCacheHitRate),
  1043. metricActiveDirectoryDsNotificationQueued: newMetricActiveDirectoryDsNotificationQueued(mbc.Metrics.ActiveDirectoryDsNotificationQueued),
  1044. metricActiveDirectoryDsOperationRate: newMetricActiveDirectoryDsOperationRate(mbc.Metrics.ActiveDirectoryDsOperationRate),
  1045. metricActiveDirectoryDsReplicationNetworkIo: newMetricActiveDirectoryDsReplicationNetworkIo(mbc.Metrics.ActiveDirectoryDsReplicationNetworkIo),
  1046. metricActiveDirectoryDsReplicationObjectRate: newMetricActiveDirectoryDsReplicationObjectRate(mbc.Metrics.ActiveDirectoryDsReplicationObjectRate),
  1047. metricActiveDirectoryDsReplicationOperationPending: newMetricActiveDirectoryDsReplicationOperationPending(mbc.Metrics.ActiveDirectoryDsReplicationOperationPending),
  1048. metricActiveDirectoryDsReplicationPropertyRate: newMetricActiveDirectoryDsReplicationPropertyRate(mbc.Metrics.ActiveDirectoryDsReplicationPropertyRate),
  1049. metricActiveDirectoryDsReplicationSyncObjectPending: newMetricActiveDirectoryDsReplicationSyncObjectPending(mbc.Metrics.ActiveDirectoryDsReplicationSyncObjectPending),
  1050. metricActiveDirectoryDsReplicationSyncRequestCount: newMetricActiveDirectoryDsReplicationSyncRequestCount(mbc.Metrics.ActiveDirectoryDsReplicationSyncRequestCount),
  1051. metricActiveDirectoryDsReplicationValueRate: newMetricActiveDirectoryDsReplicationValueRate(mbc.Metrics.ActiveDirectoryDsReplicationValueRate),
  1052. metricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued: newMetricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued(mbc.Metrics.ActiveDirectoryDsSecurityDescriptorPropagationsEventQueued),
  1053. metricActiveDirectoryDsSuboperationRate: newMetricActiveDirectoryDsSuboperationRate(mbc.Metrics.ActiveDirectoryDsSuboperationRate),
  1054. metricActiveDirectoryDsThreadCount: newMetricActiveDirectoryDsThreadCount(mbc.Metrics.ActiveDirectoryDsThreadCount),
  1055. }
  1056. for _, op := range options {
  1057. op(mb)
  1058. }
  1059. return mb
  1060. }
  1061. // updateCapacity updates max length of metrics and resource attributes that will be used for the slice capacity.
  1062. func (mb *MetricsBuilder) updateCapacity(rm pmetric.ResourceMetrics) {
  1063. if mb.metricsCapacity < rm.ScopeMetrics().At(0).Metrics().Len() {
  1064. mb.metricsCapacity = rm.ScopeMetrics().At(0).Metrics().Len()
  1065. }
  1066. }
  1067. // ResourceMetricsOption applies changes to provided resource metrics.
  1068. type ResourceMetricsOption func(pmetric.ResourceMetrics)
  1069. // WithResource sets the provided resource on the emitted ResourceMetrics.
  1070. // It's recommended to use ResourceBuilder to create the resource.
  1071. func WithResource(res pcommon.Resource) ResourceMetricsOption {
  1072. return func(rm pmetric.ResourceMetrics) {
  1073. res.CopyTo(rm.Resource())
  1074. }
  1075. }
  1076. // WithStartTimeOverride overrides start time for all the resource metrics data points.
  1077. // This option should be only used if different start time has to be set on metrics coming from different resources.
  1078. func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption {
  1079. return func(rm pmetric.ResourceMetrics) {
  1080. var dps pmetric.NumberDataPointSlice
  1081. metrics := rm.ScopeMetrics().At(0).Metrics()
  1082. for i := 0; i < metrics.Len(); i++ {
  1083. switch metrics.At(i).Type() {
  1084. case pmetric.MetricTypeGauge:
  1085. dps = metrics.At(i).Gauge().DataPoints()
  1086. case pmetric.MetricTypeSum:
  1087. dps = metrics.At(i).Sum().DataPoints()
  1088. }
  1089. for j := 0; j < dps.Len(); j++ {
  1090. dps.At(j).SetStartTimestamp(start)
  1091. }
  1092. }
  1093. }
  1094. }
  1095. // EmitForResource saves all the generated metrics under a new resource and updates the internal state to be ready for
  1096. // recording another set of data points as part of another resource. This function can be helpful when one scraper
  1097. // needs to emit metrics from several resources. Otherwise calling this function is not required,
  1098. // just `Emit` function can be called instead.
  1099. // Resource attributes should be provided as ResourceMetricsOption arguments.
  1100. func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) {
  1101. rm := pmetric.NewResourceMetrics()
  1102. ils := rm.ScopeMetrics().AppendEmpty()
  1103. ils.Scope().SetName("otelcol/activedirectorydsreceiver")
  1104. ils.Scope().SetVersion(mb.buildInfo.Version)
  1105. ils.Metrics().EnsureCapacity(mb.metricsCapacity)
  1106. mb.metricActiveDirectoryDsBindRate.emit(ils.Metrics())
  1107. mb.metricActiveDirectoryDsLdapBindLastSuccessfulTime.emit(ils.Metrics())
  1108. mb.metricActiveDirectoryDsLdapBindRate.emit(ils.Metrics())
  1109. mb.metricActiveDirectoryDsLdapClientSessionCount.emit(ils.Metrics())
  1110. mb.metricActiveDirectoryDsLdapSearchRate.emit(ils.Metrics())
  1111. mb.metricActiveDirectoryDsNameCacheHitRate.emit(ils.Metrics())
  1112. mb.metricActiveDirectoryDsNotificationQueued.emit(ils.Metrics())
  1113. mb.metricActiveDirectoryDsOperationRate.emit(ils.Metrics())
  1114. mb.metricActiveDirectoryDsReplicationNetworkIo.emit(ils.Metrics())
  1115. mb.metricActiveDirectoryDsReplicationObjectRate.emit(ils.Metrics())
  1116. mb.metricActiveDirectoryDsReplicationOperationPending.emit(ils.Metrics())
  1117. mb.metricActiveDirectoryDsReplicationPropertyRate.emit(ils.Metrics())
  1118. mb.metricActiveDirectoryDsReplicationSyncObjectPending.emit(ils.Metrics())
  1119. mb.metricActiveDirectoryDsReplicationSyncRequestCount.emit(ils.Metrics())
  1120. mb.metricActiveDirectoryDsReplicationValueRate.emit(ils.Metrics())
  1121. mb.metricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued.emit(ils.Metrics())
  1122. mb.metricActiveDirectoryDsSuboperationRate.emit(ils.Metrics())
  1123. mb.metricActiveDirectoryDsThreadCount.emit(ils.Metrics())
  1124. for _, op := range rmo {
  1125. op(rm)
  1126. }
  1127. if ils.Metrics().Len() > 0 {
  1128. mb.updateCapacity(rm)
  1129. rm.MoveTo(mb.metricsBuffer.ResourceMetrics().AppendEmpty())
  1130. }
  1131. }
  1132. // Emit returns all the metrics accumulated by the metrics builder and updates the internal state to be ready for
  1133. // recording another set of metrics. This function will be responsible for applying all the transformations required to
  1134. // produce metric representation defined in metadata and user config, e.g. delta or cumulative.
  1135. func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics {
  1136. mb.EmitForResource(rmo...)
  1137. metrics := mb.metricsBuffer
  1138. mb.metricsBuffer = pmetric.NewMetrics()
  1139. return metrics
  1140. }
  1141. // RecordActiveDirectoryDsBindRateDataPoint adds a data point to active_directory.ds.bind.rate metric.
  1142. func (mb *MetricsBuilder) RecordActiveDirectoryDsBindRateDataPoint(ts pcommon.Timestamp, val float64, bindTypeAttributeValue AttributeBindType) {
  1143. mb.metricActiveDirectoryDsBindRate.recordDataPoint(mb.startTime, ts, val, bindTypeAttributeValue.String())
  1144. }
  1145. // RecordActiveDirectoryDsLdapBindLastSuccessfulTimeDataPoint adds a data point to active_directory.ds.ldap.bind.last_successful.time metric.
  1146. func (mb *MetricsBuilder) RecordActiveDirectoryDsLdapBindLastSuccessfulTimeDataPoint(ts pcommon.Timestamp, val int64) {
  1147. mb.metricActiveDirectoryDsLdapBindLastSuccessfulTime.recordDataPoint(mb.startTime, ts, val)
  1148. }
  1149. // RecordActiveDirectoryDsLdapBindRateDataPoint adds a data point to active_directory.ds.ldap.bind.rate metric.
  1150. func (mb *MetricsBuilder) RecordActiveDirectoryDsLdapBindRateDataPoint(ts pcommon.Timestamp, val float64) {
  1151. mb.metricActiveDirectoryDsLdapBindRate.recordDataPoint(mb.startTime, ts, val)
  1152. }
  1153. // RecordActiveDirectoryDsLdapClientSessionCountDataPoint adds a data point to active_directory.ds.ldap.client.session.count metric.
  1154. func (mb *MetricsBuilder) RecordActiveDirectoryDsLdapClientSessionCountDataPoint(ts pcommon.Timestamp, val int64) {
  1155. mb.metricActiveDirectoryDsLdapClientSessionCount.recordDataPoint(mb.startTime, ts, val)
  1156. }
  1157. // RecordActiveDirectoryDsLdapSearchRateDataPoint adds a data point to active_directory.ds.ldap.search.rate metric.
  1158. func (mb *MetricsBuilder) RecordActiveDirectoryDsLdapSearchRateDataPoint(ts pcommon.Timestamp, val float64) {
  1159. mb.metricActiveDirectoryDsLdapSearchRate.recordDataPoint(mb.startTime, ts, val)
  1160. }
  1161. // RecordActiveDirectoryDsNameCacheHitRateDataPoint adds a data point to active_directory.ds.name_cache.hit_rate metric.
  1162. func (mb *MetricsBuilder) RecordActiveDirectoryDsNameCacheHitRateDataPoint(ts pcommon.Timestamp, val float64) {
  1163. mb.metricActiveDirectoryDsNameCacheHitRate.recordDataPoint(mb.startTime, ts, val)
  1164. }
  1165. // RecordActiveDirectoryDsNotificationQueuedDataPoint adds a data point to active_directory.ds.notification.queued metric.
  1166. func (mb *MetricsBuilder) RecordActiveDirectoryDsNotificationQueuedDataPoint(ts pcommon.Timestamp, val int64) {
  1167. mb.metricActiveDirectoryDsNotificationQueued.recordDataPoint(mb.startTime, ts, val)
  1168. }
  1169. // RecordActiveDirectoryDsOperationRateDataPoint adds a data point to active_directory.ds.operation.rate metric.
  1170. func (mb *MetricsBuilder) RecordActiveDirectoryDsOperationRateDataPoint(ts pcommon.Timestamp, val float64, operationTypeAttributeValue AttributeOperationType) {
  1171. mb.metricActiveDirectoryDsOperationRate.recordDataPoint(mb.startTime, ts, val, operationTypeAttributeValue.String())
  1172. }
  1173. // RecordActiveDirectoryDsReplicationNetworkIoDataPoint adds a data point to active_directory.ds.replication.network.io metric.
  1174. func (mb *MetricsBuilder) RecordActiveDirectoryDsReplicationNetworkIoDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection, networkDataTypeAttributeValue AttributeNetworkDataType) {
  1175. mb.metricActiveDirectoryDsReplicationNetworkIo.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String(), networkDataTypeAttributeValue.String())
  1176. }
  1177. // RecordActiveDirectoryDsReplicationObjectRateDataPoint adds a data point to active_directory.ds.replication.object.rate metric.
  1178. func (mb *MetricsBuilder) RecordActiveDirectoryDsReplicationObjectRateDataPoint(ts pcommon.Timestamp, val float64, directionAttributeValue AttributeDirection) {
  1179. mb.metricActiveDirectoryDsReplicationObjectRate.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String())
  1180. }
  1181. // RecordActiveDirectoryDsReplicationOperationPendingDataPoint adds a data point to active_directory.ds.replication.operation.pending metric.
  1182. func (mb *MetricsBuilder) RecordActiveDirectoryDsReplicationOperationPendingDataPoint(ts pcommon.Timestamp, val int64) {
  1183. mb.metricActiveDirectoryDsReplicationOperationPending.recordDataPoint(mb.startTime, ts, val)
  1184. }
  1185. // RecordActiveDirectoryDsReplicationPropertyRateDataPoint adds a data point to active_directory.ds.replication.property.rate metric.
  1186. func (mb *MetricsBuilder) RecordActiveDirectoryDsReplicationPropertyRateDataPoint(ts pcommon.Timestamp, val float64, directionAttributeValue AttributeDirection) {
  1187. mb.metricActiveDirectoryDsReplicationPropertyRate.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String())
  1188. }
  1189. // RecordActiveDirectoryDsReplicationSyncObjectPendingDataPoint adds a data point to active_directory.ds.replication.sync.object.pending metric.
  1190. func (mb *MetricsBuilder) RecordActiveDirectoryDsReplicationSyncObjectPendingDataPoint(ts pcommon.Timestamp, val int64) {
  1191. mb.metricActiveDirectoryDsReplicationSyncObjectPending.recordDataPoint(mb.startTime, ts, val)
  1192. }
  1193. // RecordActiveDirectoryDsReplicationSyncRequestCountDataPoint adds a data point to active_directory.ds.replication.sync.request.count metric.
  1194. func (mb *MetricsBuilder) RecordActiveDirectoryDsReplicationSyncRequestCountDataPoint(ts pcommon.Timestamp, val int64, syncResultAttributeValue AttributeSyncResult) {
  1195. mb.metricActiveDirectoryDsReplicationSyncRequestCount.recordDataPoint(mb.startTime, ts, val, syncResultAttributeValue.String())
  1196. }
  1197. // RecordActiveDirectoryDsReplicationValueRateDataPoint adds a data point to active_directory.ds.replication.value.rate metric.
  1198. func (mb *MetricsBuilder) RecordActiveDirectoryDsReplicationValueRateDataPoint(ts pcommon.Timestamp, val float64, directionAttributeValue AttributeDirection, valueTypeAttributeValue AttributeValueType) {
  1199. mb.metricActiveDirectoryDsReplicationValueRate.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String(), valueTypeAttributeValue.String())
  1200. }
  1201. // RecordActiveDirectoryDsSecurityDescriptorPropagationsEventQueuedDataPoint adds a data point to active_directory.ds.security_descriptor_propagations_event.queued metric.
  1202. func (mb *MetricsBuilder) RecordActiveDirectoryDsSecurityDescriptorPropagationsEventQueuedDataPoint(ts pcommon.Timestamp, val int64) {
  1203. mb.metricActiveDirectoryDsSecurityDescriptorPropagationsEventQueued.recordDataPoint(mb.startTime, ts, val)
  1204. }
  1205. // RecordActiveDirectoryDsSuboperationRateDataPoint adds a data point to active_directory.ds.suboperation.rate metric.
  1206. func (mb *MetricsBuilder) RecordActiveDirectoryDsSuboperationRateDataPoint(ts pcommon.Timestamp, val float64, suboperationTypeAttributeValue AttributeSuboperationType) {
  1207. mb.metricActiveDirectoryDsSuboperationRate.recordDataPoint(mb.startTime, ts, val, suboperationTypeAttributeValue.String())
  1208. }
  1209. // RecordActiveDirectoryDsThreadCountDataPoint adds a data point to active_directory.ds.thread.count metric.
  1210. func (mb *MetricsBuilder) RecordActiveDirectoryDsThreadCountDataPoint(ts pcommon.Timestamp, val int64) {
  1211. mb.metricActiveDirectoryDsThreadCount.recordDataPoint(mb.startTime, ts, val)
  1212. }
  1213. // Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted,
  1214. // and metrics builder should update its startTime and reset it's internal state accordingly.
  1215. func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) {
  1216. mb.startTime = pcommon.NewTimestampFromTime(time.Now())
  1217. for _, op := range options {
  1218. op(mb)
  1219. }
  1220. }