Debian Codegraph @

semconv/v1.38.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)
982 return
983 }
984
985 o := addOptPool.Get().(*[]metric.AddOption)
986 defer func() {
987 *o = (*o)[:0]
988 addOptPool.Put(o)
989 }()
990
991 *o = append(
992 *o,
993 metric.WithAttributes(
994 append(
995 attrs,
996 attribute.String("k8s.hugepage.size", k8sHugepageSize),
997 )...,
998 ),
999 )
1000
1001 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1002 }
1003
1004 // AddSet adds incr to the existing count for set.
1005 //
1006 // This metric is retrieved from the `Status.Total.Hard` field of the
1007 // [K8s ResourceQuotaStatus]
1008 // of the
1009 // [ClusterResourceQuota].
1010 //
1011 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1012 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1013 func (m ClusterquotaHugepageCountRequestHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1014 if set.Len() == 0 {
1015 m.Int64UpDownCounter.Add(ctx, incr)
1016 return
1017 }
1018
1019 o := addOptPool.Get().(*[]metric.AddOption)
1020 defer func() {
1021 *o = (*o)[:0]
1022 addOptPool.Put(o)
1023 }()
1024
1025 *o = append(*o, metric.WithAttributeSet(set))
1026 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1027 }
1028
1029 // ClusterquotaHugepageCountRequestUsed is an instrument used to record metric
1030 // values conforming to the "openshift.clusterquota.hugepage_count.request.used"
1031 // semantic conventions. It represents the current observed total usage of the
1032 // resource across all projects.
1033 type ClusterquotaHugepageCountRequestUsed struct {
1034 metric.Int64UpDownCounter
1035 }
1036
1037 var newClusterquotaHugepageCountRequestUsedOpts = []metric.Int64UpDownCounterOption{
1038 metric.WithDescription("The current observed total usage of the resource across all projects."),
1039 metric.WithUnit("{hugepage}"),
1040 }
1041
1042 // NewClusterquotaHugepageCountRequestUsed returns a new
1043 // ClusterquotaHugepageCountRequestUsed instrument.
1044 func NewClusterquotaHugepageCountRequestUsed(
1045 m metric.Meter,
1046 opt ...metric.Int64UpDownCounterOption,
1047 ) (ClusterquotaHugepageCountRequestUsed, error) {
1048 // Check if the meter is nil.
1049 if m == nil {
1050 return ClusterquotaHugepageCountRequestUsed{noop.Int64UpDownCounter{}}, nil
1051 }
1052
1053 if len(opt) == 0 {
1054 opt = newClusterquotaHugepageCountRequestUsedOpts
1055 } else {
1056 opt = append(opt, newClusterquotaHugepageCountRequestUsedOpts...)
1057 }
1058
1059 i, err := m.Int64UpDownCounter(
1060 "openshift.clusterquota.hugepage_count.request.used",
1061 opt...,
1062 )
1063 if err != nil {
1064 return ClusterquotaHugepageCountRequestUsed{noop.Int64UpDownCounter{}}, err
1065 }
1066 return ClusterquotaHugepageCountRequestUsed{i}, nil
1067 }
1068
1069 // Inst returns the underlying metric instrument.
1070 func (m ClusterquotaHugepageCountRequestUsed) Inst() metric.Int64UpDownCounter {
1071 return m.Int64UpDownCounter
1072 }
1073
1074 // Name returns the semantic convention name of the instrument.
1075 func (ClusterquotaHugepageCountRequestUsed) Name() string {
1076 return "openshift.clusterquota.hugepage_count.request.used"
1077 }
1078
1079 // Unit returns the semantic convention unit of the instrument
1080 func (ClusterquotaHugepageCountRequestUsed) Unit() string {
1081 return "{hugepage}"
1082 }
1083
1084 // Description returns the semantic convention description of the instrument
1085 func (ClusterquotaHugepageCountRequestUsed) Description() string {
1086 return "The current observed total usage of the resource across all projects."
1087 }
1088
1089 // Add adds incr to the existing count for attrs.
1090 //
1091 // The k8sHugepageSize is the the size (identifier) of the K8s huge page.
1092 //
1093 // This metric is retrieved from the `Status.Total.Used` field of the
1094 // [K8s ResourceQuotaStatus]
1095 // of the
1096 // [ClusterResourceQuota].
1097 //
1098 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1099 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1100 func (m ClusterquotaHugepageCountRequestUsed) Add(
1101 ctx context.Context,
1102 incr int64,
1103 k8sHugepageSize string,
1104 attrs ...attribute.KeyValue,
1105 ) {
1106 if len(attrs) == 0 {
1107 m.Int64UpDownCounter.Add(ctx, incr)
1108 return
1109 }
1110
1111 o := addOptPool.Get().(*[]metric.AddOption)
1112 defer func() {
1113 *o = (*o)[:0]
1114 addOptPool.Put(o)
1115 }()
1116
1117 *o = append(
1118 *o,
1119 metric.WithAttributes(
1120 append(
1121 attrs,
1122 attribute.String("k8s.hugepage.size", k8sHugepageSize),
1123 )...,
1124 ),
1125 )
1126
1127 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1128 }
1129
1130 // AddSet adds incr to the existing count for set.
1131 //
1132 // This metric is retrieved from the `Status.Total.Used` field of the
1133 // [K8s ResourceQuotaStatus]
1134 // of the
1135 // [ClusterResourceQuota].
1136 //
1137 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1138 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1139 func (m ClusterquotaHugepageCountRequestUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1140 if set.Len() == 0 {
1141 m.Int64UpDownCounter.Add(ctx, incr)
1142 return
1143 }
1144
1145 o := addOptPool.Get().(*[]metric.AddOption)
1146 defer func() {
1147 *o = (*o)[:0]
1148 addOptPool.Put(o)
1149 }()
1150
1151 *o = append(*o, metric.WithAttributeSet(set))
1152 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1153 }
1154
1155 // ClusterquotaMemoryLimitHard is an instrument used to record metric values
1156 // conforming to the "openshift.clusterquota.memory.limit.hard" semantic
1157 // conventions. It represents the enforced hard limit of the resource across all
1158 // projects.
1159 type ClusterquotaMemoryLimitHard struct {
1160 metric.Int64UpDownCounter
1161 }
1162
1163 var newClusterquotaMemoryLimitHardOpts = []metric.Int64UpDownCounterOption{
1164 metric.WithDescription("The enforced hard limit of the resource across all projects."),
1165 metric.WithUnit("By"),
1166 }
1167
1168 // NewClusterquotaMemoryLimitHard returns a new ClusterquotaMemoryLimitHard
1169 // instrument.
1170 func NewClusterquotaMemoryLimitHard(
1171 m metric.Meter,
1172 opt ...metric.Int64UpDownCounterOption,
1173 ) (ClusterquotaMemoryLimitHard, error) {
1174 // Check if the meter is nil.
1175 if m == nil {
1176 return ClusterquotaMemoryLimitHard{noop.Int64UpDownCounter{}}, nil
1177 }
1178
1179 if len(opt) == 0 {
1180 opt = newClusterquotaMemoryLimitHardOpts
1181 } else {
1182 opt = append(opt, newClusterquotaMemoryLimitHardOpts...)
1183 }
1184
1185 i, err := m.Int64UpDownCounter(
1186 "openshift.clusterquota.memory.limit.hard",
1187 opt...,
1188 )
1189 if err != nil {
1190 return ClusterquotaMemoryLimitHard{noop.Int64UpDownCounter{}}, err
1191 }
1192 return ClusterquotaMemoryLimitHard{i}, nil
1193 }
1194
1195 // Inst returns the underlying metric instrument.
1196 func (m ClusterquotaMemoryLimitHard) Inst() metric.Int64UpDownCounter {
1197 return m.Int64UpDownCounter
1198 }
1199
1200 // Name returns the semantic convention name of the instrument.
1201 func (ClusterquotaMemoryLimitHard) Name() string {
1202 return "openshift.clusterquota.memory.limit.hard"
1203 }
1204
1205 // Unit returns the semantic convention unit of the instrument
1206 func (ClusterquotaMemoryLimitHard) Unit() string {
1207 return "By"
1208 }
1209
1210 // Description returns the semantic convention description of the instrument
1211 func (ClusterquotaMemoryLimitHard) Description() string {
1212 return "The enforced hard limit of the resource across all projects."
1213 }
1214
1215 // Add adds incr to the existing count for attrs.
1216 //
1217 // This metric is retrieved from the `Status.Total.Hard` field of the
1218 // [K8s ResourceQuotaStatus]
1219 // of the
1220 // [ClusterResourceQuota].
1221 //
1222 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1223 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1224 func (m ClusterquotaMemoryLimitHard) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
1225 if len(attrs) == 0 {
1226 m.Int64UpDownCounter.Add(ctx, incr)
1227 return
1228 }
1229
1230 o := addOptPool.Get().(*[]metric.AddOption)
1231 defer func() {
1232 *o = (*o)[:0]
1233 addOptPool.Put(o)
1234 }()
1235
1236 *o = append(*o, metric.WithAttributes(attrs...))
1237 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1238 }
1239
1240 // AddSet adds incr to the existing count for set.
1241 //
1242 // This metric is retrieved from the `Status.Total.Hard` field of the
1243 // [K8s ResourceQuotaStatus]
1244 // of the
1245 // [ClusterResourceQuota].
1246 //
1247 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1248 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1249 func (m ClusterquotaMemoryLimitHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1250 if set.Len() == 0 {
1251 m.Int64UpDownCounter.Add(ctx, incr)
1252 return
1253 }
1254
1255 o := addOptPool.Get().(*[]metric.AddOption)
1256 defer func() {
1257 *o = (*o)[:0]
1258 addOptPool.Put(o)
1259 }()
1260
1261 *o = append(*o, metric.WithAttributeSet(set))
1262 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1263 }
1264
1265 // ClusterquotaMemoryLimitUsed is an instrument used to record metric values
1266 // conforming to the "openshift.clusterquota.memory.limit.used" semantic
1267 // conventions. It represents the current observed total usage of the resource
1268 // across all projects.
1269 type ClusterquotaMemoryLimitUsed struct {
1270 metric.Int64UpDownCounter
1271 }
1272
1273 var newClusterquotaMemoryLimitUsedOpts = []metric.Int64UpDownCounterOption{
1274 metric.WithDescription("The current observed total usage of the resource across all projects."),
1275 metric.WithUnit("By"),
1276 }
1277
1278 // NewClusterquotaMemoryLimitUsed returns a new ClusterquotaMemoryLimitUsed
1279 // instrument.
1280 func NewClusterquotaMemoryLimitUsed(
1281 m metric.Meter,
1282 opt ...metric.Int64UpDownCounterOption,
1283 ) (ClusterquotaMemoryLimitUsed, error) {
1284 // Check if the meter is nil.
1285 if m == nil {
1286 return ClusterquotaMemoryLimitUsed{noop.Int64UpDownCounter{}}, nil
1287 }
1288
1289 if len(opt) == 0 {
1290 opt = newClusterquotaMemoryLimitUsedOpts
1291 } else {
1292 opt = append(opt, newClusterquotaMemoryLimitUsedOpts...)
1293 }
1294
1295 i, err := m.Int64UpDownCounter(
1296 "openshift.clusterquota.memory.limit.used",
1297 opt...,
1298 )
1299 if err != nil {
1300 return ClusterquotaMemoryLimitUsed{noop.Int64UpDownCounter{}}, err
1301 }
1302 return ClusterquotaMemoryLimitUsed{i}, nil
1303 }
1304
1305 // Inst returns the underlying metric instrument.
1306 func (m ClusterquotaMemoryLimitUsed) Inst() metric.Int64UpDownCounter {
1307 return m.Int64UpDownCounter
1308 }
1309
1310 // Name returns the semantic convention name of the instrument.
1311 func (ClusterquotaMemoryLimitUsed) Name() string {
1312 return "openshift.clusterquota.memory.limit.used"
1313 }
1314
1315 // Unit returns the semantic convention unit of the instrument
1316 func (ClusterquotaMemoryLimitUsed) Unit() string {
1317 return "By"
1318 }
1319
1320 // Description returns the semantic convention description of the instrument
1321 func (ClusterquotaMemoryLimitUsed) Description() string {
1322 return "The current observed total usage of the resource across all projects."
1323 }
1324
1325 // Add adds incr to the existing count for attrs.
1326 //
1327 // This metric is retrieved from the `Status.Total.Used` field of the
1328 // [K8s ResourceQuotaStatus]
1329 // of the
1330 // [ClusterResourceQuota].
1331 //
1332 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1333 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1334 func (m ClusterquotaMemoryLimitUsed) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
1335 if len(attrs) == 0 {
1336 m.Int64UpDownCounter.Add(ctx, incr)
1337 return
1338 }
1339
1340 o := addOptPool.Get().(*[]metric.AddOption)
1341 defer func() {
1342 *o = (*o)[:0]
1343 addOptPool.Put(o)
1344 }()
1345
1346 *o = append(*o, metric.WithAttributes(attrs...))
1347 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1348 }
1349
1350 // AddSet adds incr to the existing count for set.
1351 //
1352 // This metric is retrieved from the `Status.Total.Used` field of the
1353 // [K8s ResourceQuotaStatus]
1354 // of the
1355 // [ClusterResourceQuota].
1356 //
1357 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1358 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1359 func (m ClusterquotaMemoryLimitUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1360 if set.Len() == 0 {
1361 m.Int64UpDownCounter.Add(ctx, incr)
1362 return
1363 }
1364
1365 o := addOptPool.Get().(*[]metric.AddOption)
1366 defer func() {
1367 *o = (*o)[:0]
1368 addOptPool.Put(o)
1369 }()
1370
1371 *o = append(*o, metric.WithAttributeSet(set))
1372 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1373 }
1374
1375 // ClusterquotaMemoryRequestHard is an instrument used to record metric values
1376 // conforming to the "openshift.clusterquota.memory.request.hard" semantic
1377 // conventions. It represents the enforced hard limit of the resource across all
1378 // projects.
1379 type ClusterquotaMemoryRequestHard struct {
1380 metric.Int64UpDownCounter
1381 }
1382
1383 var newClusterquotaMemoryRequestHardOpts = []metric.Int64UpDownCounterOption{
1384 metric.WithDescription("The enforced hard limit of the resource across all projects."),
1385 metric.WithUnit("By"),
1386 }
1387
1388 // NewClusterquotaMemoryRequestHard returns a new ClusterquotaMemoryRequestHard
1389 // instrument.
1390 func NewClusterquotaMemoryRequestHard(
1391 m metric.Meter,
1392 opt ...metric.Int64UpDownCounterOption,
1393 ) (ClusterquotaMemoryRequestHard, error) {
1394 // Check if the meter is nil.
1395 if m == nil {
1396 return ClusterquotaMemoryRequestHard{noop.Int64UpDownCounter{}}, nil
1397 }
1398
1399 if len(opt) == 0 {
1400 opt = newClusterquotaMemoryRequestHardOpts
1401 } else {
1402 opt = append(opt, newClusterquotaMemoryRequestHardOpts...)
1403 }
1404
1405 i, err := m.Int64UpDownCounter(
1406 "openshift.clusterquota.memory.request.hard",
1407 opt...,
1408 )
1409 if err != nil {
1410 return ClusterquotaMemoryRequestHard{noop.Int64UpDownCounter{}}, err
1411 }
1412 return ClusterquotaMemoryRequestHard{i}, nil
1413 }
1414
1415 // Inst returns the underlying metric instrument.
1416 func (m ClusterquotaMemoryRequestHard) Inst() metric.Int64UpDownCounter {
1417 return m.Int64UpDownCounter
1418 }
1419
1420 // Name returns the semantic convention name of the instrument.
1421 func (ClusterquotaMemoryRequestHard) Name() string {
1422 return "openshift.clusterquota.memory.request.hard"
1423 }
1424
1425 // Unit returns the semantic convention unit of the instrument
1426 func (ClusterquotaMemoryRequestHard) Unit() string {
1427 return "By"
1428 }
1429
1430 // Description returns the semantic convention description of the instrument
1431 func (ClusterquotaMemoryRequestHard) Description() string {
1432 return "The enforced hard limit of the resource across all projects."
1433 }
1434
1435 // Add adds incr to the existing count for attrs.
1436 //
1437 // This metric is retrieved from the `Status.Total.Hard` field of the
1438 // [K8s ResourceQuotaStatus]
1439 // of the
1440 // [ClusterResourceQuota].
1441 //
1442 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1443 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1444 func (m ClusterquotaMemoryRequestHard) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
1445 if len(attrs) == 0 {
1446 m.Int64UpDownCounter.Add(ctx, incr)
1447 return
1448 }
1449
1450 o := addOptPool.Get().(*[]metric.AddOption)
1451 defer func() {
1452 *o = (*o)[:0]
1453 addOptPool.Put(o)
1454 }()
1455
1456 *o = append(*o, metric.WithAttributes(attrs...))
1457 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1458 }
1459
1460 // AddSet adds incr to the existing count for set.
1461 //
1462 // This metric is retrieved from the `Status.Total.Hard` field of the
1463 // [K8s ResourceQuotaStatus]
1464 // of the
1465 // [ClusterResourceQuota].
1466 //
1467 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1468 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1469 func (m ClusterquotaMemoryRequestHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1470 if set.Len() == 0 {
1471 m.Int64UpDownCounter.Add(ctx, incr)
1472 return
1473 }
1474
1475 o := addOptPool.Get().(*[]metric.AddOption)
1476 defer func() {
1477 *o = (*o)[:0]
1478 addOptPool.Put(o)
1479 }()
1480
1481 *o = append(*o, metric.WithAttributeSet(set))
1482 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1483 }
1484
1485 // ClusterquotaMemoryRequestUsed is an instrument used to record metric values
1486 // conforming to the "openshift.clusterquota.memory.request.used" semantic
1487 // conventions. It represents the current observed total usage of the resource
1488 // across all projects.
1489 type ClusterquotaMemoryRequestUsed struct {
1490 metric.Int64UpDownCounter
1491 }
1492
1493 var newClusterquotaMemoryRequestUsedOpts = []metric.Int64UpDownCounterOption{
1494 metric.WithDescription("The current observed total usage of the resource across all projects."),
1495 metric.WithUnit("By"),
1496 }
1497
1498 // NewClusterquotaMemoryRequestUsed returns a new ClusterquotaMemoryRequestUsed
1499 // instrument.
1500 func NewClusterquotaMemoryRequestUsed(
1501 m metric.Meter,
1502 opt ...metric.Int64UpDownCounterOption,
1503 ) (ClusterquotaMemoryRequestUsed, error) {
1504 // Check if the meter is nil.
1505 if m == nil {
1506 return ClusterquotaMemoryRequestUsed{noop.Int64UpDownCounter{}}, nil
1507 }
1508
1509 if len(opt) == 0 {
1510 opt = newClusterquotaMemoryRequestUsedOpts
1511 } else {
1512 opt = append(opt, newClusterquotaMemoryRequestUsedOpts...)
1513 }
1514
1515 i, err := m.Int64UpDownCounter(
1516 "openshift.clusterquota.memory.request.used",
1517 opt...,
1518 )
1519 if err != nil {
1520 return ClusterquotaMemoryRequestUsed{noop.Int64UpDownCounter{}}, err
1521 }
1522 return ClusterquotaMemoryRequestUsed{i}, nil
1523 }
1524
1525 // Inst returns the underlying metric instrument.
1526 func (m ClusterquotaMemoryRequestUsed) Inst() metric.Int64UpDownCounter {
1527 return m.Int64UpDownCounter
1528 }
1529
1530 // Name returns the semantic convention name of the instrument.
1531 func (ClusterquotaMemoryRequestUsed) Name() string {
1532 return "openshift.clusterquota.memory.request.used"
1533 }
1534
1535 // Unit returns the semantic convention unit of the instrument
1536 func (ClusterquotaMemoryRequestUsed) Unit() string {
1537 return "By"
1538 }
1539
1540 // Description returns the semantic convention description of the instrument
1541 func (ClusterquotaMemoryRequestUsed) Description() string {
1542 return "The current observed total usage of the resource across all projects."
1543 }
1544
1545 // Add adds incr to the existing count for attrs.
1546 //
1547 // This metric is retrieved from the `Status.Total.Used` field of the
1548 // [K8s ResourceQuotaStatus]
1549 // of the
1550 // [ClusterResourceQuota].
1551 //
1552 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1553 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1554 func (m ClusterquotaMemoryRequestUsed) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
1555 if len(attrs) == 0 {
1556 m.Int64UpDownCounter.Add(ctx, incr)
1557 return
1558 }
1559
1560 o := addOptPool.Get().(*[]metric.AddOption)
1561 defer func() {
1562 *o = (*o)[:0]
1563 addOptPool.Put(o)
1564 }()
1565
1566 *o = append(*o, metric.WithAttributes(attrs...))
1567 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1568 }
1569
1570 // AddSet adds incr to the existing count for set.
1571 //
1572 // This metric is retrieved from the `Status.Total.Used` field of the
1573 // [K8s ResourceQuotaStatus]
1574 // of the
1575 // [ClusterResourceQuota].
1576 //
1577 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1578 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1579 func (m ClusterquotaMemoryRequestUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1580 if set.Len() == 0 {
1581 m.Int64UpDownCounter.Add(ctx, incr)
1582 return
1583 }
1584
1585 o := addOptPool.Get().(*[]metric.AddOption)
1586 defer func() {
1587 *o = (*o)[:0]
1588 addOptPool.Put(o)
1589 }()
1590
1591 *o = append(*o, metric.WithAttributeSet(set))
1592 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1593 }
1594
1595 // ClusterquotaObjectCountHard is an instrument used to record metric values
1596 // conforming to the "openshift.clusterquota.object_count.hard" semantic
1597 // conventions. It represents the enforced hard limit of the resource across all
1598 // projects.
1599 type ClusterquotaObjectCountHard struct {
1600 metric.Int64UpDownCounter
1601 }
1602
1603 var newClusterquotaObjectCountHardOpts = []metric.Int64UpDownCounterOption{
1604 metric.WithDescription("The enforced hard limit of the resource across all projects."),
1605 metric.WithUnit("{object}"),
1606 }
1607
1608 // NewClusterquotaObjectCountHard returns a new ClusterquotaObjectCountHard
1609 // instrument.
1610 func NewClusterquotaObjectCountHard(
1611 m metric.Meter,
1612 opt ...metric.Int64UpDownCounterOption,
1613 ) (ClusterquotaObjectCountHard, error) {
1614 // Check if the meter is nil.
1615 if m == nil {
1616 return ClusterquotaObjectCountHard{noop.Int64UpDownCounter{}}, nil
1617 }
1618
1619 if len(opt) == 0 {
1620 opt = newClusterquotaObjectCountHardOpts
1621 } else {
1622 opt = append(opt, newClusterquotaObjectCountHardOpts...)
1623 }
1624
1625 i, err := m.Int64UpDownCounter(
1626 "openshift.clusterquota.object_count.hard",
1627 opt...,
1628 )
1629 if err != nil {
1630 return ClusterquotaObjectCountHard{noop.Int64UpDownCounter{}}, err
1631 }
1632 return ClusterquotaObjectCountHard{i}, nil
1633 }
1634
1635 // Inst returns the underlying metric instrument.
1636 func (m ClusterquotaObjectCountHard) Inst() metric.Int64UpDownCounter {
1637 return m.Int64UpDownCounter
1638 }
1639
1640 // Name returns the semantic convention name of the instrument.
1641 func (ClusterquotaObjectCountHard) Name() string {
1642 return "openshift.clusterquota.object_count.hard"
1643 }
1644
1645 // Unit returns the semantic convention unit of the instrument
1646 func (ClusterquotaObjectCountHard) Unit() string {
1647 return "{object}"
1648 }
1649
1650 // Description returns the semantic convention description of the instrument
1651 func (ClusterquotaObjectCountHard) Description() string {
1652 return "The enforced hard limit of the resource across all projects."
1653 }
1654
1655 // Add adds incr to the existing count for attrs.
1656 //
1657 // The k8sResourcequotaResourceName is the the name of the K8s resource a
1658 // resource quota defines.
1659 //
1660 // This metric is retrieved from the `Status.Total.Hard` field of the
1661 // [K8s ResourceQuotaStatus]
1662 // of the
1663 // [ClusterResourceQuota].
1664 //
1665 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1666 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1667 func (m ClusterquotaObjectCountHard) Add(
1668 ctx context.Context,
1669 incr int64,
1670 k8sResourcequotaResourceName string,
1671 attrs ...attribute.KeyValue,
1672 ) {
1673 if len(attrs) == 0 {
1674 m.Int64UpDownCounter.Add(ctx, incr)
1675 return
1676 }
1677
1678 o := addOptPool.Get().(*[]metric.AddOption)
1679 defer func() {
1680 *o = (*o)[:0]
1681 addOptPool.Put(o)
1682 }()
1683
1684 *o = append(
1685 *o,
1686 metric.WithAttributes(
1687 append(
1688 attrs,
1689 attribute.String("k8s.resourcequota.resource_name", k8sResourcequotaResourceName),
1690 )...,
1691 ),
1692 )
1693
1694 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1695 }
1696
1697 // AddSet adds incr to the existing count for set.
1698 //
1699 // This metric is retrieved from the `Status.Total.Hard` field of the
1700 // [K8s ResourceQuotaStatus]
1701 // of the
1702 // [ClusterResourceQuota].
1703 //
1704 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1705 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1706 func (m ClusterquotaObjectCountHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1707 if set.Len() == 0 {
1708 m.Int64UpDownCounter.Add(ctx, incr)
1709 return
1710 }
1711
1712 o := addOptPool.Get().(*[]metric.AddOption)
1713 defer func() {
1714 *o = (*o)[:0]
1715 addOptPool.Put(o)
1716 }()
1717
1718 *o = append(*o, metric.WithAttributeSet(set))
1719 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1720 }
1721
1722 // ClusterquotaObjectCountUsed is an instrument used to record metric values
1723 // conforming to the "openshift.clusterquota.object_count.used" semantic
1724 // conventions. It represents the current observed total usage of the resource
1725 // across all projects.
1726 type ClusterquotaObjectCountUsed struct {
1727 metric.Int64UpDownCounter
1728 }
1729
1730 var newClusterquotaObjectCountUsedOpts = []metric.Int64UpDownCounterOption{
1731 metric.WithDescription("The current observed total usage of the resource across all projects."),
1732 metric.WithUnit("{object}"),
1733 }
1734
1735 // NewClusterquotaObjectCountUsed returns a new ClusterquotaObjectCountUsed
1736 // instrument.
1737 func NewClusterquotaObjectCountUsed(
1738 m metric.Meter,
1739 opt ...metric.Int64UpDownCounterOption,
1740 ) (ClusterquotaObjectCountUsed, error) {
1741 // Check if the meter is nil.
1742 if m == nil {
1743 return ClusterquotaObjectCountUsed{noop.Int64UpDownCounter{}}, nil
1744 }
1745
1746 if len(opt) == 0 {
1747 opt = newClusterquotaObjectCountUsedOpts
1748 } else {
1749 opt = append(opt, newClusterquotaObjectCountUsedOpts...)
1750 }
1751
1752 i, err := m.Int64UpDownCounter(
1753 "openshift.clusterquota.object_count.used",
1754 opt...,
1755 )
1756 if err != nil {
1757 return ClusterquotaObjectCountUsed{noop.Int64UpDownCounter{}}, err
1758 }
1759 return ClusterquotaObjectCountUsed{i}, nil
1760 }
1761
1762 // Inst returns the underlying metric instrument.
1763 func (m ClusterquotaObjectCountUsed) Inst() metric.Int64UpDownCounter {
1764 return m.Int64UpDownCounter
1765 }
1766
1767 // Name returns the semantic convention name of the instrument.
1768 func (ClusterquotaObjectCountUsed) Name() string {
1769 return "openshift.clusterquota.object_count.used"
1770 }
1771
1772 // Unit returns the semantic convention unit of the instrument
1773 func (ClusterquotaObjectCountUsed) Unit() string {
1774 return "{object}"
1775 }
1776
1777 // Description returns the semantic convention description of the instrument
1778 func (ClusterquotaObjectCountUsed) Description() string {
1779 return "The current observed total usage of the resource across all projects."
1780 }
1781
1782 // Add adds incr to the existing count for attrs.
1783 //
1784 // The k8sResourcequotaResourceName is the the name of the K8s resource a
1785 // resource quota defines.
1786 //
1787 // This metric is retrieved from the `Status.Total.Used` field of the
1788 // [K8s ResourceQuotaStatus]
1789 // of the
1790 // [ClusterResourceQuota].
1791 //
1792 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1793 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1794 func (m ClusterquotaObjectCountUsed) Add(
1795 ctx context.Context,
1796 incr int64,
1797 k8sResourcequotaResourceName string,
1798 attrs ...attribute.KeyValue,
1799 ) {
1800 if len(attrs) == 0 {
1801 m.Int64UpDownCounter.Add(ctx, incr)
1802 return
1803 }
1804
1805 o := addOptPool.Get().(*[]metric.AddOption)
1806 defer func() {
1807 *o = (*o)[:0]
1808 addOptPool.Put(o)
1809 }()
1810
1811 *o = append(
1812 *o,
1813 metric.WithAttributes(
1814 append(
1815 attrs,
1816 attribute.String("k8s.resourcequota.resource_name", k8sResourcequotaResourceName),
1817 )...,
1818 ),
1819 )
1820
1821 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1822 }
1823
1824 // AddSet adds incr to the existing count for set.
1825 //
1826 // This metric is retrieved from the `Status.Total.Used` field of the
1827 // [K8s ResourceQuotaStatus]
1828 // of the
1829 // [ClusterResourceQuota].
1830 //
1831 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1832 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1833 func (m ClusterquotaObjectCountUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1834 if set.Len() == 0 {
1835 m.Int64UpDownCounter.Add(ctx, incr)
1836 return
1837 }
1838
1839 o := addOptPool.Get().(*[]metric.AddOption)
1840 defer func() {
1841 *o = (*o)[:0]
1842 addOptPool.Put(o)
1843 }()
1844
1845 *o = append(*o, metric.WithAttributeSet(set))
1846 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1847 }
1848
1849 // ClusterquotaPersistentvolumeclaimCountHard is an instrument used to record
1850 // metric values conforming to the
1851 // "openshift.clusterquota.persistentvolumeclaim_count.hard" semantic
1852 // conventions. It represents the enforced hard limit of the resource across all
1853 // projects.
1854 type ClusterquotaPersistentvolumeclaimCountHard struct {
1855 metric.Int64UpDownCounter
1856 }
1857
1858 var newClusterquotaPersistentvolumeclaimCountHardOpts = []metric.Int64UpDownCounterOption{
1859 metric.WithDescription("The enforced hard limit of the resource across all projects."),
1860 metric.WithUnit("{persistentvolumeclaim}"),
1861 }
1862
1863 // NewClusterquotaPersistentvolumeclaimCountHard returns a new
1864 // ClusterquotaPersistentvolumeclaimCountHard instrument.
1865 func NewClusterquotaPersistentvolumeclaimCountHard(
1866 m metric.Meter,
1867 opt ...metric.Int64UpDownCounterOption,
1868 ) (ClusterquotaPersistentvolumeclaimCountHard, error) {
1869 // Check if the meter is nil.
1870 if m == nil {
1871 return ClusterquotaPersistentvolumeclaimCountHard{noop.Int64UpDownCounter{}}, nil
1872 }
1873
1874 if len(opt) == 0 {
1875 opt = newClusterquotaPersistentvolumeclaimCountHardOpts
1876 } else {
1877 opt = append(opt, newClusterquotaPersistentvolumeclaimCountHardOpts...)
1878 }
1879
1880 i, err := m.Int64UpDownCounter(
1881 "openshift.clusterquota.persistentvolumeclaim_count.hard",
1882 opt...,
1883 )
1884 if err != nil {
1885 return ClusterquotaPersistentvolumeclaimCountHard{noop.Int64UpDownCounter{}}, err
1886 }
1887 return ClusterquotaPersistentvolumeclaimCountHard{i}, nil
1888 }
1889
1890 // Inst returns the underlying metric instrument.
1891 func (m ClusterquotaPersistentvolumeclaimCountHard) Inst() metric.Int64UpDownCounter {
1892 return m.Int64UpDownCounter
1893 }
1894
1895 // Name returns the semantic convention name of the instrument.
1896 func (ClusterquotaPersistentvolumeclaimCountHard) Name() string {
1897 return "openshift.clusterquota.persistentvolumeclaim_count.hard"
1898 }
1899
1900 // Unit returns the semantic convention unit of the instrument
1901 func (ClusterquotaPersistentvolumeclaimCountHard) Unit() string {
1902 return "{persistentvolumeclaim}"
1903 }
1904
1905 // Description returns the semantic convention description of the instrument
1906 func (ClusterquotaPersistentvolumeclaimCountHard) Description() string {
1907 return "The enforced hard limit of the resource across all projects."
1908 }
1909
1910 // Add adds incr to the existing count for attrs.
1911 //
1912 // All additional attrs passed are included in the recorded value.
1913 //
1914 // This metric is retrieved from the `Status.Total.Hard` field of the
1915 // [K8s ResourceQuotaStatus]
1916 // of the
1917 // [ClusterResourceQuota].
1918 //
1919 // The `k8s.storageclass.name` should be required when a resource quota is
1920 // defined for a specific
1921 // storage class.
1922 //
1923 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1924 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1925 func (m ClusterquotaPersistentvolumeclaimCountHard) Add(
1926 ctx context.Context,
1927 incr int64,
1928 attrs ...attribute.KeyValue,
1929 ) {
1930 if len(attrs) == 0 {
1931 m.Int64UpDownCounter.Add(ctx, incr)
1932 return
1933 }
1934
1935 o := addOptPool.Get().(*[]metric.AddOption)
1936 defer func() {
1937 *o = (*o)[:0]
1938 addOptPool.Put(o)
1939 }()
1940
1941 *o = append(
1942 *o,
1943 metric.WithAttributes(
1944 attrs...,
1945 ),
1946 )
1947
1948 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1949 }
1950
1951 // AddSet adds incr to the existing count for set.
1952 //
1953 // This metric is retrieved from the `Status.Total.Hard` field of the
1954 // [K8s ResourceQuotaStatus]
1955 // of the
1956 // [ClusterResourceQuota].
1957 //
1958 // The `k8s.storageclass.name` should be required when a resource quota is
1959 // defined for a specific
1960 // storage class.
1961 //
1962 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
1963 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
1964 func (m ClusterquotaPersistentvolumeclaimCountHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
1965 if set.Len() == 0 {
1966 m.Int64UpDownCounter.Add(ctx, incr)
1967 return
1968 }
1969
1970 o := addOptPool.Get().(*[]metric.AddOption)
1971 defer func() {
1972 *o = (*o)[:0]
1973 addOptPool.Put(o)
1974 }()
1975
1976 *o = append(*o, metric.WithAttributeSet(set))
1977 m.Int64UpDownCounter.Add(ctx, incr, *o...)
1978 }
1979
1980 // AttrK8SStorageclassName returns an optional attribute for the
1981 // "k8s.storageclass.name" semantic convention. It represents the name of K8s
1982 // [StorageClass] object.
1983 //
1984 // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io
1985 func (ClusterquotaPersistentvolumeclaimCountHard) AttrK8SStorageclassName(val string) attribute.KeyValue {
1986 return attribute.String("k8s.storageclass.name", val)
1987 }
1988
1989 // ClusterquotaPersistentvolumeclaimCountUsed is an instrument used to record
1990 // metric values conforming to the
1991 // "openshift.clusterquota.persistentvolumeclaim_count.used" semantic
1992 // conventions. It represents the current observed total usage of the resource
1993 // across all projects.
1994 type ClusterquotaPersistentvolumeclaimCountUsed struct {
1995 metric.Int64UpDownCounter
1996 }
1997
1998 var newClusterquotaPersistentvolumeclaimCountUsedOpts = []metric.Int64UpDownCounterOption{
1999 metric.WithDescription("The current observed total usage of the resource across all projects."),
2000 metric.WithUnit("{persistentvolumeclaim}"),
2001 }
2002
2003 // NewClusterquotaPersistentvolumeclaimCountUsed returns a new
2004 // ClusterquotaPersistentvolumeclaimCountUsed instrument.
2005 func NewClusterquotaPersistentvolumeclaimCountUsed(
2006 m metric.Meter,
2007 opt ...metric.Int64UpDownCounterOption,
2008 ) (ClusterquotaPersistentvolumeclaimCountUsed, error) {
2009 // Check if the meter is nil.
2010 if m == nil {
2011 return ClusterquotaPersistentvolumeclaimCountUsed{noop.Int64UpDownCounter{}}, nil
2012 }
2013
2014 if len(opt) == 0 {
2015 opt = newClusterquotaPersistentvolumeclaimCountUsedOpts
2016 } else {
2017 opt = append(opt, newClusterquotaPersistentvolumeclaimCountUsedOpts...)
2018 }
2019
2020 i, err := m.Int64UpDownCounter(
2021 "openshift.clusterquota.persistentvolumeclaim_count.used",
2022 opt...,
2023 )
2024 if err != nil {
2025 return ClusterquotaPersistentvolumeclaimCountUsed{noop.Int64UpDownCounter{}}, err
2026 }
2027 return ClusterquotaPersistentvolumeclaimCountUsed{i}, nil
2028 }
2029
2030 // Inst returns the underlying metric instrument.
2031 func (m ClusterquotaPersistentvolumeclaimCountUsed) Inst() metric.Int64UpDownCounter {
2032 return m.Int64UpDownCounter
2033 }
2034
2035 // Name returns the semantic convention name of the instrument.
2036 func (ClusterquotaPersistentvolumeclaimCountUsed) Name() string {
2037 return "openshift.clusterquota.persistentvolumeclaim_count.used"
2038 }
2039
2040 // Unit returns the semantic convention unit of the instrument
2041 func (ClusterquotaPersistentvolumeclaimCountUsed) Unit() string {
2042 return "{persistentvolumeclaim}"
2043 }
2044
2045 // Description returns the semantic convention description of the instrument
2046 func (ClusterquotaPersistentvolumeclaimCountUsed) Description() string {
2047 return "The current observed total usage of the resource across all projects."
2048 }
2049
2050 // Add adds incr to the existing count for attrs.
2051 //
2052 // All additional attrs passed are included in the recorded value.
2053 //
2054 // This metric is retrieved from the `Status.Total.Used` field of the
2055 // [K8s ResourceQuotaStatus]
2056 // of the
2057 // [ClusterResourceQuota].
2058 //
2059 // The `k8s.storageclass.name` should be required when a resource quota is
2060 // defined for a specific
2061 // storage class.
2062 //
2063 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
2064 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
2065 func (m ClusterquotaPersistentvolumeclaimCountUsed) Add(
2066 ctx context.Context,
2067 incr int64,
2068 attrs ...attribute.KeyValue,
2069 ) {
2070 if len(attrs) == 0 {
2071 m.Int64UpDownCounter.Add(ctx, incr)
2072 return
2073 }
2074
2075 o := addOptPool.Get().(*[]metric.AddOption)
2076 defer func() {
2077 *o = (*o)[:0]
2078 addOptPool.Put(o)
2079 }()
2080
2081 *o = append(
2082 *o,
2083 metric.WithAttributes(
2084 attrs...,
2085 ),
2086 )
2087
2088 m.Int64UpDownCounter.Add(ctx, incr, *o...)
2089 }
2090
2091 // AddSet adds incr to the existing count for set.
2092 //
2093 // This metric is retrieved from the `Status.Total.Used` field of the
2094 // [K8s ResourceQuotaStatus]
2095 // of the
2096 // [ClusterResourceQuota].
2097 //
2098 // The `k8s.storageclass.name` should be required when a resource quota is
2099 // defined for a specific
2100 // storage class.
2101 //
2102 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
2103 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
2104 func (m ClusterquotaPersistentvolumeclaimCountUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
2105 if set.Len() == 0 {
2106 m.Int64UpDownCounter.Add(ctx, incr)
2107 return
2108 }
2109
2110 o := addOptPool.Get().(*[]metric.AddOption)
2111 defer func() {
2112 *o = (*o)[:0]
2113 addOptPool.Put(o)
2114 }()
2115
2116 *o = append(*o, metric.WithAttributeSet(set))
2117 m.Int64UpDownCounter.Add(ctx, incr, *o...)
2118 }
2119
2120 // AttrK8SStorageclassName returns an optional attribute for the
2121 // "k8s.storageclass.name" semantic convention. It represents the name of K8s
2122 // [StorageClass] object.
2123 //
2124 // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io
2125 func (ClusterquotaPersistentvolumeclaimCountUsed) AttrK8SStorageclassName(val string) attribute.KeyValue {
2126 return attribute.String("k8s.storageclass.name", val)
2127 }
2128
2129 // ClusterquotaStorageRequestHard is an instrument used to record metric values
2130 // conforming to the "openshift.clusterquota.storage.request.hard" semantic
2131 // conventions. It represents the enforced hard limit of the resource across all
2132 // projects.
2133 type ClusterquotaStorageRequestHard struct {
2134 metric.Int64UpDownCounter
2135 }
2136
2137 var newClusterquotaStorageRequestHardOpts = []metric.Int64UpDownCounterOption{
2138 metric.WithDescription("The enforced hard limit of the resource across all projects."),
2139 metric.WithUnit("By"),
2140 }
2141
2142 // NewClusterquotaStorageRequestHard returns a new ClusterquotaStorageRequestHard
2143 // instrument.
2144 func NewClusterquotaStorageRequestHard(
2145 m metric.Meter,
2146 opt ...metric.Int64UpDownCounterOption,
2147 ) (ClusterquotaStorageRequestHard, error) {
2148 // Check if the meter is nil.
2149 if m == nil {
2150 return ClusterquotaStorageRequestHard{noop.Int64UpDownCounter{}}, nil
2151 }
2152
2153 if len(opt) == 0 {
2154 opt = newClusterquotaStorageRequestHardOpts
2155 } else {
2156 opt = append(opt, newClusterquotaStorageRequestHardOpts...)
2157 }
2158
2159 i, err := m.Int64UpDownCounter(
2160 "openshift.clusterquota.storage.request.hard",
2161 opt...,
2162 )
2163 if err != nil {
2164 return ClusterquotaStorageRequestHard{noop.Int64UpDownCounter{}}, err
2165 }
2166 return ClusterquotaStorageRequestHard{i}, nil
2167 }
2168
2169 // Inst returns the underlying metric instrument.
2170 func (m ClusterquotaStorageRequestHard) Inst() metric.Int64UpDownCounter {
2171 return m.Int64UpDownCounter
2172 }
2173
2174 // Name returns the semantic convention name of the instrument.
2175 func (ClusterquotaStorageRequestHard) Name() string {
2176 return "openshift.clusterquota.storage.request.hard"
2177 }
2178
2179 // Unit returns the semantic convention unit of the instrument
2180 func (ClusterquotaStorageRequestHard) Unit() string {
2181 return "By"
2182 }
2183
2184 // Description returns the semantic convention description of the instrument
2185 func (ClusterquotaStorageRequestHard) Description() string {
2186 return "The enforced hard limit of the resource across all projects."
2187 }
2188
2189 // Add adds incr to the existing count for attrs.
2190 //
2191 // All additional attrs passed are included in the recorded value.
2192 //
2193 // This metric is retrieved from the `Status.Total.Hard` field of the
2194 // [K8s ResourceQuotaStatus]
2195 // of the
2196 // [ClusterResourceQuota].
2197 //
2198 // The `k8s.storageclass.name` should be required when a resource quota is
2199 // defined for a specific
2200 // storage class.
2201 //
2202 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
2203 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
2204 func (m ClusterquotaStorageRequestHard) Add(
2205 ctx context.Context,
2206 incr int64,
2207 attrs ...attribute.KeyValue,
2208 ) {
2209 if len(attrs) == 0 {
2210 m.Int64UpDownCounter.Add(ctx, incr)
2211 return
2212 }
2213
2214 o := addOptPool.Get().(*[]metric.AddOption)
2215 defer func() {
2216 *o = (*o)[:0]
2217 addOptPool.Put(o)
2218 }()
2219
2220 *o = append(
2221 *o,
2222 metric.WithAttributes(
2223 attrs...,
2224 ),
2225 )
2226
2227 m.Int64UpDownCounter.Add(ctx, incr, *o...)
2228 }
2229
2230 // AddSet adds incr to the existing count for set.
2231 //
2232 // This metric is retrieved from the `Status.Total.Hard` field of the
2233 // [K8s ResourceQuotaStatus]
2234 // of the
2235 // [ClusterResourceQuota].
2236 //
2237 // The `k8s.storageclass.name` should be required when a resource quota is
2238 // defined for a specific
2239 // storage class.
2240 //
2241 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
2242 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
2243 func (m ClusterquotaStorageRequestHard) AddSet(ctx context.Context, incr int64, set attribute.Set) {
2244 if set.Len() == 0 {
2245 m.Int64UpDownCounter.Add(ctx, incr)
2246 return
2247 }
2248
2249 o := addOptPool.Get().(*[]metric.AddOption)
2250 defer func() {
2251 *o = (*o)[:0]
2252 addOptPool.Put(o)
2253 }()
2254
2255 *o = append(*o, metric.WithAttributeSet(set))
2256 m.Int64UpDownCounter.Add(ctx, incr, *o...)
2257 }
2258
2259 // AttrK8SStorageclassName returns an optional attribute for the
2260 // "k8s.storageclass.name" semantic convention. It represents the name of K8s
2261 // [StorageClass] object.
2262 //
2263 // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io
2264 func (ClusterquotaStorageRequestHard) AttrK8SStorageclassName(val string) attribute.KeyValue {
2265 return attribute.String("k8s.storageclass.name", val)
2266 }
2267
2268 // ClusterquotaStorageRequestUsed is an instrument used to record metric values
2269 // conforming to the "openshift.clusterquota.storage.request.used" semantic
2270 // conventions. It represents the current observed total usage of the resource
2271 // across all projects.
2272 type ClusterquotaStorageRequestUsed struct {
2273 metric.Int64UpDownCounter
2274 }
2275
2276 var newClusterquotaStorageRequestUsedOpts = []metric.Int64UpDownCounterOption{
2277 metric.WithDescription("The current observed total usage of the resource across all projects."),
2278 metric.WithUnit("By"),
2279 }
2280
2281 // NewClusterquotaStorageRequestUsed returns a new ClusterquotaStorageRequestUsed
2282 // instrument.
2283 func NewClusterquotaStorageRequestUsed(
2284 m metric.Meter,
2285 opt ...metric.Int64UpDownCounterOption,
2286 ) (ClusterquotaStorageRequestUsed, error) {
2287 // Check if the meter is nil.
2288 if m == nil {
2289 return ClusterquotaStorageRequestUsed{noop.Int64UpDownCounter{}}, nil
2290 }
2291
2292 if len(opt) == 0 {
2293 opt = newClusterquotaStorageRequestUsedOpts
2294 } else {
2295 opt = append(opt, newClusterquotaStorageRequestUsedOpts...)
2296 }
2297
2298 i, err := m.Int64UpDownCounter(
2299 "openshift.clusterquota.storage.request.used",
2300 opt...,
2301 )
2302 if err != nil {
2303 return ClusterquotaStorageRequestUsed{noop.Int64UpDownCounter{}}, err
2304 }
2305 return ClusterquotaStorageRequestUsed{i}, nil
2306 }
2307
2308 // Inst returns the underlying metric instrument.
2309 func (m ClusterquotaStorageRequestUsed) Inst() metric.Int64UpDownCounter {
2310 return m.Int64UpDownCounter
2311 }
2312
2313 // Name returns the semantic convention name of the instrument.
2314 func (ClusterquotaStorageRequestUsed) Name() string {
2315 return "openshift.clusterquota.storage.request.used"
2316 }
2317
2318 // Unit returns the semantic convention unit of the instrument
2319 func (ClusterquotaStorageRequestUsed) Unit() string {
2320 return "By"
2321 }
2322
2323 // Description returns the semantic convention description of the instrument
2324 func (ClusterquotaStorageRequestUsed) Description() string {
2325 return "The current observed total usage of the resource across all projects."
2326 }
2327
2328 // Add adds incr to the existing count for attrs.
2329 //
2330 // All additional attrs passed are included in the recorded value.
2331 //
2332 // This metric is retrieved from the `Status.Total.Used` field of the
2333 // [K8s ResourceQuotaStatus]
2334 // of the
2335 // [ClusterResourceQuota].
2336 //
2337 // The `k8s.storageclass.name` should be required when a resource quota is
2338 // defined for a specific
2339 // storage class.
2340 //
2341 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
2342 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
2343 func (m ClusterquotaStorageRequestUsed) Add(
2344 ctx context.Context,
2345 incr int64,
2346 attrs ...attribute.KeyValue,
2347 ) {
2348 if len(attrs) == 0 {
2349 m.Int64UpDownCounter.Add(ctx, incr)
2350 return
2351 }
2352
2353 o := addOptPool.Get().(*[]metric.AddOption)
2354 defer func() {
2355 *o = (*o)[:0]
2356 addOptPool.Put(o)
2357 }()
2358
2359 *o = append(
2360 *o,
2361 metric.WithAttributes(
2362 attrs...,
2363 ),
2364 )
2365
2366 m.Int64UpDownCounter.Add(ctx, incr, *o...)
2367 }
2368
2369 // AddSet adds incr to the existing count for set.
2370 //
2371 // This metric is retrieved from the `Status.Total.Used` field of the
2372 // [K8s ResourceQuotaStatus]
2373 // of the
2374 // [ClusterResourceQuota].
2375 //
2376 // The `k8s.storageclass.name` should be required when a resource quota is
2377 // defined for a specific
2378 // storage class.
2379 //
2380 // [K8s ResourceQuotaStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core
2381 // [ClusterResourceQuota]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/schedule_and_quota_apis/clusterresourcequota-quota-openshift-io-v1#status-total
2382 func (m ClusterquotaStorageRequestUsed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
2383 if set.Len() == 0 {
2384 m.Int64UpDownCounter.Add(ctx, incr)
2385 return
2386 }
2387
2388 o := addOptPool.Get().(*[]metric.AddOption)
2389 defer func() {
2390 *o = (*o)[:0]
2391 addOptPool.Put(o)
2392 }()
2393
2394 *o = append(*o, metric.WithAttributeSet(set))
2395 m.Int64UpDownCounter.Add(ctx, incr, *o...)
2396 }
2397
2398 // AttrK8SStorageclassName returns an optional attribute for the
2399 // "k8s.storageclass.name" semantic convention. It represents the name of K8s
2400 // [StorageClass] object.
2401 //
2402 // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io
2403 func (ClusterquotaStorageRequestUsed) AttrK8SStorageclassName(val string) attribute.KeyValue {
2404 return attribute.String("k8s.storageclass.name", val)
2405 }