Debian Codegraph @

semconv/v1.40.0/openshiftconv/metric.go

raw
1 // Code generated from semantic convention specification. DO NOT EDIT.
2
3 // Copyright The OpenTelemetry Authors
4 // SPDX-License-Identifier: Apache-2.0
5
6 // Package openshiftconv provides types and functionality for OpenTelemetry semantic
7 // conventions in the "openshift" namespace.
8 package openshiftconv
9
10 import (
11 "context"
12 "sync"
13
14 "go.opentelemetry.io/otel/attribute"
15 "go.opentelemetry.io/otel/metric"
16 "go.opentelemetry.io/otel/metric/noop"
17 )
18
19 var (
20 addOptPool = &sync.Pool{New: func() any { return &[]metric.AddOption{} }}
21 recOptPool = &sync.Pool{New: func() any { return &[]metric.RecordOption{} }}
22 )
23
24 // ClusterquotaCPULimitHard is an instrument used to record metric values
25 // conforming to the "openshift.clusterquota.cpu.limit.hard" semantic
26 // conventions. It represents the enforced hard limit of the resource across all
27 // projects.
28 type ClusterquotaCPULimitHard struct {
29 metric.Int64UpDownCounter
30 }
31
32 var newClusterquotaCPULimitHardOpts = []metric.Int64UpDownCounterOption{
33 metric.WithDescription("The enforced hard limit of the resource across all projects."),
34 metric.WithUnit("{cpu}"),
35 }
36
37 // NewClusterquotaCPULimitHard returns a new ClusterquotaCPULimitHard instrument.
38 func NewClusterquotaCPULimitHard(
39 m metric.Meter,
40 opt ...metric.Int64UpDownCounterOption,
41 ) (ClusterquotaCPULimitHard, error) {
42 // Check if the meter is nil.
43 if m == nil {
44 return ClusterquotaCPULimitHard{noop.Int64UpDownCounter{}}, nil
45 }
46
47 if len(opt) == 0 {
48 opt = newClusterquotaCPULimitHardOpts
49 } else {
50 opt = append(opt, newClusterquotaCPULimitHardOpts...)
51 }
52
53 i, err := m.Int64UpDownCounter(
54 "openshift.clusterquota.cpu.limit.hard",
55 opt...,
56 )
57 if err != nil {
58 return ClusterquotaCPULimitHard{noop.Int64UpDownCounter{}}, err
59 }
60 return ClusterquotaCPULimitHard{i}, nil
61 }
62
63 // Inst returns the underlying metric instrument.
64 func (m ClusterquotaCPULimitHard) Inst() metric.Int64UpDownCounter {
65 return m.Int64UpDownCounter
66 }
67
68 // Name returns the semantic convention name of the instrument.
69 func (ClusterquotaCPULimitHard) Name() string {
70 return "openshift.clusterquota.cpu.limit.hard"
71 }
72
73 // Unit returns the semantic convention unit of the instrument
74 func (ClusterquotaCPULimitHard) Unit() string {
75 return "{cpu}"
76 }
77
78 // Description returns the semantic convention description of the instrument
79 func (ClusterquotaCPULimitHard) Description() string {
80 return "The enforced hard limit of the resource across all projects."
81 }
82
83 // Add adds incr to the existing count for attrs.
84 //
85 // This metric is retrieved from the `Status.Total.Hard` field of the
86 // [K8s ResourceQuotaStatus]
87 // of the
88 // [ClusterResourceQuota].
89 //
90 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
91 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
92 func (m ClusterquotaCPULimitHard) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
93 if len(attrs) == 0 {
94 m.Int64UpDownCounter.Add(ctx, incr)
95 return
96 }
97
98 o := addOptPool.Get().(*[]metric.AddOption)
99 defer func() {
100 *o = (*o)[:0]
101 addOptPool.Put(o)
102 }()
103
104 *o = append(*o, metric.WithAttributes(attrs...))
105 m.Int64UpDownCounter.Add(ctx, incr, *o...)
106 }
107
108 // AddSet adds incr to the existing count for set.
109 //
110 // This metric is retrieved from the `Status.Total.Hard` field of the
111 // [K8s ResourceQuotaStatus]
112 // of the
113 // [ClusterResourceQuota].
114 //
115 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
116 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
117 func (m ClusterquotaCPULimitHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
118 if set.Len() == 0 {
119 m.Int64UpDownCounter.Add(ctx, incr)
120 return
121 }
122
123 o := addOptPool.Get().(*[]metric.AddOption)
124 defer func() {
125 *o = (*o)[:0]
126 addOptPool.Put(o)
127 }()
128
129 *o = append(*o, metric.WithAttributeSet(set))
130 m.Int64UpDownCounter.Add(ctx, incr, *o...)
131 }
132
133 // ClusterquotaCPULimitUsed is an instrument used to record metric values
134 // conforming to the "openshift.clusterquota.cpu.limit.used" semantic
135 // conventions. It represents the current observed total usage of the resource
136 // across all projects.
137 type ClusterquotaCPULimitUsed struct {
138 metric.Int64UpDownCounter
139 }
140
141 var newClusterquotaCPULimitUsedOpts = []metric.Int64UpDownCounterOption{
142 metric.WithDescription("The current observed total usage of the resource across all projects."),
143 metric.WithUnit("{cpu}"),
144 }
145
146 // NewClusterquotaCPULimitUsed returns a new ClusterquotaCPULimitUsed instrument.
147 func NewClusterquotaCPULimitUsed(
148 m metric.Meter,
149 opt ...metric.Int64UpDownCounterOption,
150 ) (ClusterquotaCPULimitUsed, error) {
151 // Check if the meter is nil.
152 if m == nil {
153 return ClusterquotaCPULimitUsed{noop.Int64UpDownCounter{}}, nil
154 }
155
156 if len(opt) == 0 {
157 opt = newClusterquotaCPULimitUsedOpts
158 } else {
159 opt = append(opt, newClusterquotaCPULimitUsedOpts...)
160 }
161
162 i, err := m.Int64UpDownCounter(
163 "openshift.clusterquota.cpu.limit.used",
164 opt...,
165 )
166 if err != nil {
167 return ClusterquotaCPULimitUsed{noop.Int64UpDownCounter{}}, err
168 }
169 return ClusterquotaCPULimitUsed{i}, nil
170 }
171
172 // Inst returns the underlying metric instrument.
173 func (m ClusterquotaCPULimitUsed) Inst() metric.Int64UpDownCounter {
174 return m.Int64UpDownCounter
175 }
176
177 // Name returns the semantic convention name of the instrument.
178 func (ClusterquotaCPULimitUsed) Name() string {
179 return "openshift.clusterquota.cpu.limit.used"
180 }
181
182 // Unit returns the semantic convention unit of the instrument
183 func (ClusterquotaCPULimitUsed) Unit() string {
184 return "{cpu}"
185 }
186
187 // Description returns the semantic convention description of the instrument
188 func (ClusterquotaCPULimitUsed) Description() string {
189 return "The current observed total usage of the resource across all projects."
190 }
191
192 // Add adds incr to the existing count for attrs.
193 //
194 // This metric is retrieved from the `Status.Total.Used` field of the
195 // [K8s ResourceQuotaStatus]
196 // of the
197 // [ClusterResourceQuota].
198 //
199 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
200 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
201 func (m ClusterquotaCPULimitUsed) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
202 if len(attrs) == 0 {
203 m.Int64UpDownCounter.Add(ctx, incr)
204 return
205 }
206
207 o := addOptPool.Get().(*[]metric.AddOption)
208 defer func() {
209 *o = (*o)[:0]
210 addOptPool.Put(o)
211 }()
212
213 *o = append(*o, metric.WithAttributes(attrs...))
214 m.Int64UpDownCounter.Add(ctx, incr, *o...)
215 }
216
217 // AddSet adds incr to the existing count for set.
218 //
219 // This metric is retrieved from the `Status.Total.Used` field of the
220 // [K8s ResourceQuotaStatus]
221 // of the
222 // [ClusterResourceQuota].
223 //
224 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
225 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
226 func (m ClusterquotaCPULimitUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
227 if set.Len() == 0 {
228 m.Int64UpDownCounter.Add(ctx, incr)
229 return
230 }
231
232 o := addOptPool.Get().(*[]metric.AddOption)
233 defer func() {
234 *o = (*o)[:0]
235 addOptPool.Put(o)
236 }()
237
238 *o = append(*o, metric.WithAttributeSet(set))
239 m.Int64UpDownCounter.Add(ctx, incr, *o...)
240 }
241
242 // ClusterquotaCPURequestHard is an instrument used to record metric values
243 // conforming to the "openshift.clusterquota.cpu.request.hard" semantic
244 // conventions. It represents the enforced hard limit of the resource across all
245 // projects.
246 type ClusterquotaCPURequestHard struct {
247 metric.Int64UpDownCounter
248 }
249
250 var newClusterquotaCPURequestHardOpts = []metric.Int64UpDownCounterOption{
251 metric.WithDescription("The enforced hard limit of the resource across all projects."),
252 metric.WithUnit("{cpu}"),
253 }
254
255 // NewClusterquotaCPURequestHard returns a new ClusterquotaCPURequestHard
256 // instrument.
257 func NewClusterquotaCPURequestHard(
258 m metric.Meter,
259 opt ...metric.Int64UpDownCounterOption,
260 ) (ClusterquotaCPURequestHard, error) {
261 // Check if the meter is nil.
262 if m == nil {
263 return ClusterquotaCPURequestHard{noop.Int64UpDownCounter{}}, nil
264 }
265
266 if len(opt) == 0 {
267 opt = newClusterquotaCPURequestHardOpts
268 } else {
269 opt = append(opt, newClusterquotaCPURequestHardOpts...)
270 }
271
272 i, err := m.Int64UpDownCounter(
273 "openshift.clusterquota.cpu.request.hard",
274 opt...,
275 )
276 if err != nil {
277 return ClusterquotaCPURequestHard{noop.Int64UpDownCounter{}}, err
278 }
279 return ClusterquotaCPURequestHard{i}, nil
280 }
281
282 // Inst returns the underlying metric instrument.
283 func (m ClusterquotaCPURequestHard) Inst() metric.Int64UpDownCounter {
284 return m.Int64UpDownCounter
285 }
286
287 // Name returns the semantic convention name of the instrument.
288 func (ClusterquotaCPURequestHard) Name() string {
289 return "openshift.clusterquota.cpu.request.hard"
290 }
291
292 // Unit returns the semantic convention unit of the instrument
293 func (ClusterquotaCPURequestHard) Unit() string {
294 return "{cpu}"
295 }
296
297 // Description returns the semantic convention description of the instrument
298 func (ClusterquotaCPURequestHard) Description() string {
299 return "The enforced hard limit of the resource across all projects."
300 }
301
302 // Add adds incr to the existing count for attrs.
303 //
304 // This metric is retrieved from the `Status.Total.Hard` field of the
305 // [K8s ResourceQuotaStatus]
306 // of the
307 // [ClusterResourceQuota].
308 //
309 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
310 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
311 func (m ClusterquotaCPURequestHard) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
312 if len(attrs) == 0 {
313 m.Int64UpDownCounter.Add(ctx, incr)
314 return
315 }
316
317 o := addOptPool.Get().(*[]metric.AddOption)
318 defer func() {
319 *o = (*o)[:0]
320 addOptPool.Put(o)
321 }()
322
323 *o = append(*o, metric.WithAttributes(attrs...))
324 m.Int64UpDownCounter.Add(ctx, incr, *o...)
325 }
326
327 // AddSet adds incr to the existing count for set.
328 //
329 // This metric is retrieved from the `Status.Total.Hard` field of the
330 // [K8s ResourceQuotaStatus]
331 // of the
332 // [ClusterResourceQuota].
333 //
334 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
335 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
336 func (m ClusterquotaCPURequestHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
337 if set.Len() == 0 {
338 m.Int64UpDownCounter.Add(ctx, incr)
339 return
340 }
341
342 o := addOptPool.Get().(*[]metric.AddOption)
343 defer func() {
344 *o = (*o)[:0]
345 addOptPool.Put(o)
346 }()
347
348 *o = append(*o, metric.WithAttributeSet(set))
349 m.Int64UpDownCounter.Add(ctx, incr, *o...)
350 }
351
352 // ClusterquotaCPURequestUsed is an instrument used to record metric values
353 // conforming to the "openshift.clusterquota.cpu.request.used" semantic
354 // conventions. It represents the current observed total usage of the resource
355 // across all projects.
356 type ClusterquotaCPURequestUsed struct {
357 metric.Int64UpDownCounter
358 }
359
360 var newClusterquotaCPURequestUsedOpts = []metric.Int64UpDownCounterOption{
361 metric.WithDescription("The current observed total usage of the resource across all projects."),
362 metric.WithUnit("{cpu}"),
363 }
364
365 // NewClusterquotaCPURequestUsed returns a new ClusterquotaCPURequestUsed
366 // instrument.
367 func NewClusterquotaCPURequestUsed(
368 m metric.Meter,
369 opt ...metric.Int64UpDownCounterOption,
370 ) (ClusterquotaCPURequestUsed, error) {
371 // Check if the meter is nil.
372 if m == nil {
373 return ClusterquotaCPURequestUsed{noop.Int64UpDownCounter{}}, nil
374 }
375
376 if len(opt) == 0 {
377 opt = newClusterquotaCPURequestUsedOpts
378 } else {
379 opt = append(opt, newClusterquotaCPURequestUsedOpts...)
380 }
381
382 i, err := m.Int64UpDownCounter(
383 "openshift.clusterquota.cpu.request.used",
384 opt...,
385 )
386 if err != nil {
387 return ClusterquotaCPURequestUsed{noop.Int64UpDownCounter{}}, err
388 }
389 return ClusterquotaCPURequestUsed{i}, nil
390 }
391
392 // Inst returns the underlying metric instrument.
393 func (m ClusterquotaCPURequestUsed) Inst() metric.Int64UpDownCounter {
394 return m.Int64UpDownCounter
395 }
396
397 // Name returns the semantic convention name of the instrument.
398 func (ClusterquotaCPURequestUsed) Name() string {
399 return "openshift.clusterquota.cpu.request.used"
400 }
401
402 // Unit returns the semantic convention unit of the instrument
403 func (ClusterquotaCPURequestUsed) Unit() string {
404 return "{cpu}"
405 }
406
407 // Description returns the semantic convention description of the instrument
408 func (ClusterquotaCPURequestUsed) Description() string {
409 return "The current observed total usage of the resource across all projects."
410 }
411
412 // Add adds incr to the existing count for attrs.
413 //
414 // This metric is retrieved from the `Status.Total.Used` field of the
415 // [K8s ResourceQuotaStatus]
416 // of the
417 // [ClusterResourceQuota].
418 //
419 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
420 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
421 func (m ClusterquotaCPURequestUsed) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
422 if len(attrs) == 0 {
423 m.Int64UpDownCounter.Add(ctx, incr)
424 return
425 }
426
427 o := addOptPool.Get().(*[]metric.AddOption)
428 defer func() {
429 *o = (*o)[:0]
430 addOptPool.Put(o)
431 }()
432
433 *o = append(*o, metric.WithAttributes(attrs...))
434 m.Int64UpDownCounter.Add(ctx, incr, *o...)
435 }
436
437 // AddSet adds incr to the existing count for set.
438 //
439 // This metric is retrieved from the `Status.Total.Used` field of the
440 // [K8s ResourceQuotaStatus]
441 // of the
442 // [ClusterResourceQuota].
443 //
444 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
445 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
446 func (m ClusterquotaCPURequestUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
447 if set.Len() == 0 {
448 m.Int64UpDownCounter.Add(ctx, incr)
449 return
450 }
451
452 o := addOptPool.Get().(*[]metric.AddOption)
453 defer func() {
454 *o = (*o)[:0]
455 addOptPool.Put(o)
456 }()
457
458 *o = append(*o, metric.WithAttributeSet(set))
459 m.Int64UpDownCounter.Add(ctx, incr, *o...)
460 }
461
462 // ClusterquotaEphemeralStorageLimitHard is an instrument used to record metric
463 // values conforming to the "openshift.clusterquota.ephemeral_storage.limit.hard"
464 // semantic conventions. It represents the enforced hard limit of the resource
465 // across all projects.
466 type ClusterquotaEphemeralStorageLimitHard struct {
467 metric.Int64UpDownCounter
468 }
469
470 var newClusterquotaEphemeralStorageLimitHardOpts = []metric.Int64UpDownCounterOption{
471 metric.WithDescription("The enforced hard limit of the resource across all projects."),
472 metric.WithUnit("By"),
473 }
474
475 // NewClusterquotaEphemeralStorageLimitHard returns a new
476 // ClusterquotaEphemeralStorageLimitHard instrument.
477 func NewClusterquotaEphemeralStorageLimitHard(
478 m metric.Meter,
479 opt ...metric.Int64UpDownCounterOption,
480 ) (ClusterquotaEphemeralStorageLimitHard, error) {
481 // Check if the meter is nil.
482 if m == nil {
483 return ClusterquotaEphemeralStorageLimitHard{noop.Int64UpDownCounter{}}, nil
484 }
485
486 if len(opt) == 0 {
487 opt = newClusterquotaEphemeralStorageLimitHardOpts
488 } else {
489 opt = append(opt, newClusterquotaEphemeralStorageLimitHardOpts...)
490 }
491
492 i, err := m.Int64UpDownCounter(
493 "openshift.clusterquota.ephemeral_storage.limit.hard",
494 opt...,
495 )
496 if err != nil {
497 return ClusterquotaEphemeralStorageLimitHard{noop.Int64UpDownCounter{}}, err
498 }
499 return ClusterquotaEphemeralStorageLimitHard{i}, nil
500 }
501
502 // Inst returns the underlying metric instrument.
503 func (m ClusterquotaEphemeralStorageLimitHard) Inst() metric.Int64UpDownCounter {
504 return m.Int64UpDownCounter
505 }
506
507 // Name returns the semantic convention name of the instrument.
508 func (ClusterquotaEphemeralStorageLimitHard) Name() string {
509 return "openshift.clusterquota.ephemeral_storage.limit.hard"
510 }
511
512 // Unit returns the semantic convention unit of the instrument
513 func (ClusterquotaEphemeralStorageLimitHard) Unit() string {
514 return "By"
515 }
516
517 // Description returns the semantic convention description of the instrument
518 func (ClusterquotaEphemeralStorageLimitHard) Description() string {
519 return "The enforced hard limit of the resource across all projects."
520 }
521
522 // Add adds incr to the existing count for attrs.
523 //
524 // This metric is retrieved from the `Status.Total.Hard` field of the
525 // [K8s ResourceQuotaStatus]
526 // of the
527 // [ClusterResourceQuota].
528 //
529 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
530 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
531 func (m ClusterquotaEphemeralStorageLimitHard) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
532 if len(attrs) == 0 {
533 m.Int64UpDownCounter.Add(ctx, incr)
534 return
535 }
536
537 o := addOptPool.Get().(*[]metric.AddOption)
538 defer func() {
539 *o = (*o)[:0]
540 addOptPool.Put(o)
541 }()
542
543 *o = append(*o, metric.WithAttributes(attrs...))
544 m.Int64UpDownCounter.Add(ctx, incr, *o...)
545 }
546
547 // AddSet adds incr to the existing count for set.
548 //
549 // This metric is retrieved from the `Status.Total.Hard` field of the
550 // [K8s ResourceQuotaStatus]
551 // of the
552 // [ClusterResourceQuota].
553 //
554 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
555 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
556 func (m ClusterquotaEphemeralStorageLimitHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
557 if set.Len() == 0 {
558 m.Int64UpDownCounter.Add(ctx, incr)
559 return
560 }
561
562 o := addOptPool.Get().(*[]metric.AddOption)
563 defer func() {
564 *o = (*o)[:0]
565 addOptPool.Put(o)
566 }()
567
568 *o = append(*o, metric.WithAttributeSet(set))
569 m.Int64UpDownCounter.Add(ctx, incr, *o...)
570 }
571
572 // ClusterquotaEphemeralStorageLimitUsed is an instrument used to record metric
573 // values conforming to the "openshift.clusterquota.ephemeral_storage.limit.used"
574 // semantic conventions. It represents the current observed total usage of the
575 // resource across all projects.
576 type ClusterquotaEphemeralStorageLimitUsed struct {
577 metric.Int64UpDownCounter
578 }
579
580 var newClusterquotaEphemeralStorageLimitUsedOpts = []metric.Int64UpDownCounterOption{
581 metric.WithDescription("The current observed total usage of the resource across all projects."),
582 metric.WithUnit("By"),
583 }
584
585 // NewClusterquotaEphemeralStorageLimitUsed returns a new
586 // ClusterquotaEphemeralStorageLimitUsed instrument.
587 func NewClusterquotaEphemeralStorageLimitUsed(
588 m metric.Meter,
589 opt ...metric.Int64UpDownCounterOption,
590 ) (ClusterquotaEphemeralStorageLimitUsed, error) {
591 // Check if the meter is nil.
592 if m == nil {
593 return ClusterquotaEphemeralStorageLimitUsed{noop.Int64UpDownCounter{}}, nil
594 }
595
596 if len(opt) == 0 {
597 opt = newClusterquotaEphemeralStorageLimitUsedOpts
598 } else {
599 opt = append(opt, newClusterquotaEphemeralStorageLimitUsedOpts...)
600 }
601
602 i, err := m.Int64UpDownCounter(
603 "openshift.clusterquota.ephemeral_storage.limit.used",
604 opt...,
605 )
606 if err != nil {
607 return ClusterquotaEphemeralStorageLimitUsed{noop.Int64UpDownCounter{}}, err
608 }
609 return ClusterquotaEphemeralStorageLimitUsed{i}, nil
610 }
611
612 // Inst returns the underlying metric instrument.
613 func (m ClusterquotaEphemeralStorageLimitUsed) Inst() metric.Int64UpDownCounter {
614 return m.Int64UpDownCounter
615 }
616
617 // Name returns the semantic convention name of the instrument.
618 func (ClusterquotaEphemeralStorageLimitUsed) Name() string {
619 return "openshift.clusterquota.ephemeral_storage.limit.used"
620 }
621
622 // Unit returns the semantic convention unit of the instrument
623 func (ClusterquotaEphemeralStorageLimitUsed) Unit() string {
624 return "By"
625 }
626
627 // Description returns the semantic convention description of the instrument
628 func (ClusterquotaEphemeralStorageLimitUsed) Description() string {
629 return "The current observed total usage of the resource across all projects."
630 }
631
632 // Add adds incr to the existing count for attrs.
633 //
634 // This metric is retrieved from the `Status.Total.Used` field of the
635 // [K8s ResourceQuotaStatus]
636 // of the
637 // [ClusterResourceQuota].
638 //
639 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
640 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
641 func (m ClusterquotaEphemeralStorageLimitUsed) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
642 if len(attrs) == 0 {
643 m.Int64UpDownCounter.Add(ctx, incr)
644 return
645 }
646
647 o := addOptPool.Get().(*[]metric.AddOption)
648 defer func() {
649 *o = (*o)[:0]
650 addOptPool.Put(o)
651 }()
652
653 *o = append(*o, metric.WithAttributes(attrs...))
654 m.Int64UpDownCounter.Add(ctx, incr, *o...)
655 }
656
657 // AddSet adds incr to the existing count for set.
658 //
659 // This metric is retrieved from the `Status.Total.Used` field of the
660 // [K8s ResourceQuotaStatus]
661 // of the
662 // [ClusterResourceQuota].
663 //
664 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
665 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
666 func (m ClusterquotaEphemeralStorageLimitUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
667 if set.Len() == 0 {
668 m.Int64UpDownCounter.Add(ctx, incr)
669 return
670 }
671
672 o := addOptPool.Get().(*[]metric.AddOption)
673 defer func() {
674 *o = (*o)[:0]
675 addOptPool.Put(o)
676 }()
677
678 *o = append(*o, metric.WithAttributeSet(set))
679 m.Int64UpDownCounter.Add(ctx, incr, *o...)
680 }
681
682 // ClusterquotaEphemeralStorageRequestHard is an instrument used to record metric
683 // values conforming to the
684 // "openshift.clusterquota.ephemeral_storage.request.hard" semantic conventions.
685 // It represents the enforced hard limit of the resource across all projects.
686 type ClusterquotaEphemeralStorageRequestHard struct {
687 metric.Int64UpDownCounter
688 }
689
690 var newClusterquotaEphemeralStorageRequestHardOpts = []metric.Int64UpDownCounterOption{
691 metric.WithDescription("The enforced hard limit of the resource across all projects."),
692 metric.WithUnit("By"),
693 }
694
695 // NewClusterquotaEphemeralStorageRequestHard returns a new
696 // ClusterquotaEphemeralStorageRequestHard instrument.
697 func NewClusterquotaEphemeralStorageRequestHard(
698 m metric.Meter,
699 opt ...metric.Int64UpDownCounterOption,
700 ) (ClusterquotaEphemeralStorageRequestHard, error) {
701 // Check if the meter is nil.
702 if m == nil {
703 return ClusterquotaEphemeralStorageRequestHard{noop.Int64UpDownCounter{}}, nil
704 }
705
706 if len(opt) == 0 {
707 opt = newClusterquotaEphemeralStorageRequestHardOpts
708 } else {
709 opt = append(opt, newClusterquotaEphemeralStorageRequestHardOpts...)
710 }
711
712 i, err := m.Int64UpDownCounter(
713 "openshift.clusterquota.ephemeral_storage.request.hard",
714 opt...,
715 )
716 if err != nil {
717 return ClusterquotaEphemeralStorageRequestHard{noop.Int64UpDownCounter{}}, err
718 }
719 return ClusterquotaEphemeralStorageRequestHard{i}, nil
720 }
721
722 // Inst returns the underlying metric instrument.
723 func (m ClusterquotaEphemeralStorageRequestHard) Inst() metric.Int64UpDownCounter {
724 return m.Int64UpDownCounter
725 }
726
727 // Name returns the semantic convention name of the instrument.
728 func (ClusterquotaEphemeralStorageRequestHard) Name() string {
729 return "openshift.clusterquota.ephemeral_storage.request.hard"
730 }
731
732 // Unit returns the semantic convention unit of the instrument
733 func (ClusterquotaEphemeralStorageRequestHard) Unit() string {
734 return "By"
735 }
736
737 // Description returns the semantic convention description of the instrument
738 func (ClusterquotaEphemeralStorageRequestHard) Description() string {
739 return "The enforced hard limit of the resource across all projects."
740 }
741
742 // Add adds incr to the existing count for attrs.
743 //
744 // This metric is retrieved from the `Status.Total.Hard` field of the
745 // [K8s ResourceQuotaStatus]
746 // of the
747 // [ClusterResourceQuota].
748 //
749 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
750 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
751 func (m ClusterquotaEphemeralStorageRequestHard) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
752 if len(attrs) == 0 {
753 m.Int64UpDownCounter.Add(ctx, incr)
754 return
755 }
756
757 o := addOptPool.Get().(*[]metric.AddOption)
758 defer func() {
759 *o = (*o)[:0]
760 addOptPool.Put(o)
761 }()
762
763 *o = append(*o, metric.WithAttributes(attrs...))
764 m.Int64UpDownCounter.Add(ctx, incr, *o...)
765 }
766
767 // AddSet adds incr to the existing count for set.
768 //
769 // This metric is retrieved from the `Status.Total.Hard` field of the
770 // [K8s ResourceQuotaStatus]
771 // of the
772 // [ClusterResourceQuota].
773 //
774 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
775 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
776 func (m ClusterquotaEphemeralStorageRequestHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
777 if set.Len() == 0 {
778 m.Int64UpDownCounter.Add(ctx, incr)
779 return
780 }
781
782 o := addOptPool.Get().(*[]metric.AddOption)
783 defer func() {
784 *o = (*o)[:0]
785 addOptPool.Put(o)
786 }()
787
788 *o = append(*o, metric.WithAttributeSet(set))
789 m.Int64UpDownCounter.Add(ctx, incr, *o...)
790 }
791
792 // ClusterquotaEphemeralStorageRequestUsed is an instrument used to record metric
793 // values conforming to the
794 // "openshift.clusterquota.ephemeral_storage.request.used" semantic conventions.
795 // It represents the current observed total usage of the resource across all
796 // projects.
797 type ClusterquotaEphemeralStorageRequestUsed struct {
798 metric.Int64UpDownCounter
799 }
800
801 var newClusterquotaEphemeralStorageRequestUsedOpts = []metric.Int64UpDownCounterOption{
802 metric.WithDescription("The current observed total usage of the resource across all projects."),
803 metric.WithUnit("By"),
804 }
805
806 // NewClusterquotaEphemeralStorageRequestUsed returns a new
807 // ClusterquotaEphemeralStorageRequestUsed instrument.
808 func NewClusterquotaEphemeralStorageRequestUsed(
809 m metric.Meter,
810 opt ...metric.Int64UpDownCounterOption,
811 ) (ClusterquotaEphemeralStorageRequestUsed, error) {
812 // Check if the meter is nil.
813 if m == nil {
814 return ClusterquotaEphemeralStorageRequestUsed{noop.Int64UpDownCounter{}}, nil
815 }
816
817 if len(opt) == 0 {
818 opt = newClusterquotaEphemeralStorageRequestUsedOpts
819 } else {
820 opt = append(opt, newClusterquotaEphemeralStorageRequestUsedOpts...)
821 }
822
823 i, err := m.Int64UpDownCounter(
824 "openshift.clusterquota.ephemeral_storage.request.used",
825 opt...,
826 )
827 if err != nil {
828 return ClusterquotaEphemeralStorageRequestUsed{noop.Int64UpDownCounter{}}, err
829 }
830 return ClusterquotaEphemeralStorageRequestUsed{i}, nil
831 }
832
833 // Inst returns the underlying metric instrument.
834 func (m ClusterquotaEphemeralStorageRequestUsed) Inst() metric.Int64UpDownCounter {
835 return m.Int64UpDownCounter
836 }
837
838 // Name returns the semantic convention name of the instrument.
839 func (ClusterquotaEphemeralStorageRequestUsed) Name() string {
840 return "openshift.clusterquota.ephemeral_storage.request.used"
841 }
842
843 // Unit returns the semantic convention unit of the instrument
844 func (ClusterquotaEphemeralStorageRequestUsed) Unit() string {
845 return "By"
846 }
847
848 // Description returns the semantic convention description of the instrument
849 func (ClusterquotaEphemeralStorageRequestUsed) Description() string {
850 return "The current observed total usage of the resource across all projects."
851 }
852
853 // Add adds incr to the existing count for attrs.
854 //
855 // This metric is retrieved from the `Status.Total.Used` field of the
856 // [K8s ResourceQuotaStatus]
857 // of the
858 // [ClusterResourceQuota].
859 //
860 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
861 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
862 func (m ClusterquotaEphemeralStorageRequestUsed) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
863 if len(attrs) == 0 {
864 m.Int64UpDownCounter.Add(ctx, incr)
865 return
866 }
867
868 o := addOptPool.Get().(*[]metric.AddOption)
869 defer func() {
870 *o = (*o)[:0]
871 addOptPool.Put(o)
872 }()
873
874 *o = append(*o, metric.WithAttributes(attrs...))
875 m.Int64UpDownCounter.Add(ctx, incr, *o...)
876 }
877
878 // AddSet adds incr to the existing count for set.
879 //
880 // This metric is retrieved from the `Status.Total.Used` field of the
881 // [K8s ResourceQuotaStatus]
882 // of the
883 // [ClusterResourceQuota].
884 //
885 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
886 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
887 func (m ClusterquotaEphemeralStorageRequestUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
888 if set.Len() == 0 {
889 m.Int64UpDownCounter.Add(ctx, incr)
890 return
891 }
892
893 o := addOptPool.Get().(*[]metric.AddOption)
894 defer func() {
895 *o = (*o)[:0]
896 addOptPool.Put(o)
897 }()
898
899 *o = append(*o, metric.WithAttributeSet(set))
900 m.Int64UpDownCounter.Add(ctx, incr, *o...)
901 }
902
903 // ClusterquotaHugepageCountRequestHard is an instrument used to record metric
904 // values conforming to the "openshift.clusterquota.hugepage_count.request.hard"
905 // semantic conventions. It represents the enforced hard limit of the resource
906 // across all projects.
907 type ClusterquotaHugepageCountRequestHard struct {
908 metric.Int64UpDownCounter
909 }
910
911 var newClusterquotaHugepageCountRequestHardOpts = []metric.Int64UpDownCounterOption{
912 metric.WithDescription("The enforced hard limit of the resource across all projects."),
913 metric.WithUnit("{hugepage}"),
914 }
915
916 // NewClusterquotaHugepageCountRequestHard returns a new
917 // ClusterquotaHugepageCountRequestHard instrument.
918 func NewClusterquotaHugepageCountRequestHard(
919 m metric.Meter,
920 opt ...metric.Int64UpDownCounterOption,
921 ) (ClusterquotaHugepageCountRequestHard, error) {
922 // Check if the meter is nil.
923 if m == nil {
924 return ClusterquotaHugepageCountRequestHard{noop.Int64UpDownCounter{}}, nil
925 }
926
927 if len(opt) == 0 {
928 opt = newClusterquotaHugepageCountRequestHardOpts
929 } else {
930 opt = append(opt, newClusterquotaHugepageCountRequestHardOpts...)
931 }
932
933 i, err := m.Int64UpDownCounter(
934 "openshift.clusterquota.hugepage_count.request.hard",
935 opt...,
936 )
937 if err != nil {
938 return ClusterquotaHugepageCountRequestHard{noop.Int64UpDownCounter{}}, err
939 }
940 return ClusterquotaHugepageCountRequestHard{i}, nil
941 }
942
943 // Inst returns the underlying metric instrument.
944 func (m ClusterquotaHugepageCountRequestHard) Inst() metric.Int64UpDownCounter {
945 return m.Int64UpDownCounter
946 }
947
948 // Name returns the semantic convention name of the instrument.
949 func (ClusterquotaHugepageCountRequestHard) Name() string {
950 return "openshift.clusterquota.hugepage_count.request.hard"
951 }
952
953 // Unit returns the semantic convention unit of the instrument
954 func (ClusterquotaHugepageCountRequestHard) Unit() string {
955 return "{hugepage}"
956 }
957
958 // Description returns the semantic convention description of the instrument
959 func (ClusterquotaHugepageCountRequestHard) Description() string {
960 return "The enforced hard limit of the resource across all projects."
961 }
962
963 // Add adds incr to the existing count for attrs.
964 //
965 // The k8sHugepageSize is the the size (identifier) of the K8s huge page.
966 //
967 // This metric is retrieved from the `Status.Total.Hard` field of the
968 // [K8s ResourceQuotaStatus]
969 // of the
970 // [ClusterResourceQuota].
971 //
972 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
973 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
974 func (m ClusterquotaHugepageCountRequestHard) Add(
975 ctx context.Context,
976 incr int64,
977 k8sHugepageSize string,
978 attrs ...attribute.KeyValue,
979 ) {
980 if len(attrs) == 0 {
981 m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes(
982 attribute.String("k8s.hugepage.size", k8sHugepageSize),
983 ))
984 return
985 }
986
987 o := addOptPool.Get().(*[]metric.AddOption)
988 defer func() {
989 *o = (*o)[:0]
990 addOptPool.Put(o)
991 }()
992
993 *o = append(
994 *o,
995 metric.WithAttributes(
996 append(
997 attrs[:len(attrs):len(attrs)],
998 attribute.String("k8s.hugepage.size", k8sHugepageSize),
999 )...,
1000 ),
1001 )
1002
1003 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1004 }
1005
1006 // AddSet adds incr to the existing count for set.
1007 //
1008 // This metric is retrieved from the `Status.Total.Hard` field of the
1009 // [K8s ResourceQuotaStatus]
1010 // of the
1011 // [ClusterResourceQuota].
1012 //
1013 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1014 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1015 func (m ClusterquotaHugepageCountRequestHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1016 if set.Len() == 0 {
1017 m.Int64UpDownCounter.Add(ctx, incr)
1018 return
1019 }
1020
1021 o := addOptPool.Get().(*[]metric.AddOption)
1022 defer func() {
1023 *o = (*o)[:0]
1024 addOptPool.Put(o)
1025 }()
1026
1027 *o = append(*o, metric.WithAttributeSet(set))
1028 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1029 }
1030
1031 // ClusterquotaHugepageCountRequestUsed is an instrument used to record metric
1032 // values conforming to the "openshift.clusterquota.hugepage_count.request.used"
1033 // semantic conventions. It represents the current observed total usage of the
1034 // resource across all projects.
1035 type ClusterquotaHugepageCountRequestUsed struct {
1036 metric.Int64UpDownCounter
1037 }
1038
1039 var newClusterquotaHugepageCountRequestUsedOpts = []metric.Int64UpDownCounterOption{
1040 metric.WithDescription("The current observed total usage of the resource across all projects."),
1041 metric.WithUnit("{hugepage}"),
1042 }
1043
1044 // NewClusterquotaHugepageCountRequestUsed returns a new
1045 // ClusterquotaHugepageCountRequestUsed instrument.
1046 func NewClusterquotaHugepageCountRequestUsed(
1047 m metric.Meter,
1048 opt ...metric.Int64UpDownCounterOption,
1049 ) (ClusterquotaHugepageCountRequestUsed, error) {
1050 // Check if the meter is nil.
1051 if m == nil {
1052 return ClusterquotaHugepageCountRequestUsed{noop.Int64UpDownCounter{}}, nil
1053 }
1054
1055 if len(opt) == 0 {
1056 opt = newClusterquotaHugepageCountRequestUsedOpts
1057 } else {
1058 opt = append(opt, newClusterquotaHugepageCountRequestUsedOpts...)
1059 }
1060
1061 i, err := m.Int64UpDownCounter(
1062 "openshift.clusterquota.hugepage_count.request.used",
1063 opt...,
1064 )
1065 if err != nil {
1066 return ClusterquotaHugepageCountRequestUsed{noop.Int64UpDownCounter{}}, err
1067 }
1068 return ClusterquotaHugepageCountRequestUsed{i}, nil
1069 }
1070
1071 // Inst returns the underlying metric instrument.
1072 func (m ClusterquotaHugepageCountRequestUsed) Inst() metric.Int64UpDownCounter {
1073 return m.Int64UpDownCounter
1074 }
1075
1076 // Name returns the semantic convention name of the instrument.
1077 func (ClusterquotaHugepageCountRequestUsed) Name() string {
1078 return "openshift.clusterquota.hugepage_count.request.used"
1079 }
1080
1081 // Unit returns the semantic convention unit of the instrument
1082 func (ClusterquotaHugepageCountRequestUsed) Unit() string {
1083 return "{hugepage}"
1084 }
1085
1086 // Description returns the semantic convention description of the instrument
1087 func (ClusterquotaHugepageCountRequestUsed) Description() string {
1088 return "The current observed total usage of the resource across all projects."
1089 }
1090
1091 // Add adds incr to the existing count for attrs.
1092 //
1093 // The k8sHugepageSize is the the size (identifier) of the K8s huge page.
1094 //
1095 // This metric is retrieved from the `Status.Total.Used` field of the
1096 // [K8s ResourceQuotaStatus]
1097 // of the
1098 // [ClusterResourceQuota].
1099 //
1100 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1101 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1102 func (m ClusterquotaHugepageCountRequestUsed) Add(
1103 ctx context.Context,
1104 incr int64,
1105 k8sHugepageSize string,
1106 attrs ...attribute.KeyValue,
1107 ) {
1108 if len(attrs) == 0 {
1109 m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes(
1110 attribute.String("k8s.hugepage.size", k8sHugepageSize),
1111 ))
1112 return
1113 }
1114
1115 o := addOptPool.Get().(*[]metric.AddOption)
1116 defer func() {
1117 *o = (*o)[:0]
1118 addOptPool.Put(o)
1119 }()
1120
1121 *o = append(
1122 *o,
1123 metric.WithAttributes(
1124 append(
1125 attrs[:len(attrs):len(attrs)],
1126 attribute.String("k8s.hugepage.size", k8sHugepageSize),
1127 )...,
1128 ),
1129 )
1130
1131 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1132 }
1133
1134 // AddSet adds incr to the existing count for set.
1135 //
1136 // This metric is retrieved from the `Status.Total.Used` field of the
1137 // [K8s ResourceQuotaStatus]
1138 // of the
1139 // [ClusterResourceQuota].
1140 //
1141 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1142 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1143 func (m ClusterquotaHugepageCountRequestUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1144 if set.Len() == 0 {
1145 m.Int64UpDownCounter.Add(ctx, incr)
1146 return
1147 }
1148
1149 o := addOptPool.Get().(*[]metric.AddOption)
1150 defer func() {
1151 *o = (*o)[:0]
1152 addOptPool.Put(o)
1153 }()
1154
1155 *o = append(*o, metric.WithAttributeSet(set))
1156 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1157 }
1158
1159 // ClusterquotaMemoryLimitHard is an instrument used to record metric values
1160 // conforming to the "openshift.clusterquota.memory.limit.hard" semantic
1161 // conventions. It represents the enforced hard limit of the resource across all
1162 // projects.
1163 type ClusterquotaMemoryLimitHard struct {
1164 metric.Int64UpDownCounter
1165 }
1166
1167 var newClusterquotaMemoryLimitHardOpts = []metric.Int64UpDownCounterOption{
1168 metric.WithDescription("The enforced hard limit of the resource across all projects."),
1169 metric.WithUnit("By"),
1170 }
1171
1172 // NewClusterquotaMemoryLimitHard returns a new ClusterquotaMemoryLimitHard
1173 // instrument.
1174 func NewClusterquotaMemoryLimitHard(
1175 m metric.Meter,
1176 opt ...metric.Int64UpDownCounterOption,
1177 ) (ClusterquotaMemoryLimitHard, error) {
1178 // Check if the meter is nil.
1179 if m == nil {
1180 return ClusterquotaMemoryLimitHard{noop.Int64UpDownCounter{}}, nil
1181 }
1182
1183 if len(opt) == 0 {
1184 opt = newClusterquotaMemoryLimitHardOpts
1185 } else {
1186 opt = append(opt, newClusterquotaMemoryLimitHardOpts...)
1187 }
1188
1189 i, err := m.Int64UpDownCounter(
1190 "openshift.clusterquota.memory.limit.hard",
1191 opt...,
1192 )
1193 if err != nil {
1194 return ClusterquotaMemoryLimitHard{noop.Int64UpDownCounter{}}, err
1195 }
1196 return ClusterquotaMemoryLimitHard{i}, nil
1197 }
1198
1199 // Inst returns the underlying metric instrument.
1200 func (m ClusterquotaMemoryLimitHard) Inst() metric.Int64UpDownCounter {
1201 return m.Int64UpDownCounter
1202 }
1203
1204 // Name returns the semantic convention name of the instrument.
1205 func (ClusterquotaMemoryLimitHard) Name() string {
1206 return "openshift.clusterquota.memory.limit.hard"
1207 }
1208
1209 // Unit returns the semantic convention unit of the instrument
1210 func (ClusterquotaMemoryLimitHard) Unit() string {
1211 return "By"
1212 }
1213
1214 // Description returns the semantic convention description of the instrument
1215 func (ClusterquotaMemoryLimitHard) Description() string {
1216 return "The enforced hard limit of the resource across all projects."
1217 }
1218
1219 // Add adds incr to the existing count for attrs.
1220 //
1221 // This metric is retrieved from the `Status.Total.Hard` field of the
1222 // [K8s ResourceQuotaStatus]
1223 // of the
1224 // [ClusterResourceQuota].
1225 //
1226 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1227 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1228 func (m ClusterquotaMemoryLimitHard) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
1229 if len(attrs) == 0 {
1230 m.Int64UpDownCounter.Add(ctx, incr)
1231 return
1232 }
1233
1234 o := addOptPool.Get().(*[]metric.AddOption)
1235 defer func() {
1236 *o = (*o)[:0]
1237 addOptPool.Put(o)
1238 }()
1239
1240 *o = append(*o, metric.WithAttributes(attrs...))
1241 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1242 }
1243
1244 // AddSet adds incr to the existing count for set.
1245 //
1246 // This metric is retrieved from the `Status.Total.Hard` field of the
1247 // [K8s ResourceQuotaStatus]
1248 // of the
1249 // [ClusterResourceQuota].
1250 //
1251 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1252 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1253 func (m ClusterquotaMemoryLimitHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1254 if set.Len() == 0 {
1255 m.Int64UpDownCounter.Add(ctx, incr)
1256 return
1257 }
1258
1259 o := addOptPool.Get().(*[]metric.AddOption)
1260 defer func() {
1261 *o = (*o)[:0]
1262 addOptPool.Put(o)
1263 }()
1264
1265 *o = append(*o, metric.WithAttributeSet(set))
1266 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1267 }
1268
1269 // ClusterquotaMemoryLimitUsed is an instrument used to record metric values
1270 // conforming to the "openshift.clusterquota.memory.limit.used" semantic
1271 // conventions. It represents the current observed total usage of the resource
1272 // across all projects.
1273 type ClusterquotaMemoryLimitUsed struct {
1274 metric.Int64UpDownCounter
1275 }
1276
1277 var newClusterquotaMemoryLimitUsedOpts = []metric.Int64UpDownCounterOption{
1278 metric.WithDescription("The current observed total usage of the resource across all projects."),
1279 metric.WithUnit("By"),
1280 }
1281
1282 // NewClusterquotaMemoryLimitUsed returns a new ClusterquotaMemoryLimitUsed
1283 // instrument.
1284 func NewClusterquotaMemoryLimitUsed(
1285 m metric.Meter,
1286 opt ...metric.Int64UpDownCounterOption,
1287 ) (ClusterquotaMemoryLimitUsed, error) {
1288 // Check if the meter is nil.
1289 if m == nil {
1290 return ClusterquotaMemoryLimitUsed{noop.Int64UpDownCounter{}}, nil
1291 }
1292
1293 if len(opt) == 0 {
1294 opt = newClusterquotaMemoryLimitUsedOpts
1295 } else {
1296 opt = append(opt, newClusterquotaMemoryLimitUsedOpts...)
1297 }
1298
1299 i, err := m.Int64UpDownCounter(
1300 "openshift.clusterquota.memory.limit.used",
1301 opt...,
1302 )
1303 if err != nil {
1304 return ClusterquotaMemoryLimitUsed{noop.Int64UpDownCounter{}}, err
1305 }
1306 return ClusterquotaMemoryLimitUsed{i}, nil
1307 }
1308
1309 // Inst returns the underlying metric instrument.
1310 func (m ClusterquotaMemoryLimitUsed) Inst() metric.Int64UpDownCounter {
1311 return m.Int64UpDownCounter
1312 }
1313
1314 // Name returns the semantic convention name of the instrument.
1315 func (ClusterquotaMemoryLimitUsed) Name() string {
1316 return "openshift.clusterquota.memory.limit.used"
1317 }
1318
1319 // Unit returns the semantic convention unit of the instrument
1320 func (ClusterquotaMemoryLimitUsed) Unit() string {
1321 return "By"
1322 }
1323
1324 // Description returns the semantic convention description of the instrument
1325 func (ClusterquotaMemoryLimitUsed) Description() string {
1326 return "The current observed total usage of the resource across all projects."
1327 }
1328
1329 // Add adds incr to the existing count for attrs.
1330 //
1331 // This metric is retrieved from the `Status.Total.Used` field of the
1332 // [K8s ResourceQuotaStatus]
1333 // of the
1334 // [ClusterResourceQuota].
1335 //
1336 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1337 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1338 func (m ClusterquotaMemoryLimitUsed) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
1339 if len(attrs) == 0 {
1340 m.Int64UpDownCounter.Add(ctx, incr)
1341 return
1342 }
1343
1344 o := addOptPool.Get().(*[]metric.AddOption)
1345 defer func() {
1346 *o = (*o)[:0]
1347 addOptPool.Put(o)
1348 }()
1349
1350 *o = append(*o, metric.WithAttributes(attrs...))
1351 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1352 }
1353
1354 // AddSet adds incr to the existing count for set.
1355 //
1356 // This metric is retrieved from the `Status.Total.Used` field of the
1357 // [K8s ResourceQuotaStatus]
1358 // of the
1359 // [ClusterResourceQuota].
1360 //
1361 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1362 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1363 func (m ClusterquotaMemoryLimitUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1364 if set.Len() == 0 {
1365 m.Int64UpDownCounter.Add(ctx, incr)
1366 return
1367 }
1368
1369 o := addOptPool.Get().(*[]metric.AddOption)
1370 defer func() {
1371 *o = (*o)[:0]
1372 addOptPool.Put(o)
1373 }()
1374
1375 *o = append(*o, metric.WithAttributeSet(set))
1376 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1377 }
1378
1379 // ClusterquotaMemoryRequestHard is an instrument used to record metric values
1380 // conforming to the "openshift.clusterquota.memory.request.hard" semantic
1381 // conventions. It represents the enforced hard limit of the resource across all
1382 // projects.
1383 type ClusterquotaMemoryRequestHard struct {
1384 metric.Int64UpDownCounter
1385 }
1386
1387 var newClusterquotaMemoryRequestHardOpts = []metric.Int64UpDownCounterOption{
1388 metric.WithDescription("The enforced hard limit of the resource across all projects."),
1389 metric.WithUnit("By"),
1390 }
1391
1392 // NewClusterquotaMemoryRequestHard returns a new ClusterquotaMemoryRequestHard
1393 // instrument.
1394 func NewClusterquotaMemoryRequestHard(
1395 m metric.Meter,
1396 opt ...metric.Int64UpDownCounterOption,
1397 ) (ClusterquotaMemoryRequestHard, error) {
1398 // Check if the meter is nil.
1399 if m == nil {
1400 return ClusterquotaMemoryRequestHard{noop.Int64UpDownCounter{}}, nil
1401 }
1402
1403 if len(opt) == 0 {
1404 opt = newClusterquotaMemoryRequestHardOpts
1405 } else {
1406 opt = append(opt, newClusterquotaMemoryRequestHardOpts...)
1407 }
1408
1409 i, err := m.Int64UpDownCounter(
1410 "openshift.clusterquota.memory.request.hard",
1411 opt...,
1412 )
1413 if err != nil {
1414 return ClusterquotaMemoryRequestHard{noop.Int64UpDownCounter{}}, err
1415 }
1416 return ClusterquotaMemoryRequestHard{i}, nil
1417 }
1418
1419 // Inst returns the underlying metric instrument.
1420 func (m ClusterquotaMemoryRequestHard) Inst() metric.Int64UpDownCounter {
1421 return m.Int64UpDownCounter
1422 }
1423
1424 // Name returns the semantic convention name of the instrument.
1425 func (ClusterquotaMemoryRequestHard) Name() string {
1426 return "openshift.clusterquota.memory.request.hard"
1427 }
1428
1429 // Unit returns the semantic convention unit of the instrument
1430 func (ClusterquotaMemoryRequestHard) Unit() string {
1431 return "By"
1432 }
1433
1434 // Description returns the semantic convention description of the instrument
1435 func (ClusterquotaMemoryRequestHard) Description() string {
1436 return "The enforced hard limit of the resource across all projects."
1437 }
1438
1439 // Add adds incr to the existing count for attrs.
1440 //
1441 // This metric is retrieved from the `Status.Total.Hard` field of the
1442 // [K8s ResourceQuotaStatus]
1443 // of the
1444 // [ClusterResourceQuota].
1445 //
1446 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1447 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1448 func (m ClusterquotaMemoryRequestHard) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
1449 if len(attrs) == 0 {
1450 m.Int64UpDownCounter.Add(ctx, incr)
1451 return
1452 }
1453
1454 o := addOptPool.Get().(*[]metric.AddOption)
1455 defer func() {
1456 *o = (*o)[:0]
1457 addOptPool.Put(o)
1458 }()
1459
1460 *o = append(*o, metric.WithAttributes(attrs...))
1461 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1462 }
1463
1464 // AddSet adds incr to the existing count for set.
1465 //
1466 // This metric is retrieved from the `Status.Total.Hard` field of the
1467 // [K8s ResourceQuotaStatus]
1468 // of the
1469 // [ClusterResourceQuota].
1470 //
1471 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1472 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1473 func (m ClusterquotaMemoryRequestHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1474 if set.Len() == 0 {
1475 m.Int64UpDownCounter.Add(ctx, incr)
1476 return
1477 }
1478
1479 o := addOptPool.Get().(*[]metric.AddOption)
1480 defer func() {
1481 *o = (*o)[:0]
1482 addOptPool.Put(o)
1483 }()
1484
1485 *o = append(*o, metric.WithAttributeSet(set))
1486 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1487 }
1488
1489 // ClusterquotaMemoryRequestUsed is an instrument used to record metric values
1490 // conforming to the "openshift.clusterquota.memory.request.used" semantic
1491 // conventions. It represents the current observed total usage of the resource
1492 // across all projects.
1493 type ClusterquotaMemoryRequestUsed struct {
1494 metric.Int64UpDownCounter
1495 }
1496
1497 var newClusterquotaMemoryRequestUsedOpts = []metric.Int64UpDownCounterOption{
1498 metric.WithDescription("The current observed total usage of the resource across all projects."),
1499 metric.WithUnit("By"),
1500 }
1501
1502 // NewClusterquotaMemoryRequestUsed returns a new ClusterquotaMemoryRequestUsed
1503 // instrument.
1504 func NewClusterquotaMemoryRequestUsed(
1505 m metric.Meter,
1506 opt ...metric.Int64UpDownCounterOption,
1507 ) (ClusterquotaMemoryRequestUsed, error) {
1508 // Check if the meter is nil.
1509 if m == nil {
1510 return ClusterquotaMemoryRequestUsed{noop.Int64UpDownCounter{}}, nil
1511 }
1512
1513 if len(opt) == 0 {
1514 opt = newClusterquotaMemoryRequestUsedOpts
1515 } else {
1516 opt = append(opt, newClusterquotaMemoryRequestUsedOpts...)
1517 }
1518
1519 i, err := m.Int64UpDownCounter(
1520 "openshift.clusterquota.memory.request.used",
1521 opt...,
1522 )
1523 if err != nil {
1524 return ClusterquotaMemoryRequestUsed{noop.Int64UpDownCounter{}}, err
1525 }
1526 return ClusterquotaMemoryRequestUsed{i}, nil
1527 }
1528
1529 // Inst returns the underlying metric instrument.
1530 func (m ClusterquotaMemoryRequestUsed) Inst() metric.Int64UpDownCounter {
1531 return m.Int64UpDownCounter
1532 }
1533
1534 // Name returns the semantic convention name of the instrument.
1535 func (ClusterquotaMemoryRequestUsed) Name() string {
1536 return "openshift.clusterquota.memory.request.used"
1537 }
1538
1539 // Unit returns the semantic convention unit of the instrument
1540 func (ClusterquotaMemoryRequestUsed) Unit() string {
1541 return "By"
1542 }
1543
1544 // Description returns the semantic convention description of the instrument
1545 func (ClusterquotaMemoryRequestUsed) Description() string {
1546 return "The current observed total usage of the resource across all projects."
1547 }
1548
1549 // Add adds incr to the existing count for attrs.
1550 //
1551 // This metric is retrieved from the `Status.Total.Used` field of the
1552 // [K8s ResourceQuotaStatus]
1553 // of the
1554 // [ClusterResourceQuota].
1555 //
1556 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1557 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1558 func (m ClusterquotaMemoryRequestUsed) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
1559 if len(attrs) == 0 {
1560 m.Int64UpDownCounter.Add(ctx, incr)
1561 return
1562 }
1563
1564 o := addOptPool.Get().(*[]metric.AddOption)
1565 defer func() {
1566 *o = (*o)[:0]
1567 addOptPool.Put(o)
1568 }()
1569
1570 *o = append(*o, metric.WithAttributes(attrs...))
1571 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1572 }
1573
1574 // AddSet adds incr to the existing count for set.
1575 //
1576 // This metric is retrieved from the `Status.Total.Used` field of the
1577 // [K8s ResourceQuotaStatus]
1578 // of the
1579 // [ClusterResourceQuota].
1580 //
1581 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1582 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1583 func (m ClusterquotaMemoryRequestUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1584 if set.Len() == 0 {
1585 m.Int64UpDownCounter.Add(ctx, incr)
1586 return
1587 }
1588
1589 o := addOptPool.Get().(*[]metric.AddOption)
1590 defer func() {
1591 *o = (*o)[:0]
1592 addOptPool.Put(o)
1593 }()
1594
1595 *o = append(*o, metric.WithAttributeSet(set))
1596 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1597 }
1598
1599 // ClusterquotaObjectCountHard is an instrument used to record metric values
1600 // conforming to the "openshift.clusterquota.object_count.hard" semantic
1601 // conventions. It represents the enforced hard limit of the resource across all
1602 // projects.
1603 type ClusterquotaObjectCountHard struct {
1604 metric.Int64UpDownCounter
1605 }
1606
1607 var newClusterquotaObjectCountHardOpts = []metric.Int64UpDownCounterOption{
1608 metric.WithDescription("The enforced hard limit of the resource across all projects."),
1609 metric.WithUnit("{object}"),
1610 }
1611
1612 // NewClusterquotaObjectCountHard returns a new ClusterquotaObjectCountHard
1613 // instrument.
1614 func NewClusterquotaObjectCountHard(
1615 m metric.Meter,
1616 opt ...metric.Int64UpDownCounterOption,
1617 ) (ClusterquotaObjectCountHard, error) {
1618 // Check if the meter is nil.
1619 if m == nil {
1620 return ClusterquotaObjectCountHard{noop.Int64UpDownCounter{}}, nil
1621 }
1622
1623 if len(opt) == 0 {
1624 opt = newClusterquotaObjectCountHardOpts
1625 } else {
1626 opt = append(opt, newClusterquotaObjectCountHardOpts...)
1627 }
1628
1629 i, err := m.Int64UpDownCounter(
1630 "openshift.clusterquota.object_count.hard",
1631 opt...,
1632 )
1633 if err != nil {
1634 return ClusterquotaObjectCountHard{noop.Int64UpDownCounter{}}, err
1635 }
1636 return ClusterquotaObjectCountHard{i}, nil
1637 }
1638
1639 // Inst returns the underlying metric instrument.
1640 func (m ClusterquotaObjectCountHard) Inst() metric.Int64UpDownCounter {
1641 return m.Int64UpDownCounter
1642 }
1643
1644 // Name returns the semantic convention name of the instrument.
1645 func (ClusterquotaObjectCountHard) Name() string {
1646 return "openshift.clusterquota.object_count.hard"
1647 }
1648
1649 // Unit returns the semantic convention unit of the instrument
1650 func (ClusterquotaObjectCountHard) Unit() string {
1651 return "{object}"
1652 }
1653
1654 // Description returns the semantic convention description of the instrument
1655 func (ClusterquotaObjectCountHard) Description() string {
1656 return "The enforced hard limit of the resource across all projects."
1657 }
1658
1659 // Add adds incr to the existing count for attrs.
1660 //
1661 // The k8sResourcequotaResourceName is the the name of the K8s resource a
1662 // resource quota defines.
1663 //
1664 // This metric is retrieved from the `Status.Total.Hard` field of the
1665 // [K8s ResourceQuotaStatus]
1666 // of the
1667 // [ClusterResourceQuota].
1668 //
1669 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1670 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1671 func (m ClusterquotaObjectCountHard) Add(
1672 ctx context.Context,
1673 incr int64,
1674 k8sResourcequotaResourceName string,
1675 attrs ...attribute.KeyValue,
1676 ) {
1677 if len(attrs) == 0 {
1678 m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes(
1679 attribute.String("k8s.resourcequota.resource_name", k8sResourcequotaResourceName),
1680 ))
1681 return
1682 }
1683
1684 o := addOptPool.Get().(*[]metric.AddOption)
1685 defer func() {
1686 *o = (*o)[:0]
1687 addOptPool.Put(o)
1688 }()
1689
1690 *o = append(
1691 *o,
1692 metric.WithAttributes(
1693 append(
1694 attrs[:len(attrs):len(attrs)],
1695 attribute.String("k8s.resourcequota.resource_name", k8sResourcequotaResourceName),
1696 )...,
1697 ),
1698 )
1699
1700 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1701 }
1702
1703 // AddSet adds incr to the existing count for set.
1704 //
1705 // This metric is retrieved from the `Status.Total.Hard` field of the
1706 // [K8s ResourceQuotaStatus]
1707 // of the
1708 // [ClusterResourceQuota].
1709 //
1710 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1711 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1712 func (m ClusterquotaObjectCountHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1713 if set.Len() == 0 {
1714 m.Int64UpDownCounter.Add(ctx, incr)
1715 return
1716 }
1717
1718 o := addOptPool.Get().(*[]metric.AddOption)
1719 defer func() {
1720 *o = (*o)[:0]
1721 addOptPool.Put(o)
1722 }()
1723
1724 *o = append(*o, metric.WithAttributeSet(set))
1725 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1726 }
1727
1728 // ClusterquotaObjectCountUsed is an instrument used to record metric values
1729 // conforming to the "openshift.clusterquota.object_count.used" semantic
1730 // conventions. It represents the current observed total usage of the resource
1731 // across all projects.
1732 type ClusterquotaObjectCountUsed struct {
1733 metric.Int64UpDownCounter
1734 }
1735
1736 var newClusterquotaObjectCountUsedOpts = []metric.Int64UpDownCounterOption{
1737 metric.WithDescription("The current observed total usage of the resource across all projects."),
1738 metric.WithUnit("{object}"),
1739 }
1740
1741 // NewClusterquotaObjectCountUsed returns a new ClusterquotaObjectCountUsed
1742 // instrument.
1743 func NewClusterquotaObjectCountUsed(
1744 m metric.Meter,
1745 opt ...metric.Int64UpDownCounterOption,
1746 ) (ClusterquotaObjectCountUsed, error) {
1747 // Check if the meter is nil.
1748 if m == nil {
1749 return ClusterquotaObjectCountUsed{noop.Int64UpDownCounter{}}, nil
1750 }
1751
1752 if len(opt) == 0 {
1753 opt = newClusterquotaObjectCountUsedOpts
1754 } else {
1755 opt = append(opt, newClusterquotaObjectCountUsedOpts...)
1756 }
1757
1758 i, err := m.Int64UpDownCounter(
1759 "openshift.clusterquota.object_count.used",
1760 opt...,
1761 )
1762 if err != nil {
1763 return ClusterquotaObjectCountUsed{noop.Int64UpDownCounter{}}, err
1764 }
1765 return ClusterquotaObjectCountUsed{i}, nil
1766 }
1767
1768 // Inst returns the underlying metric instrument.
1769 func (m ClusterquotaObjectCountUsed) Inst() metric.Int64UpDownCounter {
1770 return m.Int64UpDownCounter
1771 }
1772
1773 // Name returns the semantic convention name of the instrument.
1774 func (ClusterquotaObjectCountUsed) Name() string {
1775 return "openshift.clusterquota.object_count.used"
1776 }
1777
1778 // Unit returns the semantic convention unit of the instrument
1779 func (ClusterquotaObjectCountUsed) Unit() string {
1780 return "{object}"
1781 }
1782
1783 // Description returns the semantic convention description of the instrument
1784 func (ClusterquotaObjectCountUsed) Description() string {
1785 return "The current observed total usage of the resource across all projects."
1786 }
1787
1788 // Add adds incr to the existing count for attrs.
1789 //
1790 // The k8sResourcequotaResourceName is the the name of the K8s resource a
1791 // resource quota defines.
1792 //
1793 // This metric is retrieved from the `Status.Total.Used` field of the
1794 // [K8s ResourceQuotaStatus]
1795 // of the
1796 // [ClusterResourceQuota].
1797 //
1798 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1799 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1800 func (m ClusterquotaObjectCountUsed) Add(
1801 ctx context.Context,
1802 incr int64,
1803 k8sResourcequotaResourceName string,
1804 attrs ...attribute.KeyValue,
1805 ) {
1806 if len(attrs) == 0 {
1807 m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes(
1808 attribute.String("k8s.resourcequota.resource_name", k8sResourcequotaResourceName),
1809 ))
1810 return
1811 }
1812
1813 o := addOptPool.Get().(*[]metric.AddOption)
1814 defer func() {
1815 *o = (*o)[:0]
1816 addOptPool.Put(o)
1817 }()
1818
1819 *o = append(
1820 *o,
1821 metric.WithAttributes(
1822 append(
1823 attrs[:len(attrs):len(attrs)],
1824 attribute.String("k8s.resourcequota.resource_name", k8sResourcequotaResourceName),
1825 )...,
1826 ),
1827 )
1828
1829 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1830 }
1831
1832 // AddSet adds incr to the existing count for set.
1833 //
1834 // This metric is retrieved from the `Status.Total.Used` field of the
1835 // [K8s ResourceQuotaStatus]
1836 // of the
1837 // [ClusterResourceQuota].
1838 //
1839 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1840 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1841 func (m ClusterquotaObjectCountUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1842 if set.Len() == 0 {
1843 m.Int64UpDownCounter.Add(ctx, incr)
1844 return
1845 }
1846
1847 o := addOptPool.Get().(*[]metric.AddOption)
1848 defer func() {
1849 *o = (*o)[:0]
1850 addOptPool.Put(o)
1851 }()
1852
1853 *o = append(*o, metric.WithAttributeSet(set))
1854 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1855 }
1856
1857 // ClusterquotaPersistentvolumeclaimCountHard is an instrument used to record
1858 // metric values conforming to the
1859 // "openshift.clusterquota.persistentvolumeclaim_count.hard" semantic
1860 // conventions. It represents the enforced hard limit of the resource across all
1861 // projects.
1862 type ClusterquotaPersistentvolumeclaimCountHard struct {
1863 metric.Int64UpDownCounter
1864 }
1865
1866 var newClusterquotaPersistentvolumeclaimCountHardOpts = []metric.Int64UpDownCounterOption{
1867 metric.WithDescription("The enforced hard limit of the resource across all projects."),
1868 metric.WithUnit("{persistentvolumeclaim}"),
1869 }
1870
1871 // NewClusterquotaPersistentvolumeclaimCountHard returns a new
1872 // ClusterquotaPersistentvolumeclaimCountHard instrument.
1873 func NewClusterquotaPersistentvolumeclaimCountHard(
1874 m metric.Meter,
1875 opt ...metric.Int64UpDownCounterOption,
1876 ) (ClusterquotaPersistentvolumeclaimCountHard, error) {
1877 // Check if the meter is nil.
1878 if m == nil {
1879 return ClusterquotaPersistentvolumeclaimCountHard{noop.Int64UpDownCounter{}}, nil
1880 }
1881
1882 if len(opt) == 0 {
1883 opt = newClusterquotaPersistentvolumeclaimCountHardOpts
1884 } else {
1885 opt = append(opt, newClusterquotaPersistentvolumeclaimCountHardOpts...)
1886 }
1887
1888 i, err := m.Int64UpDownCounter(
1889 "openshift.clusterquota.persistentvolumeclaim_count.hard",
1890 opt...,
1891 )
1892 if err != nil {
1893 return ClusterquotaPersistentvolumeclaimCountHard{noop.Int64UpDownCounter{}}, err
1894 }
1895 return ClusterquotaPersistentvolumeclaimCountHard{i}, nil
1896 }
1897
1898 // Inst returns the underlying metric instrument.
1899 func (m ClusterquotaPersistentvolumeclaimCountHard) Inst() metric.Int64UpDownCounter {
1900 return m.Int64UpDownCounter
1901 }
1902
1903 // Name returns the semantic convention name of the instrument.
1904 func (ClusterquotaPersistentvolumeclaimCountHard) Name() string {
1905 return "openshift.clusterquota.persistentvolumeclaim_count.hard"
1906 }
1907
1908 // Unit returns the semantic convention unit of the instrument
1909 func (ClusterquotaPersistentvolumeclaimCountHard) Unit() string {
1910 return "{persistentvolumeclaim}"
1911 }
1912
1913 // Description returns the semantic convention description of the instrument
1914 func (ClusterquotaPersistentvolumeclaimCountHard) Description() string {
1915 return "The enforced hard limit of the resource across all projects."
1916 }
1917
1918 // Add adds incr to the existing count for attrs.
1919 //
1920 // All additional attrs passed are included in the recorded value.
1921 //
1922 // This metric is retrieved from the `Status.Total.Hard` field of the
1923 // [K8s ResourceQuotaStatus]
1924 // of the
1925 // [ClusterResourceQuota].
1926 //
1927 // The `k8s.storageclass.name` should be required when a resource quota is
1928 // defined for a specific
1929 // storage class.
1930 //
1931 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1932 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1933 func (m ClusterquotaPersistentvolumeclaimCountHard) Add(
1934 ctx context.Context,
1935 incr int64,
1936 attrs ...attribute.KeyValue,
1937 ) {
1938 if len(attrs) == 0 {
1939 m.Int64UpDownCounter.Add(ctx, incr)
1940 return
1941 }
1942
1943 o := addOptPool.Get().(*[]metric.AddOption)
1944 defer func() {
1945 *o = (*o)[:0]
1946 addOptPool.Put(o)
1947 }()
1948
1949 *o = append(
1950 *o,
1951 metric.WithAttributes(
1952 attrs...,
1953 ),
1954 )
1955
1956 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1957 }
1958
1959 // AddSet adds incr to the existing count for set.
1960 //
1961 // This metric is retrieved from the `Status.Total.Hard` field of the
1962 // [K8s ResourceQuotaStatus]
1963 // of the
1964 // [ClusterResourceQuota].
1965 //
1966 // The `k8s.storageclass.name` should be required when a resource quota is
1967 // defined for a specific
1968 // storage class.
1969 //
1970 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1971 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1972 func (m ClusterquotaPersistentvolumeclaimCountHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1973 if set.Len() == 0 {
1974 m.Int64UpDownCounter.Add(ctx, incr)
1975 return
1976 }
1977
1978 o := addOptPool.Get().(*[]metric.AddOption)
1979 defer func() {
1980 *o = (*o)[:0]
1981 addOptPool.Put(o)
1982 }()
1983
1984 *o = append(*o, metric.WithAttributeSet(set))
1985 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1986 }
1987
1988 // AttrK8SStorageclassName returns an optional attribute for the
1989 // "k8s.storageclass.name" semantic convention. It represents the name of K8s
1990 // [StorageClass] object.
1991 //
1992 // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io
1993 func (ClusterquotaPersistentvolumeclaimCountHard) AttrK8SStorageclassName(val string) attribute.KeyValue {
1994 return attribute.String("k8s.storageclass.name", val)
1995 }
1996
1997 // ClusterquotaPersistentvolumeclaimCountUsed is an instrument used to record
1998 // metric values conforming to the
1999 // "openshift.clusterquota.persistentvolumeclaim_count.used" semantic
2000 // conventions. It represents the current observed total usage of the resource
2001 // across all projects.
2002 type ClusterquotaPersistentvolumeclaimCountUsed struct {
2003 metric.Int64UpDownCounter
2004 }
2005
2006 var newClusterquotaPersistentvolumeclaimCountUsedOpts = []metric.Int64UpDownCounterOption{
2007 metric.WithDescription("The current observed total usage of the resource across all projects."),
2008 metric.WithUnit("{persistentvolumeclaim}"),
2009 }
2010
2011 // NewClusterquotaPersistentvolumeclaimCountUsed returns a new
2012 // ClusterquotaPersistentvolumeclaimCountUsed instrument.
2013 func NewClusterquotaPersistentvolumeclaimCountUsed(
2014 m metric.Meter,
2015 opt ...metric.Int64UpDownCounterOption,
2016 ) (ClusterquotaPersistentvolumeclaimCountUsed, error) {
2017 // Check if the meter is nil.
2018 if m == nil {
2019 return ClusterquotaPersistentvolumeclaimCountUsed{noop.Int64UpDownCounter{}}, nil
2020 }
2021
2022 if len(opt) == 0 {
2023 opt = newClusterquotaPersistentvolumeclaimCountUsedOpts
2024 } else {
2025 opt = append(opt, newClusterquotaPersistentvolumeclaimCountUsedOpts...)
2026 }
2027
2028 i, err := m.Int64UpDownCounter(
2029 "openshift.clusterquota.persistentvolumeclaim_count.used",
2030 opt...,
2031 )
2032 if err != nil {
2033 return ClusterquotaPersistentvolumeclaimCountUsed{noop.Int64UpDownCounter{}}, err
2034 }
2035 return ClusterquotaPersistentvolumeclaimCountUsed{i}, nil
2036 }
2037
2038 // Inst returns the underlying metric instrument.
2039 func (m ClusterquotaPersistentvolumeclaimCountUsed) Inst() metric.Int64UpDownCounter {
2040 return m.Int64UpDownCounter
2041 }
2042
2043 // Name returns the semantic convention name of the instrument.
2044 func (ClusterquotaPersistentvolumeclaimCountUsed) Name() string {
2045 return "openshift.clusterquota.persistentvolumeclaim_count.used"
2046 }
2047
2048 // Unit returns the semantic convention unit of the instrument
2049 func (ClusterquotaPersistentvolumeclaimCountUsed) Unit() string {
2050 return "{persistentvolumeclaim}"
2051 }
2052
2053 // Description returns the semantic convention description of the instrument
2054 func (ClusterquotaPersistentvolumeclaimCountUsed) Description() string {
2055 return "The current observed total usage of the resource across all projects."
2056 }
2057
2058 // Add adds incr to the existing count for attrs.
2059 //
2060 // All additional attrs passed are included in the recorded value.
2061 //
2062 // This metric is retrieved from the `Status.Total.Used` field of the
2063 // [K8s ResourceQuotaStatus]
2064 // of the
2065 // [ClusterResourceQuota].
2066 //
2067 // The `k8s.storageclass.name` should be required when a resource quota is
2068 // defined for a specific
2069 // storage class.
2070 //
2071 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
2072 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
2073 func (m ClusterquotaPersistentvolumeclaimCountUsed) Add(
2074 ctx context.Context,
2075 incr int64,
2076 attrs ...attribute.KeyValue,
2077 ) {
2078 if len(attrs) == 0 {
2079 m.Int64UpDownCounter.Add(ctx, incr)
2080 return
2081 }
2082
2083 o := addOptPool.Get().(*[]metric.AddOption)
2084 defer func() {
2085 *o = (*o)[:0]
2086 addOptPool.Put(o)
2087 }()
2088
2089 *o = append(
2090 *o,
2091 metric.WithAttributes(
2092 attrs...,
2093 ),
2094 )
2095
2096 m.Int64UpDownCounter.Add(ctx, incr, *o...)
2097 }
2098
2099 // AddSet adds incr to the existing count for set.
2100 //
2101 // This metric is retrieved from the `Status.Total.Used` field of the
2102 // [K8s ResourceQuotaStatus]
2103 // of the
2104 // [ClusterResourceQuota].
2105 //
2106 // The `k8s.storageclass.name` should be required when a resource quota is
2107 // defined for a specific
2108 // storage class.
2109 //
2110 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
2111 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
2112 func (m ClusterquotaPersistentvolumeclaimCountUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
2113 if set.Len() == 0 {
2114 m.Int64UpDownCounter.Add(ctx, incr)
2115 return
2116 }
2117
2118 o := addOptPool.Get().(*[]metric.AddOption)
2119 defer func() {
2120 *o = (*o)[:0]
2121 addOptPool.Put(o)
2122 }()
2123
2124 *o = append(*o, metric.WithAttributeSet(set))
2125 m.Int64UpDownCounter.Add(ctx, incr, *o...)
2126 }
2127
2128 // AttrK8SStorageclassName returns an optional attribute for the
2129 // "k8s.storageclass.name" semantic convention. It represents the name of K8s
2130 // [StorageClass] object.
2131 //
2132 // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io
2133 func (ClusterquotaPersistentvolumeclaimCountUsed) AttrK8SStorageclassName(val string) attribute.KeyValue {
2134 return attribute.String("k8s.storageclass.name", val)
2135 }
2136
2137 // ClusterquotaStorageRequestHard is an instrument used to record metric values
2138 // conforming to the "openshift.clusterquota.storage.request.hard" semantic
2139 // conventions. It represents the enforced hard limit of the resource across all
2140 // projects.
2141 type ClusterquotaStorageRequestHard struct {
2142 metric.Int64UpDownCounter
2143 }
2144
2145 var newClusterquotaStorageRequestHardOpts = []metric.Int64UpDownCounterOption{
2146 metric.WithDescription("The enforced hard limit of the resource across all projects."),
2147 metric.WithUnit("By"),
2148 }
2149
2150 // NewClusterquotaStorageRequestHard returns a new ClusterquotaStorageRequestHard
2151 // instrument.
2152 func NewClusterquotaStorageRequestHard(
2153 m metric.Meter,
2154 opt ...metric.Int64UpDownCounterOption,
2155 ) (ClusterquotaStorageRequestHard, error) {
2156 // Check if the meter is nil.
2157 if m == nil {
2158 return ClusterquotaStorageRequestHard{noop.Int64UpDownCounter{}}, nil
2159 }
2160
2161 if len(opt) == 0 {
2162 opt = newClusterquotaStorageRequestHardOpts
2163 } else {
2164 opt = append(opt, newClusterquotaStorageRequestHardOpts...)
2165 }
2166
2167 i, err := m.Int64UpDownCounter(
2168 "openshift.clusterquota.storage.request.hard",
2169 opt...,
2170 )
2171 if err != nil {
2172 return ClusterquotaStorageRequestHard{noop.Int64UpDownCounter{}}, err
2173 }
2174 return ClusterquotaStorageRequestHard{i}, nil
2175 }
2176
2177 // Inst returns the underlying metric instrument.
2178 func (m ClusterquotaStorageRequestHard) Inst() metric.Int64UpDownCounter {
2179 return m.Int64UpDownCounter
2180 }
2181
2182 // Name returns the semantic convention name of the instrument.
2183 func (ClusterquotaStorageRequestHard) Name() string {
2184 return "openshift.clusterquota.storage.request.hard"
2185 }
2186
2187 // Unit returns the semantic convention unit of the instrument
2188 func (ClusterquotaStorageRequestHard) Unit() string {
2189 return "By"
2190 }
2191
2192 // Description returns the semantic convention description of the instrument
2193 func (ClusterquotaStorageRequestHard) Description() string {
2194 return "The enforced hard limit of the resource across all projects."
2195 }
2196
2197 // Add adds incr to the existing count for attrs.
2198 //
2199 // All additional attrs passed are included in the recorded value.
2200 //
2201 // This metric is retrieved from the `Status.Total.Hard` field of the
2202 // [K8s ResourceQuotaStatus]
2203 // of the
2204 // [ClusterResourceQuota].
2205 //
2206 // The `k8s.storageclass.name` should be required when a resource quota is
2207 // defined for a specific
2208 // storage class.
2209 //
2210 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
2211 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
2212 func (m ClusterquotaStorageRequestHard) Add(
2213 ctx context.Context,
2214 incr int64,
2215 attrs ...attribute.KeyValue,
2216 ) {
2217 if len(attrs) == 0 {
2218 m.Int64UpDownCounter.Add(ctx, incr)
2219 return
2220 }
2221
2222 o := addOptPool.Get().(*[]metric.AddOption)
2223 defer func() {
2224 *o = (*o)[:0]
2225 addOptPool.Put(o)
2226 }()
2227
2228 *o = append(
2229 *o,
2230 metric.WithAttributes(
2231 attrs...,
2232 ),
2233 )
2234
2235 m.Int64UpDownCounter.Add(ctx, incr, *o...)
2236 }
2237
2238 // AddSet adds incr to the existing count for set.
2239 //
2240 // This metric is retrieved from the `Status.Total.Hard` field of the
2241 // [K8s ResourceQuotaStatus]
2242 // of the
2243 // [ClusterResourceQuota].
2244 //
2245 // The `k8s.storageclass.name` should be required when a resource quota is
2246 // defined for a specific
2247 // storage class.
2248 //
2249 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
2250 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
2251 func (m ClusterquotaStorageRequestHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
2252 if set.Len() == 0 {
2253 m.Int64UpDownCounter.Add(ctx, incr)
2254 return
2255 }
2256
2257 o := addOptPool.Get().(*[]metric.AddOption)
2258 defer func() {
2259 *o = (*o)[:0]
2260 addOptPool.Put(o)
2261 }()
2262
2263 *o = append(*o, metric.WithAttributeSet(set))
2264 m.Int64UpDownCounter.Add(ctx, incr, *o...)
2265 }
2266
2267 // AttrK8SStorageclassName returns an optional attribute for the
2268 // "k8s.storageclass.name" semantic convention. It represents the name of K8s
2269 // [StorageClass] object.
2270 //
2271 // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io
2272 func (ClusterquotaStorageRequestHard) AttrK8SStorageclassName(val string) attribute.KeyValue {
2273 return attribute.String("k8s.storageclass.name", val)
2274 }
2275
2276 // ClusterquotaStorageRequestUsed is an instrument used to record metric values
2277 // conforming to the "openshift.clusterquota.storage.request.used" semantic
2278 // conventions. It represents the current observed total usage of the resource
2279 // across all projects.
2280 type ClusterquotaStorageRequestUsed struct {
2281 metric.Int64UpDownCounter
2282 }
2283
2284 var newClusterquotaStorageRequestUsedOpts = []metric.Int64UpDownCounterOption{
2285 metric.WithDescription("The current observed total usage of the resource across all projects."),
2286 metric.WithUnit("By"),
2287 }
2288
2289 // NewClusterquotaStorageRequestUsed returns a new ClusterquotaStorageRequestUsed
2290 // instrument.
2291 func NewClusterquotaStorageRequestUsed(
2292 m metric.Meter,
2293 opt ...metric.Int64UpDownCounterOption,
2294 ) (ClusterquotaStorageRequestUsed, error) {
2295 // Check if the meter is nil.
2296 if m == nil {
2297 return ClusterquotaStorageRequestUsed{noop.Int64UpDownCounter{}}, nil
2298 }
2299
2300 if len(opt) == 0 {
2301 opt = newClusterquotaStorageRequestUsedOpts
2302 } else {
2303 opt = append(opt, newClusterquotaStorageRequestUsedOpts...)
2304 }
2305
2306 i, err := m.Int64UpDownCounter(
2307 "openshift.clusterquota.storage.request.used",
2308 opt...,
2309 )
2310 if err != nil {
2311 return ClusterquotaStorageRequestUsed{noop.Int64UpDownCounter{}}, err
2312 }
2313 return ClusterquotaStorageRequestUsed{i}, nil
2314 }
2315
2316 // Inst returns the underlying metric instrument.
2317 func (m ClusterquotaStorageRequestUsed) Inst() metric.Int64UpDownCounter {
2318 return m.Int64UpDownCounter
2319 }
2320
2321 // Name returns the semantic convention name of the instrument.
2322 func (ClusterquotaStorageRequestUsed) Name() string {
2323 return "openshift.clusterquota.storage.request.used"
2324 }
2325
2326 // Unit returns the semantic convention unit of the instrument
2327 func (ClusterquotaStorageRequestUsed) Unit() string {
2328 return "By"
2329 }
2330
2331 // Description returns the semantic convention description of the instrument
2332 func (ClusterquotaStorageRequestUsed) Description() string {
2333 return "The current observed total usage of the resource across all projects."
2334 }
2335
2336 // Add adds incr to the existing count for attrs.
2337 //
2338 // All additional attrs passed are included in the recorded value.
2339 //
2340 // This metric is retrieved from the `Status.Total.Used` field of the
2341 // [K8s ResourceQuotaStatus]
2342 // of the
2343 // [ClusterResourceQuota].
2344 //
2345 // The `k8s.storageclass.name` should be required when a resource quota is
2346 // defined for a specific
2347 // storage class.
2348 //
2349 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
2350 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
2351 func (m ClusterquotaStorageRequestUsed) Add(
2352 ctx context.Context,
2353 incr int64,
2354 attrs ...attribute.KeyValue,
2355 ) {
2356 if len(attrs) == 0 {
2357 m.Int64UpDownCounter.Add(ctx, incr)
2358 return
2359 }
2360
2361 o := addOptPool.Get().(*[]metric.AddOption)
2362 defer func() {
2363 *o = (*o)[:0]
2364 addOptPool.Put(o)
2365 }()
2366
2367 *o = append(
2368 *o,
2369 metric.WithAttributes(
2370 attrs...,
2371 ),
2372 )
2373
2374 m.Int64UpDownCounter.Add(ctx, incr, *o...)
2375 }
2376
2377 // AddSet adds incr to the existing count for set.
2378 //
2379 // This metric is retrieved from the `Status.Total.Used` field of the
2380 // [K8s ResourceQuotaStatus]
2381 // of the
2382 // [ClusterResourceQuota].
2383 //
2384 // The `k8s.storageclass.name` should be required when a resource quota is
2385 // defined for a specific
2386 // storage class.
2387 //
2388 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
2389 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
2390 func (m ClusterquotaStorageRequestUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
2391 if set.Len() == 0 {
2392 m.Int64UpDownCounter.Add(ctx, incr)
2393 return
2394 }
2395
2396 o := addOptPool.Get().(*[]metric.AddOption)
2397 defer func() {
2398 *o = (*o)[:0]
2399 addOptPool.Put(o)
2400 }()
2401
2402 *o = append(*o, metric.WithAttributeSet(set))
2403 m.Int64UpDownCounter.Add(ctx, incr, *o...)
2404 }
2405
2406 // AttrK8SStorageclassName returns an optional attribute for the
2407 // "k8s.storageclass.name" semantic convention. It represents the name of K8s
2408 // [StorageClass] object.
2409 //
2410 // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io
2411 func (ClusterquotaStorageRequestUsed) AttrK8SStorageclassName(val string) attribute.KeyValue {
2412 return attribute.String("k8s.storageclass.name", val)
2413 }