|
| 1 | +/* |
| 2 | + * Copyright The OpenTelemetry Authors |
| 3 | + * SPDX-License-Identifier: Apache-2.0 |
| 4 | + */ |
| 5 | + |
| 6 | +/* |
| 7 | + * DO NOT EDIT, this is an Auto-generated file from: |
| 8 | + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 |
| 9 | + */ |
| 10 | + |
| 11 | +#pragma once |
| 12 | + |
| 13 | +#include "opentelemetry/common/macros.h" |
| 14 | +#include "opentelemetry/metrics/meter.h" |
| 15 | +#include "opentelemetry/version.h" |
| 16 | + |
| 17 | +OPENTELEMETRY_BEGIN_NAMESPACE |
| 18 | +namespace semconv |
| 19 | +{ |
| 20 | +namespace cicd |
| 21 | +{ |
| 22 | + |
| 23 | +/** |
| 24 | + * The number of pipeline runs currently active in the system by state. |
| 25 | + * <p> |
| 26 | + * updowncounter |
| 27 | + */ |
| 28 | +static constexpr const char *kMetricCicdPipelineRunActive = "cicd.pipeline.run.active"; |
| 29 | +static constexpr const char *descrMetricCicdPipelineRunActive = |
| 30 | + "The number of pipeline runs currently active in the system by state."; |
| 31 | +static constexpr const char *unitMetricCicdPipelineRunActive = "{run}"; |
| 32 | + |
| 33 | +static inline nostd::unique_ptr<metrics::UpDownCounter<int64_t>> |
| 34 | +CreateSyncInt64MetricCicdPipelineRunActive(metrics::Meter *meter) |
| 35 | +{ |
| 36 | + return meter->CreateInt64UpDownCounter(kMetricCicdPipelineRunActive, |
| 37 | + descrMetricCicdPipelineRunActive, |
| 38 | + unitMetricCicdPipelineRunActive); |
| 39 | +} |
| 40 | + |
| 41 | +static inline nostd::unique_ptr<metrics::UpDownCounter<double>> |
| 42 | +CreateSyncDoubleMetricCicdPipelineRunActive(metrics::Meter *meter) |
| 43 | +{ |
| 44 | + return meter->CreateDoubleUpDownCounter(kMetricCicdPipelineRunActive, |
| 45 | + descrMetricCicdPipelineRunActive, |
| 46 | + unitMetricCicdPipelineRunActive); |
| 47 | +} |
| 48 | + |
| 49 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 50 | +CreateAsyncInt64MetricCicdPipelineRunActive(metrics::Meter *meter) |
| 51 | +{ |
| 52 | + return meter->CreateInt64ObservableUpDownCounter(kMetricCicdPipelineRunActive, |
| 53 | + descrMetricCicdPipelineRunActive, |
| 54 | + unitMetricCicdPipelineRunActive); |
| 55 | +} |
| 56 | + |
| 57 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 58 | +CreateAsyncDoubleMetricCicdPipelineRunActive(metrics::Meter *meter) |
| 59 | +{ |
| 60 | + return meter->CreateDoubleObservableUpDownCounter(kMetricCicdPipelineRunActive, |
| 61 | + descrMetricCicdPipelineRunActive, |
| 62 | + unitMetricCicdPipelineRunActive); |
| 63 | +} |
| 64 | + |
| 65 | +/** |
| 66 | + * Duration of a pipeline run grouped by pipeline, state and result. |
| 67 | + * <p> |
| 68 | + * histogram |
| 69 | + */ |
| 70 | +static constexpr const char *kMetricCicdPipelineRunDuration = "cicd.pipeline.run.duration"; |
| 71 | +static constexpr const char *descrMetricCicdPipelineRunDuration = |
| 72 | + "Duration of a pipeline run grouped by pipeline, state and result."; |
| 73 | +static constexpr const char *unitMetricCicdPipelineRunDuration = "s"; |
| 74 | + |
| 75 | +static inline nostd::unique_ptr<metrics::Histogram<uint64_t>> |
| 76 | +CreateSyncInt64MetricCicdPipelineRunDuration(metrics::Meter *meter) |
| 77 | +{ |
| 78 | + return meter->CreateUInt64Histogram(kMetricCicdPipelineRunDuration, |
| 79 | + descrMetricCicdPipelineRunDuration, |
| 80 | + unitMetricCicdPipelineRunDuration); |
| 81 | +} |
| 82 | + |
| 83 | +static inline nostd::unique_ptr<metrics::Histogram<double>> |
| 84 | +CreateSyncDoubleMetricCicdPipelineRunDuration(metrics::Meter *meter) |
| 85 | +{ |
| 86 | + return meter->CreateDoubleHistogram(kMetricCicdPipelineRunDuration, |
| 87 | + descrMetricCicdPipelineRunDuration, |
| 88 | + unitMetricCicdPipelineRunDuration); |
| 89 | +} |
| 90 | + |
| 91 | +/** |
| 92 | + * The number of errors encountered in pipeline runs (eg. compile, test failures). |
| 93 | + * <p> |
| 94 | + * There might be errors in a pipeline run that are non fatal (eg. they are suppressed) or in a |
| 95 | + * parallel stage multiple stages could have a fatal error. This means that this error count might |
| 96 | + * not be the same as the count of metric @code cicd.pipeline.run.duration @endcode with run result |
| 97 | + * @code failure @endcode. <p> counter |
| 98 | + */ |
| 99 | +static constexpr const char *kMetricCicdPipelineRunErrors = "cicd.pipeline.run.errors"; |
| 100 | +static constexpr const char *descrMetricCicdPipelineRunErrors = |
| 101 | + "The number of errors encountered in pipeline runs (eg. compile, test failures)."; |
| 102 | +static constexpr const char *unitMetricCicdPipelineRunErrors = "{error}"; |
| 103 | + |
| 104 | +static inline nostd::unique_ptr<metrics::Counter<uint64_t>> |
| 105 | +CreateSyncInt64MetricCicdPipelineRunErrors(metrics::Meter *meter) |
| 106 | +{ |
| 107 | + return meter->CreateUInt64Counter(kMetricCicdPipelineRunErrors, descrMetricCicdPipelineRunErrors, |
| 108 | + unitMetricCicdPipelineRunErrors); |
| 109 | +} |
| 110 | + |
| 111 | +static inline nostd::unique_ptr<metrics::Counter<double>> |
| 112 | +CreateSyncDoubleMetricCicdPipelineRunErrors(metrics::Meter *meter) |
| 113 | +{ |
| 114 | + return meter->CreateDoubleCounter(kMetricCicdPipelineRunErrors, descrMetricCicdPipelineRunErrors, |
| 115 | + unitMetricCicdPipelineRunErrors); |
| 116 | +} |
| 117 | + |
| 118 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 119 | +CreateAsyncInt64MetricCicdPipelineRunErrors(metrics::Meter *meter) |
| 120 | +{ |
| 121 | + return meter->CreateInt64ObservableCounter(kMetricCicdPipelineRunErrors, |
| 122 | + descrMetricCicdPipelineRunErrors, |
| 123 | + unitMetricCicdPipelineRunErrors); |
| 124 | +} |
| 125 | + |
| 126 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 127 | +CreateAsyncDoubleMetricCicdPipelineRunErrors(metrics::Meter *meter) |
| 128 | +{ |
| 129 | + return meter->CreateDoubleObservableCounter(kMetricCicdPipelineRunErrors, |
| 130 | + descrMetricCicdPipelineRunErrors, |
| 131 | + unitMetricCicdPipelineRunErrors); |
| 132 | +} |
| 133 | + |
| 134 | +/** |
| 135 | + * The number of errors in a component of the CICD system (eg. controller, scheduler, agent). |
| 136 | + * <p> |
| 137 | + * Errors in pipeline run execution are explicitly excluded. Ie a test failure is not counted in |
| 138 | + * this metric. <p> counter |
| 139 | + */ |
| 140 | +static constexpr const char *kMetricCicdSystemErrors = "cicd.system.errors"; |
| 141 | +static constexpr const char *descrMetricCicdSystemErrors = |
| 142 | + "The number of errors in a component of the CICD system (eg. controller, scheduler, agent)."; |
| 143 | +static constexpr const char *unitMetricCicdSystemErrors = "{error}"; |
| 144 | + |
| 145 | +static inline nostd::unique_ptr<metrics::Counter<uint64_t>> CreateSyncInt64MetricCicdSystemErrors( |
| 146 | + metrics::Meter *meter) |
| 147 | +{ |
| 148 | + return meter->CreateUInt64Counter(kMetricCicdSystemErrors, descrMetricCicdSystemErrors, |
| 149 | + unitMetricCicdSystemErrors); |
| 150 | +} |
| 151 | + |
| 152 | +static inline nostd::unique_ptr<metrics::Counter<double>> CreateSyncDoubleMetricCicdSystemErrors( |
| 153 | + metrics::Meter *meter) |
| 154 | +{ |
| 155 | + return meter->CreateDoubleCounter(kMetricCicdSystemErrors, descrMetricCicdSystemErrors, |
| 156 | + unitMetricCicdSystemErrors); |
| 157 | +} |
| 158 | + |
| 159 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 160 | +CreateAsyncInt64MetricCicdSystemErrors(metrics::Meter *meter) |
| 161 | +{ |
| 162 | + return meter->CreateInt64ObservableCounter(kMetricCicdSystemErrors, descrMetricCicdSystemErrors, |
| 163 | + unitMetricCicdSystemErrors); |
| 164 | +} |
| 165 | + |
| 166 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 167 | +CreateAsyncDoubleMetricCicdSystemErrors(metrics::Meter *meter) |
| 168 | +{ |
| 169 | + return meter->CreateDoubleObservableCounter(kMetricCicdSystemErrors, descrMetricCicdSystemErrors, |
| 170 | + unitMetricCicdSystemErrors); |
| 171 | +} |
| 172 | + |
| 173 | +/** |
| 174 | + * The number of workers on the CICD system by state. |
| 175 | + * <p> |
| 176 | + * updowncounter |
| 177 | + */ |
| 178 | +static constexpr const char *kMetricCicdWorkerCount = "cicd.worker.count"; |
| 179 | +static constexpr const char *descrMetricCicdWorkerCount = |
| 180 | + "The number of workers on the CICD system by state."; |
| 181 | +static constexpr const char *unitMetricCicdWorkerCount = "{count}"; |
| 182 | + |
| 183 | +static inline nostd::unique_ptr<metrics::UpDownCounter<int64_t>> |
| 184 | +CreateSyncInt64MetricCicdWorkerCount(metrics::Meter *meter) |
| 185 | +{ |
| 186 | + return meter->CreateInt64UpDownCounter(kMetricCicdWorkerCount, descrMetricCicdWorkerCount, |
| 187 | + unitMetricCicdWorkerCount); |
| 188 | +} |
| 189 | + |
| 190 | +static inline nostd::unique_ptr<metrics::UpDownCounter<double>> |
| 191 | +CreateSyncDoubleMetricCicdWorkerCount(metrics::Meter *meter) |
| 192 | +{ |
| 193 | + return meter->CreateDoubleUpDownCounter(kMetricCicdWorkerCount, descrMetricCicdWorkerCount, |
| 194 | + unitMetricCicdWorkerCount); |
| 195 | +} |
| 196 | + |
| 197 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 198 | +CreateAsyncInt64MetricCicdWorkerCount(metrics::Meter *meter) |
| 199 | +{ |
| 200 | + return meter->CreateInt64ObservableUpDownCounter( |
| 201 | + kMetricCicdWorkerCount, descrMetricCicdWorkerCount, unitMetricCicdWorkerCount); |
| 202 | +} |
| 203 | + |
| 204 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 205 | +CreateAsyncDoubleMetricCicdWorkerCount(metrics::Meter *meter) |
| 206 | +{ |
| 207 | + return meter->CreateDoubleObservableUpDownCounter( |
| 208 | + kMetricCicdWorkerCount, descrMetricCicdWorkerCount, unitMetricCicdWorkerCount); |
| 209 | +} |
| 210 | + |
| 211 | +} // namespace cicd |
| 212 | +} // namespace semconv |
| 213 | +OPENTELEMETRY_END_NAMESPACE |
0 commit comments