-
Notifications
You must be signed in to change notification settings - Fork 28
Support .NET auto instrumentation and Windows platforms #193
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
Conversation
|
||
cloudwatchAgentServiceEndpoint := "cloudwatch-agent.amazon-cloudwatch" | ||
if isWindowsPod { | ||
cloudwatchAgentServiceEndpoint = "cloudwatch-agent-windows-headless.amazon-cloudwatch.svc.cluster.local" |
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.
we need to use headless endpoint for windows nodes
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.
nitpick - worth adding a comment on why does the service endpoint differ for windows
args: args{ | ||
agentConfig: &adapters.CwaConfig{ | ||
Logs: &adapters.Logs{ | ||
LogMetricsCollected: &adapters.LogMetricsCollected{ | ||
AppSignals: &adapters.AppSignals{}, |
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.
AppSignals is not used anymore, it's safe to remove. I can have a follow-up PR to remove
|
||
defaultInst := &v1alpha1.Instrumentation{ |
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.
We don't need to test the Instrumentation object here, since it's covered in the getDefaultInstrumentation unit tests
@@ -68,6 +69,23 @@ func Test_getDefaultInstrumentation(t *testing.T) { | |||
{Name: "OTEL_LOGS_EXPORTER", Value: "none"}, | |||
}, | |||
}, | |||
DotNet: v1alpha1.DotNet{ |
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.
@vastin can you confirm these env variables?
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.
It is correct.
dotnetVolumeName = volumeName + "-dotnet" | ||
dotnetInitContainerName = initContainerName + "-dotnet" | ||
dotnetInstrMountPath = "/otel-auto-instrumentation-dotnet" | ||
) | ||
|
||
const ( |
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.
@vastin can you confirm these windows mount points too?
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.
Yes. It is confirmed.
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.
LGTM, just want to verify the auto annotation question and if the env vars are correct.
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.
LGTM
@@ -68,6 +69,23 @@ func Test_getDefaultInstrumentation(t *testing.T) { | |||
{Name: "OTEL_LOGS_EXPORTER", Value: "none"}, | |||
}, | |||
}, | |||
DotNet: v1alpha1.DotNet{ |
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.
It is correct.
dotnetVolumeName = volumeName + "-dotnet" | ||
dotnetInitContainerName = initContainerName + "-dotnet" | ||
dotnetInstrMountPath = "/otel-auto-instrumentation-dotnet" | ||
) | ||
|
||
const ( |
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.
Yes. It is confirmed.
dotNetStartupHookPathWindows = "C:\\otel-auto-instrumentation-dotnet\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll" | ||
dotnetInstrMountPathWindows = "\\otel-auto-instrumentation-dotnet" | ||
) | ||
|
||
// Supported .NET runtime identifiers (https://learn.microsoft.com/en-us/dotnet/core/rid-catalog), can be set by instrumentation.opentelemetry.io/inject-dotnet. | ||
const ( | ||
dotNetRuntimeLinuxGlibc = "linux-x64" | ||
dotNetRuntimeLinuxMusl = "linux-musl-x64" |
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.
Will CORECLR_PROFILER_PATH be set for "linux-musl-x64" like OTel Operator?
- name: CORECLR_PROFILER_PATH
value: /otel-auto-instrumentation-dotnet/linux-musl-x64/OpenTelemetry.AutoInstrumentation.Native.so
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.
Looks good!
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.
Might be out of scope of this PR but we should be updated the README when providing support for new languages
|
||
cloudwatchAgentServiceEndpoint := "cloudwatch-agent.amazon-cloudwatch" | ||
if isWindowsPod { | ||
cloudwatchAgentServiceEndpoint = "cloudwatch-agent-windows-headless.amazon-cloudwatch.svc.cluster.local" |
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.
nitpick - worth adding a comment on why does the service endpoint differ for windows
Issue #, if available: N/A
Description of changes:
public.ecr.aws/aws-observability/adot-autoinstrumentation-dotnet:v0.0.0
.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.