File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 88require "fluent/version"
99
1010require "json"
11+ require "socket"
1112
1213module 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 } ,
You can’t perform that action at this time.
0 commit comments