Skip to content

Commit

Permalink
Fixed gauges.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff committed Nov 12, 2024
1 parent 1077265 commit d125af2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ static constexpr const char *unitMetricProcessCpuUtilization = "1";

#if OPENTELEMETRY_ABI_VERSION_NO >= 2

static inline nostd::unique_ptr<metrics::Gauge<uint64_t>>
CreateSyncInt64MetricProcessCpuUtilization(metrics::Meter *meter)
static inline nostd::unique_ptr<metrics::Gauge<int64_t>> CreateSyncInt64MetricProcessCpuUtilization(
metrics::Meter *meter)
{
return meter->CreateUInt64Gauge(kMetricProcessCpuUtilization, descrMetricProcessCpuUtilization,
unitMetricProcessCpuUtilization);
return meter->CreateInt64Gauge(kMetricProcessCpuUtilization, descrMetricProcessCpuUtilization,
unitMetricProcessCpuUtilization);
}

static inline nostd::unique_ptr<metrics::Gauge<double>> CreateSyncDoubleMetricProcessCpuUtilization(
Expand Down
34 changes: 16 additions & 18 deletions api/include/opentelemetry/semconv/incubating/system_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ static constexpr const char *unitMetricSystemCpuFrequency = "{Hz}";

#if OPENTELEMETRY_ABI_VERSION_NO >= 2

static inline nostd::unique_ptr<metrics::Gauge<uint64_t>> CreateSyncInt64MetricSystemCpuFrequency(
static inline nostd::unique_ptr<metrics::Gauge<int64_t>> CreateSyncInt64MetricSystemCpuFrequency(
metrics::Meter *meter)
{
return meter->CreateUInt64Gauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency,
unitMetricSystemCpuFrequency);
return meter->CreateInt64Gauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency,
unitMetricSystemCpuFrequency);
}

static inline nostd::unique_ptr<metrics::Gauge<double>> CreateSyncDoubleMetricSystemCpuFrequency(
Expand Down Expand Up @@ -195,11 +195,11 @@ static constexpr const char *unitMetricSystemCpuUtilization = "1";

#if OPENTELEMETRY_ABI_VERSION_NO >= 2

static inline nostd::unique_ptr<metrics::Gauge<uint64_t>> CreateSyncInt64MetricSystemCpuUtilization(
static inline nostd::unique_ptr<metrics::Gauge<int64_t>> CreateSyncInt64MetricSystemCpuUtilization(
metrics::Meter *meter)
{
return meter->CreateUInt64Gauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization,
unitMetricSystemCpuUtilization);
return meter->CreateInt64Gauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization,
unitMetricSystemCpuUtilization);
}

static inline nostd::unique_ptr<metrics::Gauge<double>> CreateSyncDoubleMetricSystemCpuUtilization(
Expand Down Expand Up @@ -471,12 +471,12 @@ static constexpr const char *unitMetricSystemFilesystemUtilization = "1";

#if OPENTELEMETRY_ABI_VERSION_NO >= 2

static inline nostd::unique_ptr<metrics::Gauge<uint64_t>>
static inline nostd::unique_ptr<metrics::Gauge<int64_t>>
CreateSyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter)
{
return meter->CreateUInt64Gauge(kMetricSystemFilesystemUtilization,
descrMetricSystemFilesystemUtilization,
unitMetricSystemFilesystemUtilization);
return meter->CreateInt64Gauge(kMetricSystemFilesystemUtilization,
descrMetricSystemFilesystemUtilization,
unitMetricSystemFilesystemUtilization);
}

static inline nostd::unique_ptr<metrics::Gauge<double>>
Expand Down Expand Up @@ -729,12 +729,11 @@ static constexpr const char *unitMetricSystemMemoryUtilization = "1";

#if OPENTELEMETRY_ABI_VERSION_NO >= 2

static inline nostd::unique_ptr<metrics::Gauge<uint64_t>>
static inline nostd::unique_ptr<metrics::Gauge<int64_t>>
CreateSyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter)
{
return meter->CreateUInt64Gauge(kMetricSystemMemoryUtilization,
descrMetricSystemMemoryUtilization,
unitMetricSystemMemoryUtilization);
return meter->CreateInt64Gauge(kMetricSystemMemoryUtilization, descrMetricSystemMemoryUtilization,
unitMetricSystemMemoryUtilization);
}

static inline nostd::unique_ptr<metrics::Gauge<double>>
Expand Down Expand Up @@ -1088,12 +1087,11 @@ static constexpr const char *unitMetricSystemPagingUtilization = "1";

#if OPENTELEMETRY_ABI_VERSION_NO >= 2

static inline nostd::unique_ptr<metrics::Gauge<uint64_t>>
static inline nostd::unique_ptr<metrics::Gauge<int64_t>>
CreateSyncInt64MetricSystemPagingUtilization(metrics::Meter *meter)
{
return meter->CreateUInt64Gauge(kMetricSystemPagingUtilization,
descrMetricSystemPagingUtilization,
unitMetricSystemPagingUtilization);
return meter->CreateInt64Gauge(kMetricSystemPagingUtilization, descrMetricSystemPagingUtilization,
unitMetricSystemPagingUtilization);
}

static inline nostd::unique_ptr<metrics::Gauge<double>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ text_maps:
counter: metrics::Counter<uint64_t>
histogram: metrics::Histogram<uint64_t>
updowncounter: metrics::UpDownCounter<int64_t>
gauge: metrics::Gauge<uint64_t>
gauge: metrics::Gauge<int64_t>

cpp_sync_instrument_to_double_type:
counter: metrics::Counter<double>
Expand All @@ -96,7 +96,7 @@ text_maps:
counter: CreateUInt64Counter
histogram: CreateUInt64Histogram
updowncounter: CreateInt64UpDownCounter
gauge: CreateUInt64Gauge
gauge: CreateInt64Gauge

cpp_sync_instrument_to_double_factory:
counter: CreateDoubleCounter
Expand Down

0 comments on commit d125af2

Please sign in to comment.