-
Notifications
You must be signed in to change notification settings - Fork 200
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
feat: NGINX Version #1462
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
60692ab
Added Version to NGINX
yodigos 4bda109
Separated Version with Inspect language
yodigos 22b7264
Separated Version with Inspect language
yodigos d2539ae
Separated Version with Inspect language
yodigos c5baba1
Separated Version with Inspect language
yodigos d1e8e4b
Separated Version with Inspect language
yodigos ee09906
Separated Version with Inspect language
yodigos 8aed758
Separated Version with Inspect language
yodigos 0585360
Merge branch 'main' into nginx_version
yodigos 0f7c956
PR Fix
yodigos bf6b7f3
PR Fix
yodigos 0653619
Merge branch 'main' into nginx_version
yodigos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
if err != nil || buildInfo == nil { | ||
return nil | ||
} | ||
match := re.FindStringSubmatch(buildInfo.GoVersion) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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