Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: NGINX Version #1462

Merged
merged 12 commits into from
Sep 1, 2024
1 change: 1 addition & 0 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (

require (
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/sync v0.7.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
Expand Down
1 change: 1 addition & 0 deletions autoscaler/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down
2 changes: 2 additions & 0 deletions autoscaler/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
Expand Down
2 changes: 2 additions & 0 deletions cli/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ func otelSdkConfigCommunity() map[common.ProgrammingLanguage]common.OtelSdk {
common.GoProgrammingLanguage: common.OtelSdkEbpfCommunity,
common.DotNetProgrammingLanguage: common.OtelSdkNativeCommunity,
common.JavascriptProgrammingLanguage: common.OtelSdkNativeCommunity,
common.NginxProgrammingLanguage: common.OtelSdkNativeCommunity,
}
}

Expand All @@ -194,6 +195,7 @@ func otelSdkConfigCloud() map[common.ProgrammingLanguage]common.OtelSdk {
common.GoProgrammingLanguage: common.OtelSdkEbpfEnterprise,
common.DotNetProgrammingLanguage: common.OtelSdkNativeCommunity,
common.JavascriptProgrammingLanguage: common.OtelSdkNativeCommunity,
common.NginxProgrammingLanguage: common.OtelSdkNativeCommunity,
}
}

Expand Down
2 changes: 2 additions & 0 deletions common/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.10.0 // indirect
github.com/go-logr/logr v1.4.1
github.com/hashicorp/go-version v1.7.0
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect

)
2 changes: 2 additions & 0 deletions common/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ github.com/goccy/go-yaml v1.11.3 h1:B3W9IdWbvrUu2OYQGwvU1nZtvMQJPBKgBUuweJjLj6I=
github.com/goccy/go-yaml v1.11.3/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
Expand Down
12 changes: 11 additions & 1 deletion common/lang_detection.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package common

import "github.com/hashicorp/go-version"

type ProgramLanguageDetails struct {
Language ProgrammingLanguage
RuntimeVersion string
RuntimeVersion *version.Version
}

// +kubebuilder:validation:Enum=java;python;go;dotnet;javascript;mysql;nginx;unknown;ignored
Expand All @@ -23,3 +25,11 @@ const (
// Ignored is used when the odigos is configured to ignore the process/container
IgnoredProgrammingLanguage ProgrammingLanguage = "ignored"
)

func GetVersion(versionString string) *version.Version {
runtimeVersion, err := version.NewVersion(versionString)
if err != nil {
return nil
}
return runtimeVersion
}
1 change: 1 addition & 0 deletions destinations/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (

require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/kr/text v0.2.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions destinations/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand Down
1 change: 1 addition & 0 deletions instrumentor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ require (
github.com/go-logr/stdr v1.2.2 // indirect
github.com/goccy/go-yaml v1.11.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/nxadm/tail v1.4.8 // indirect
Expand Down
2 changes: 2 additions & 0 deletions instrumentor/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
Expand Down
1 change: 1 addition & 0 deletions k8sutils/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ require (
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
Expand Down
2 changes: 2 additions & 0 deletions k8sutils/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
Expand Down
3 changes: 3 additions & 0 deletions odiglet/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ func startDeviceManager(clientset *kubernetes.Clientset) {
common.DotNetProgrammingLanguage: {
common.OtelSdkNativeCommunity: instrumentlang.DotNet,
},
common.NginxProgrammingLanguage: {
common.OtelSdkNativeCommunity: instrumentlang.Nginx,
},
}

lister, err := instrumentation.NewLister(ctx, clientset, otelSdkLsf)
Expand Down
10 changes: 10 additions & 0 deletions odiglet/pkg/instrumentation/instrumentlang/nginx.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package instrumentlang

import (
"github.com/odigos-io/odigos/common"
"k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"
)

func Nginx(deviceId string, uniqueDestinationSignals map[common.ObservabilitySignal]struct{}) *v1beta1.ContainerAllocateResponse {
return &v1beta1.ContainerAllocateResponse{}
}
10 changes: 8 additions & 2 deletions odiglet/pkg/kube/runtime_details/inspection.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ func runtimeInspection(pods []corev1.Pod, ignoredContainers []string) ([]odigosv
var detectErr error

for _, proc := range processes {
programLanguageDetails, detectErr = inspectors.DetectLanguage(proc)
containerURL := kubeutils.GetPodExternalURL(pod.Status.PodIP, container.Ports)
programLanguageDetails, detectErr = inspectors.DetectLanguage(proc, containerURL)
if detectErr == nil && programLanguageDetails.Language != common.UnknownProgrammingLanguage {
inspectProc = &proc
break
Expand All @@ -119,10 +120,15 @@ func runtimeInspection(pods []corev1.Pod, ignoredContainers []string) ([]odigosv
}
}

var runtimeVersion string
if programLanguageDetails.RuntimeVersion != nil {
runtimeVersion = programLanguageDetails.RuntimeVersion.String()
}

resultsMap[container.Name] = odigosv1.RuntimeDetailsByContainer{
ContainerName: container.Name,
Language: programLanguageDetails.Language,
RuntimeVersion: programLanguageDetails.RuntimeVersion,
RuntimeVersion: runtimeVersion,
EnvVars: envs,
}
}
Expand Down
9 changes: 9 additions & 0 deletions odiglet/pkg/kube/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package utils

import (
"context"
"fmt"

"github.com/odigos-io/odigos/k8sutils/pkg/workload"
"github.com/odigos-io/odigos/odiglet/pkg/env"
Expand Down Expand Up @@ -50,3 +51,11 @@ func GetResourceAttributes(podWorkload *workload.PodWorkload, podName string) []

return attrs
}

func GetPodExternalURL(ip string, ports []corev1.ContainerPort) string {
if ports != nil && len(ports) > 0 {
return fmt.Sprintf("http://%s:%d", ip, ports[0].ContainerPort)
}

return ""
}
5 changes: 4 additions & 1 deletion procdiscovery/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ module github.com/odigos-io/odigos/procdiscovery

go 1.22.0

require github.com/odigos-io/odigos/common v1.0.48
require (
github.com/hashicorp/go-version v1.7.0
github.com/odigos-io/odigos/common v1.0.48
)

require (
github.com/go-logr/logr v1.4.1 // indirect
Expand Down
2 changes: 2 additions & 0 deletions procdiscovery/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
Expand Down
8 changes: 3 additions & 5 deletions procdiscovery/pkg/inspectors/dotnet/dotnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ const (
dotnet = "DOTNET"
)

func (d *DotnetInspector) Inspect(p *process.Details) (common.ProgramLanguageDetails, bool) {
var programLanguageDetails common.ProgramLanguageDetails
func (d *DotnetInspector) Inspect(p *process.Details) (common.ProgrammingLanguage, bool) {
data, err := os.ReadFile(fmt.Sprintf("/proc/%d/environ", p.ProcessID))
if err == nil {
environ := string(data)
if strings.Contains(environ, aspnet) || strings.Contains(environ, dotnet) {
programLanguageDetails.Language = common.DotNetProgrammingLanguage
return programLanguageDetails, true
return common.DotNetProgrammingLanguage, true
}
}

return programLanguageDetails, false
return "", false
}
29 changes: 20 additions & 9 deletions procdiscovery/pkg/inspectors/golang/golang.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,36 @@ package golang
import (
"debug/buildinfo"
"fmt"

"github.com/hashicorp/go-version"
"github.com/odigos-io/odigos/common"
"github.com/odigos-io/odigos/procdiscovery/pkg/process"
"regexp"
)

type GolangInspector struct{}

func (g *GolangInspector) Inspect(p *process.Details) (common.ProgramLanguageDetails, bool) {
var programLanguageDetails common.ProgramLanguageDetails
const GolangVersionRegex = `go(\d+\.\d+\.\d+)`

var re = regexp.MustCompile(GolangVersionRegex)

func (g *GolangInspector) Inspect(p *process.Details) (common.ProgrammingLanguage, bool) {
file := fmt.Sprintf("/proc/%d/exe", p.ProcessID)
buildInfo, err := buildinfo.ReadFile(file)
_, err := buildinfo.ReadFile(file)
if err != nil {
return programLanguageDetails, false
return "", false
}

programLanguageDetails.Language = common.GoProgrammingLanguage
if buildInfo != nil {
programLanguageDetails.RuntimeVersion = buildInfo.GoVersion
return common.GoProgrammingLanguage, true
}

func (g *GolangInspector) GetRuntimeVersion(p *process.Details, containerURL string) *version.Version {
file := fmt.Sprintf("/proc/%d/exe", p.ProcessID)
buildInfo, err := buildinfo.ReadFile(file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We are calling ReadFile twice for each Go process, if it is possible to reuse the buildInfo from the Inspect function it will be better

if err != nil || buildInfo == nil {
return nil
}
match := re.FindStringSubmatch(buildInfo.GoVersion)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we need this regex here. The buildinfo package is an official go package which should provide a valid go version if one exists.


return common.GetVersion(match[1])

return programLanguageDetails, true
}
23 changes: 15 additions & 8 deletions procdiscovery/pkg/inspectors/java/java.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package java

import (
"github.com/hashicorp/go-version"
"regexp"
"strings"

"github.com/odigos-io/odigos/common"
Expand All @@ -10,18 +12,23 @@ import (
type JavaInspector struct{}

const processName = "java"
const JavaVersionRegex = `\d+\.\d+\.\d+\+\d+`

func (j *JavaInspector) Inspect(proc *process.Details) (common.ProgramLanguageDetails, bool) {
var programLanguageDetails common.ProgramLanguageDetails
var re = regexp.MustCompile(JavaVersionRegex)

func (j *JavaInspector) Inspect(proc *process.Details) (common.ProgrammingLanguage, bool) {
if strings.Contains(proc.ExeName, processName) || strings.Contains(proc.CmdLine, processName) {
programLanguageDetails.Language = common.JavaProgrammingLanguage
if value, exists := proc.GetDetailedEnvsValue(process.JavaVersionConst); exists {
programLanguageDetails.RuntimeVersion = value
}
return common.JavaProgrammingLanguage, true
}

return "", false
}

return programLanguageDetails, true
func (j *JavaInspector) GetRuntimeVersion(proc *process.Details, containerURL string) *version.Version {
if value, exists := proc.GetDetailedEnvsValue(process.JavaVersionConst); exists {
javaVersion := re.FindString(value)
return common.GetVersion(javaVersion)
}

return programLanguageDetails, false
return nil
}
Loading
Loading