Skip to content

Commit ef6d1e0

Browse files
committed
WIP
1 parent 75fdc90 commit ef6d1e0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/fluent/plugin/in_opentelemetry_metrics.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
require "fluent/version"
99

1010
require "json"
11+
require "socket"
1112

1213
module Fluent::Plugin
1314
class OpentelemetryMetricsInput < Input
@@ -47,6 +48,7 @@ class Metrics
4748
def initialize(metric_name_prefix:)
4849
@start_time_unix_nano = Time.now.to_nano_sec
4950
@metric_name_prefix = metric_name_prefix.to_s
51+
@hostname = Socket.gethostname
5052
end
5153

5254
def metrics_data
@@ -57,6 +59,9 @@ def metrics_data
5759
"attributes" => [
5860
string_value_attribute("service.name", "fluentd"),
5961
string_value_attribute("service.version", Fluent::VERSION),
62+
string_value_attribute("host.name", @hostname),
63+
string_value_attribute("process.runtime.name", "ruby"),
64+
string_value_attribute("process.runtime.version", RUBY_VERSION),
6065
int_value_attribute("process.pid", Process.pid)
6166
]
6267
},

0 commit comments

Comments
 (0)