@@ -19,6 +19,7 @@ import (
19
19
const (
20
20
scopeName = "go.opentelemetry.io/collector/service/process_telemetry"
21
21
processNameKey = "process_name"
22
+ otelPrefix = "otelcol_"
22
23
)
23
24
24
25
// processMetrics is a struct that contains views related to process metrics (cpu, mem, etc)
@@ -93,7 +94,7 @@ func (pm *processMetrics) record(meter otelmetric.Meter) error {
93
94
var errs , err error
94
95
95
96
pm .otelProcessUptime , err = meter .Float64ObservableCounter (
96
- "process_uptime" ,
97
+ otelPrefix + "process_uptime" ,
97
98
otelmetric .WithDescription ("Uptime of the process" ),
98
99
otelmetric .WithUnit ("s" ),
99
100
otelmetric .WithFloat64Callback (func (_ context.Context , o otelmetric.Float64Observer ) error {
@@ -103,7 +104,7 @@ func (pm *processMetrics) record(meter otelmetric.Meter) error {
103
104
errs = multierr .Append (errs , err )
104
105
105
106
pm .otelAllocMem , err = meter .Int64ObservableGauge (
106
- "process_runtime_heap_alloc_bytes" ,
107
+ otelPrefix + "process_runtime_heap_alloc_bytes" ,
107
108
otelmetric .WithDescription ("Bytes of allocated heap objects (see 'go doc runtime.MemStats.HeapAlloc')" ),
108
109
otelmetric .WithUnit ("By" ),
109
110
otelmetric .WithInt64Callback (func (_ context.Context , o otelmetric.Int64Observer ) error {
@@ -113,7 +114,7 @@ func (pm *processMetrics) record(meter otelmetric.Meter) error {
113
114
errs = multierr .Append (errs , err )
114
115
115
116
pm .otelTotalAllocMem , err = meter .Int64ObservableCounter (
116
- "process_runtime_total_alloc_bytes" ,
117
+ otelPrefix + "process_runtime_total_alloc_bytes" ,
117
118
otelmetric .WithDescription ("Cumulative bytes allocated for heap objects (see 'go doc runtime.MemStats.TotalAlloc')" ),
118
119
otelmetric .WithUnit ("By" ),
119
120
otelmetric .WithInt64Callback (func (_ context.Context , o otelmetric.Int64Observer ) error {
@@ -123,7 +124,7 @@ func (pm *processMetrics) record(meter otelmetric.Meter) error {
123
124
errs = multierr .Append (errs , err )
124
125
125
126
pm .otelSysMem , err = meter .Int64ObservableGauge (
126
- "process_runtime_total_sys_memory_bytes" ,
127
+ otelPrefix + "process_runtime_total_sys_memory_bytes" ,
127
128
otelmetric .WithDescription ("Total bytes of memory obtained from the OS (see 'go doc runtime.MemStats.Sys')" ),
128
129
otelmetric .WithUnit ("By" ),
129
130
otelmetric .WithInt64Callback (func (_ context.Context , o otelmetric.Int64Observer ) error {
@@ -133,7 +134,7 @@ func (pm *processMetrics) record(meter otelmetric.Meter) error {
133
134
errs = multierr .Append (errs , err )
134
135
135
136
pm .otelCPUSeconds , err = meter .Float64ObservableCounter (
136
- "process_cpu_seconds" ,
137
+ otelPrefix + "process_cpu_seconds" ,
137
138
otelmetric .WithDescription ("Total CPU user and system time in seconds" ),
138
139
otelmetric .WithUnit ("s" ),
139
140
otelmetric .WithFloat64Callback (func (_ context.Context , o otelmetric.Float64Observer ) error {
@@ -143,7 +144,7 @@ func (pm *processMetrics) record(meter otelmetric.Meter) error {
143
144
errs = multierr .Append (errs , err )
144
145
145
146
pm .otelRSSMemory , err = meter .Int64ObservableGauge (
146
- "process_memory_rss" ,
147
+ otelPrefix + "process_memory_rss" ,
147
148
otelmetric .WithDescription ("Total physical memory (resident set size)" ),
148
149
otelmetric .WithUnit ("By" ),
149
150
otelmetric .WithInt64Callback (func (_ context.Context , o otelmetric.Int64Observer ) error {
0 commit comments