Skip to content

Commit 84a2d54

Browse files
Apm fusion ruby support (#360)
* update ruby version for apm mode
1 parent e60c976 commit 84a2d54

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

apm/connect.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@ func getAgentVersion(runtime string) (string, string, error) {
176176
} else if runtime == "dotnet" {
177177
layerAgentPaths = checks.LayerAgentPathDotnet
178178
agentVersionFile = "version.txt"
179-
}
179+
} else if runtime == "ruby" {
180+
layerAgentPaths = checks.LayerAgentPathRuby
181+
agentVersionFile = "version.txt"
182+
}
180183

181184

182185
for i := range layerAgentPaths {
@@ -193,6 +196,9 @@ func getAgentVersion(runtime string) (string, string, error) {
193196
if runtime == "python" {
194197
version = strings.TrimSpace(string(b))
195198
return "python", version, nil
199+
} else if runtime == "ruby" {
200+
version = strings.TrimSpace(string(b))
201+
return "ruby", version, nil
196202
} else if runtime == "dotnet" {
197203
version = strings.TrimSpace(string(b))
198204
return "dotnet", version, nil

checks/runtime_config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var (
1010
"/opt/python/lib/python3.13/site-packages/newrelic",
1111
}
1212
LayerAgentPathDotnet = []string{"/opt/lib/newrelic-dotnet-agent"}
13+
LayerAgentPathRuby = []string{"/opt/ruby"}
1314
LayerAgentPathsRuby = []string{
1415
"/opt/ruby/gems/3.2.0/gems/newrelic_rpm",
1516
"/opt/ruby/gems/3.3.0/gems/newrelic_rpm",

0 commit comments

Comments
 (0)