Skip to content

Add tests for dotnet default instrumentation (#168) #195

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

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 32 additions & 7 deletions .github/workflows/operator-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,41 @@ jobs:
go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json
kubectl delete instrumentation sample-instrumentation

- name: Test for default instrumentation resources for python and java
- name: Test for default instrumentation resources for dotnet
run: |
kubectl apply -f integration-tests/python-java/sample-deployment-python-java.yaml
kubectl delete pods --all -n default
kubectl apply -f integration-tests/dotnet/sample-deployment-dotnet.yaml
sleep 5
kubectl wait --for=condition=Ready pod --all -n default

go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java/default_instrumentation_python-java_env_variables.json
kubectl rollout restart deployment nginx
kubectl wait --for=condition=Available deployment/nginx -n default
kubectl get pods -A
kubectl describe pods -n default
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/dotnet/default_instrumentation_dotnet_env_variables.json

- name: Test for defined instrumentation resources for dotnet
run: |
kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml
sleep 5
kubectl rollout restart deployment nginx
kubectl wait --for=condition=Available deployment/nginx -n default
kubectl describe pods -n default
cd integration-tests/manifests/cmd
go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json
kubectl delete instrumentation sample-instrumentation

- name: Test for default instrumentation resources for python java dotnet
run: |
kubectl apply -f integration-tests/python-java-dotnet/sample-deployment-python-java-dotnet.yaml
sleep 5
kubectl rollout restart deployment nginx
kubectl wait --for=condition=Available deployment/nginx -n default
sleep 5
kubectl get pods -A
kubectl describe pods -n default
kubectl describe pods -n amazon-cloudwatch
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java-dotnet/default_instrumentation_python-java-dotnet_env_variables.json


- name: Test for defined instrumentation resources for python and java
- name: Test for defined instrumentation resources for python java dotnet
run: |
kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml
kubectl delete pods --all -n default
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ ARG VERSION_DATE
ARG AGENT_VERSION
ARG AUTO_INSTRUMENTATION_JAVA_VERSION
ARG AUTO_INSTRUMENTATION_PYTHON_VERSION
ARG AUTO_INSTRUMENTATION_DOTNET_VERSION
ARG DCMG_EXPORTER_VERSION
ARG NEURON_MONITOR_VERSION

# Build
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -ldflags="-X ${VERSION_PKG}.version=${VERSION} -X ${VERSION_PKG}.buildDate=${VERSION_DATE} -X ${VERSION_PKG}.agent=${AGENT_VERSION} -X ${VERSION_PKG}.autoInstrumentationJava=${AUTO_INSTRUMENTATION_JAVA_VERSION} -X ${VERSION_PKG}.autoInstrumentationPython=${AUTO_INSTRUMENTATION_PYTHON_VERSION} -X ${VERSION_PKG}.dcgmExporter=${DCMG_EXPORTER_VERSION} -X ${VERSION_PKG}.neuronMonitor=${NEURON_MONITOR_VERSION}" -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -ldflags="-X ${VERSION_PKG}.version=${VERSION} -X ${VERSION_PKG}.buildDate=${VERSION_DATE} -X ${VERSION_PKG}.agent=${AGENT_VERSION} -X ${VERSION_PKG}.autoInstrumentationJava=${AUTO_INSTRUMENTATION_JAVA_VERSION} -X ${VERSION_PKG}.autoInstrumentationPython=${AUTO_INSTRUMENTATION_PYTHON_VERSION} -X ${VERSION_PKG}.autoInstrumentationDotNet=${AUTO_INSTRUMENTATION_DOTNET_VERSION} -X ${VERSION_PKG}.dcgmExporter=${DCMG_EXPORTER_VERSION} -X ${VERSION_PKG}.neuronMonitor=${NEURON_MONITOR_VERSION}" -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ VERSION_PKG ?= "github.com/aws/amazon-cloudwatch-agent-operator/internal/version
AGENT_VERSION ?= "$(shell grep -v '\#' versions.txt | grep cloudwatch-agent | awk -F= '{print $$2}')"
AUTO_INSTRUMENTATION_JAVA_VERSION ?= "$(shell grep -v '\#' versions.txt | grep aws-otel-java-instrumentation | awk -F= '{print $$2}')"
AUTO_INSTRUMENTATION_PYTHON_VERSION ?= "$(shell grep -v '\#' versions.txt | grep aws-otel-python-instrumentation | awk -F= '{print $$2}')"
AUTO_INSTRUMENTATION_DOTNET_VERSION ?= "$(shell grep -v '\#' versions.txt | grep aws-otel-dotnet-instrumentation | awk -F= '{print $$2}')"
DCGM_EXPORTER_VERSION ?= "$(shell grep -v '\#' versions.txt | grep dcgm-exporter | awk -F= '{print $$2}')"
NEURON_MONITOR_VERSION ?= "$(shell grep -v '\#' versions.txt | grep neuron-monitor | awk -F= '{print $$2}')"

Expand Down Expand Up @@ -153,7 +154,7 @@ generate: controller-gen api-docs
# buildx is used to ensure same results for arm based systems (m1/2 chips)
.PHONY: container
container:
docker buildx build --load --platform linux/${ARCH} -t ${IMG} --build-arg VERSION_PKG=${VERSION_PKG} --build-arg VERSION=${VERSION} --build-arg VERSION_DATE=${VERSION_DATE} --build-arg AGENT_VERSION=${AGENT_VERSION} --build-arg AUTO_INSTRUMENTATION_JAVA_VERSION=${AUTO_INSTRUMENTATION_JAVA_VERSION} --build-arg AUTO_INSTRUMENTATION_PYTHON_VERSION=${AUTO_INSTRUMENTATION_PYTHON_VERSION} --build-arg DCGM_EXPORTER_VERSION=${DCGM_EXPORTER_VERSION} --build-arg NEURON_MONITOR_VERSION=${NEURON_MONITOR_VERSION} .
docker buildx build --load --platform linux/${ARCH} -t ${IMG} --build-arg VERSION_PKG=${VERSION_PKG} --build-arg VERSION=${VERSION} --build-arg VERSION_DATE=${VERSION_DATE} --build-arg AGENT_VERSION=${AGENT_VERSION} --build-arg AUTO_INSTRUMENTATION_JAVA_VERSION=${AUTO_INSTRUMENTATION_JAVA_VERSION} --build-arg AUTO_INSTRUMENTATION_PYTHON_VERSION=${AUTO_INSTRUMENTATION_PYTHON_VERSION} --build-arg AUTO_INSTRUMENTATION_DOTNET_VERSION=${AUTO_INSTRUMENTATION_DOTNET_VERSION} --build-arg DCGM_EXPORTER_VERSION=${DCGM_EXPORTER_VERSION} --build-arg NEURON_MONITOR_VERSION=${NEURON_MONITOR_VERSION} .

# Push the container image, used only for local dev purposes
.PHONY: container-push
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"OTEL_AWS_APP_SIGNALS_ENABLED": "true",
"OTEL_TRACES_SAMPLER_ARG": "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000",
"OTEL_TRACES_SAMPLER" : "xray",
"OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
"OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces",
"OTEL_METRICS_EXPORTER": "none",
"OTEL_DOTNET_DISTRO": "aws_distro",
"OTEL_LOGS_EXPORTER": "none"
}
22 changes: 22 additions & 0 deletions integration-tests/dotnet/sample-deployment-dotnet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
annotations:
instrumentation.opentelemetry.io/inject-dotnet: "true"
spec:
containers:
- name: nginx
image: nginx:1.14.2
restartPolicy: Always
status: {}


Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"OTEL_METRICS_EXPORTER": "none",
"OTEL_PYTHON_DISTRO": "aws_distro",
"OTEL_PYTHON_CONFIGURATOR": "aws_configurator",
"OTEL_SMP_ENABLED": "true",
"OTEL_AWS_SMP_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/metrics",
"OTEL_DOTNET_DISTRO": "aws_distro",
"OTEL_LOGS_EXPORTER": "none",
"OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/metrics",
"JAVA_TOOL_OPTIONS": "-javaagent:/otel-auto-instrumentation-java/javaagent.jar"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
annotations:
instrumentation.opentelemetry.io/inject-python: "true"
instrumentation.opentelemetry.io/inject-java: "true"
instrumentation.opentelemetry.io/inject-dotnet: "true"
spec:
containers:
- name: nginx
Expand Down
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const (
cloudwatchAgentImageRepository = "public.ecr.aws/cloudwatch-agent/cloudwatch-agent"
autoInstrumentationJavaImageRepository = "public.ecr.aws/aws-observability/adot-autoinstrumentation-java"
autoInstrumentationPythonImageRepository = "public.ecr.aws/aws-observability/adot-autoinstrumentation-python"
autoInstrumentationDotNetImageRepository = "ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-dotnet"
dcgmExporterImageRepository = "nvcr.io/nvidia/k8s/dcgm-exporter"
neuronMonitorImageRepository = "public.ecr.aws/neuron"
)
Expand Down Expand Up @@ -98,6 +99,7 @@ func main() {
agentImage string
autoInstrumentationJava string
autoInstrumentationPython string
autoInstrumentationDotNet string
autoAnnotationConfigStr string
webhookPort int
tlsOpt tlsConfig
Expand All @@ -111,14 +113,16 @@ func main() {
stringFlagOrEnv(&agentImage, "agent-image", "RELATED_IMAGE_COLLECTOR", fmt.Sprintf("%s:%s", cloudwatchAgentImageRepository, v.AmazonCloudWatchAgent), "The default CloudWatch Agent image. This image is used when no image is specified in the CustomResource.")
stringFlagOrEnv(&autoInstrumentationJava, "auto-instrumentation-java-image", "RELATED_IMAGE_AUTO_INSTRUMENTATION_JAVA", fmt.Sprintf("%s:%s", autoInstrumentationJavaImageRepository, v.AutoInstrumentationJava), "The default OpenTelemetry Java instrumentation image. This image is used when no image is specified in the CustomResource.")
stringFlagOrEnv(&autoInstrumentationPython, "auto-instrumentation-python-image", "RELATED_IMAGE_AUTO_INSTRUMENTATION_PYTHON", fmt.Sprintf("%s:%s", autoInstrumentationPythonImageRepository, v.AutoInstrumentationPython), "The default OpenTelemetry Python instrumentation image. This image is used when no image is specified in the CustomResource.")
stringFlagOrEnv(&autoInstrumentationDotNet, "auto-instrumentation-dotnet-image", "RELATED_IMAGE_AUTO_INSTRUMENTATION_DOTNET", fmt.Sprintf("%s:%s", autoInstrumentationDotNetImageRepository, v.AutoInstrumentationDotNet), "The default OpenTelemetry Dotnet instrumentation image. This image is used when no image is specified in the CustomResource.")
stringFlagOrEnv(&autoAnnotationConfigStr, "auto-annotation-config", "AUTO_ANNOTATION_CONFIG", "", "The configuration for auto-annotation.")
stringFlagOrEnv(&dcgmExporterImage, "dcgm-exporter-image", "RELATED_IMAGE_DCGM_EXPORTER", fmt.Sprintf("%s:%s", dcgmExporterImageRepository, v.DcgmExporter), "The default DCGM Exporter image. This image is used when no image is specified in the CustomResource.")
stringFlagOrEnv(&neuronMonitorImage, "neuron-monitor-image", "RELATED_IMAGE_NEURON_MONITOR", fmt.Sprintf("%s:%s", neuronMonitorImageRepository, v.NeuronMonitor), "The default Neuron monitor image. This image is used when no image is specified in the CustomResource.")
pflag.Parse()

// set java instrumentation java image in environment variable to be used for default instrumentation
// set supported language instrumentation images in environment variable to be used for default instrumentation
os.Setenv("AUTO_INSTRUMENTATION_JAVA", autoInstrumentationJava)
os.Setenv("AUTO_INSTRUMENTATION_PYTHON", autoInstrumentationPython)
os.Setenv("AUTO_INSTRUMENTATION_DOTNET", autoInstrumentationDotNet)

logger := zap.New(zap.UseFlagOptions(&opts))
ctrl.SetLogger(logger)
Expand All @@ -128,6 +132,7 @@ func main() {
"cloudwatch-agent", agentImage,
"auto-instrumentation-java", autoInstrumentationJava,
"auto-instrumentation-python", autoInstrumentationPython,
"auto-instrumentation-dotnet", autoInstrumentationDotNet,
"dcgm-exporter", dcgmExporterImage,
"neuron-monitor", neuronMonitorImage,
"build-date", v.BuildDate,
Expand All @@ -142,6 +147,7 @@ func main() {
config.WithCollectorImage(agentImage),
config.WithAutoInstrumentationJavaImage(autoInstrumentationJava),
config.WithAutoInstrumentationPythonImage(autoInstrumentationPython),
config.WithAutoInstrumentationDotNetImage(autoInstrumentationDotNet),
config.WithDcgmExporterImage(dcgmExporterImage),
config.WithNeuronMonitorImage(neuronMonitorImage),
)
Expand Down
3 changes: 3 additions & 0 deletions pkg/instrumentation/auto/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import "github.com/aws/amazon-cloudwatch-agent-operator/pkg/instrumentation"
type AnnotationConfig struct {
Java AnnotationResources `json:"java"`
Python AnnotationResources `json:"python"`
DotNet AnnotationResources `json:"dotnet"`
}

func (c AnnotationConfig) getResources(instType instrumentation.Type) AnnotationResources {
Expand All @@ -18,6 +19,8 @@ func (c AnnotationConfig) getResources(instType instrumentation.Type) Annotation
return c.Java
case instrumentation.TypePython:
return c.Python
case instrumentation.TypeDotNet:
return c.DotNet
default:
return AnnotationResources{}
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/instrumentation/auto/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,21 @@ func TestConfig(t *testing.T) {
DaemonSets: []string{"ds2"},
StatefulSets: []string{"ss2"},
},
DotNet: AnnotationResources{
Namespaces: []string{"n3"},
Deployments: []string{"d3"},
DaemonSets: []string{"ds3"},
StatefulSets: []string{"ss3"},
},
}
assert.Equal(t, cfg.Java, cfg.getResources(instrumentation.TypeJava))
assert.Equal(t, []string{"n1"}, getNamespaces(cfg.Java))
assert.Equal(t, []string{"d1"}, getDeployments(cfg.Java))
assert.Equal(t, cfg.Python, cfg.getResources(instrumentation.TypePython))
assert.Equal(t, []string{"ds2"}, getDaemonSets(cfg.Python))
assert.Equal(t, []string{"ss2"}, getStatefulSets(cfg.Python))
assert.Equal(t, cfg.DotNet, cfg.getResources(instrumentation.TypeDotNet))
assert.Equal(t, []string{"ds3"}, getDaemonSets(cfg.DotNet))
assert.Equal(t, []string{"ss3"}, getStatefulSets(cfg.DotNet))
assert.Equal(t, AnnotationResources{}, cfg.getResources("invalidType"))
}
20 changes: 20 additions & 0 deletions pkg/instrumentation/defaultinstrumentation.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func getDefaultInstrumentation(agentConfig *adapters.CwaConfig) (*v1alpha1.Instr
if !ok {
return nil, errors.New("unable to determine python instrumentation image")
}
dotNetInstrumentationImage, ok := os.LookupEnv("AUTO_INSTRUMENTATION_DOTNET")
if !ok {
return nil, errors.New("unable to determine dotnet instrumentation image")
}

// set protocol by checking cloudwatch agent config for tls setting
exporterPrefix := httpPrefix
Expand Down Expand Up @@ -92,6 +96,22 @@ func getDefaultInstrumentation(agentConfig *adapters.CwaConfig) (*v1alpha1.Instr
{Name: "OTEL_LOGS_EXPORTER", Value: "none"},
},
},
// temporary environment variables. Need to be updated with the latest values
DotNet: v1alpha1.DotNet{
Image: dotNetInstrumentationImage,
Env: []corev1.EnvVar{
{Name: "OTEL_AWS_APP_SIGNALS_ENABLED", Value: "true"},
{Name: "OTEL_TRACES_SAMPLER_ARG", Value: "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000"},
{Name: "OTEL_TRACES_SAMPLER", Value: "xray"},
{Name: "OTEL_EXPORTER_OTLP_PROTOCOL", Value: "http/protobuf"},
{Name: "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT", Value: exporterPrefix + "cloudwatch-agent.amazon-cloudwatch:4316/v1/traces"},
{Name: "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT", Value: exporterPrefix + "cloudwatch-agent.amazon-cloudwatch:4316/v1/metrics"},
{Name: "OTEL_METRICS_EXPORTER", Value: "none"},
{Name: "OTEL_DOTNET_DISTRO", Value: "aws_distro"},
{Name: "OTEL_DOTNET_CONFIGURATOR", Value: "aws_configurator"},
{Name: "OTEL_LOGS_EXPORTER", Value: "none"},
},
},
},
}, nil
}
33 changes: 33 additions & 0 deletions pkg/instrumentation/defaultinstrumentation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
func Test_getDefaultInstrumentation(t *testing.T) {
os.Setenv("AUTO_INSTRUMENTATION_JAVA", defaultJavaInstrumentationImage)
os.Setenv("AUTO_INSTRUMENTATION_PYTHON", defaultPythonInstrumentationImage)
os.Setenv("AUTO_INSTRUMENTATION_DOTNET", defaultDotNetInstrumentationImage)

httpInst := &v1alpha1.Instrumentation{
Status: v1alpha1.InstrumentationStatus{},
Expand Down Expand Up @@ -68,6 +69,22 @@ func Test_getDefaultInstrumentation(t *testing.T) {
{Name: "OTEL_LOGS_EXPORTER", Value: "none"},
},
},
// temporary environment variables. Need to be updated with the latest values
DotNet: v1alpha1.DotNet{
Image: defaultDotNetInstrumentationImage,
Env: []corev1.EnvVar{
{Name: "OTEL_AWS_APP_SIGNALS_ENABLED", Value: "true"},
{Name: "OTEL_TRACES_SAMPLER_ARG", Value: "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000"},
{Name: "OTEL_TRACES_SAMPLER", Value: "xray"},
{Name: "OTEL_EXPORTER_OTLP_PROTOCOL", Value: "http/protobuf"},
{Name: "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT", Value: "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces"},
{Name: "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT", Value: "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/metrics"},
{Name: "OTEL_METRICS_EXPORTER", Value: "none"},
{Name: "OTEL_DOTNET_DISTRO", Value: "aws_distro"},
{Name: "OTEL_DOTNET_CONFIGURATOR", Value: "aws_configurator"},
{Name: "OTEL_LOGS_EXPORTER", Value: "none"},
},
},
},
}
httpsInst := &v1alpha1.Instrumentation{
Expand Down Expand Up @@ -119,6 +136,22 @@ func Test_getDefaultInstrumentation(t *testing.T) {
{Name: "OTEL_LOGS_EXPORTER", Value: "none"},
},
},
// temporary environment variables. Need to be updated with the latest values
DotNet: v1alpha1.DotNet{
Image: defaultDotNetInstrumentationImage,
Env: []corev1.EnvVar{
{Name: "OTEL_AWS_APP_SIGNALS_ENABLED", Value: "true"},
{Name: "OTEL_TRACES_SAMPLER_ARG", Value: "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000"},
{Name: "OTEL_TRACES_SAMPLER", Value: "xray"},
{Name: "OTEL_EXPORTER_OTLP_PROTOCOL", Value: "http/protobuf"},
{Name: "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT", Value: "https://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces"},
{Name: "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT", Value: "https://cloudwatch-agent.amazon-cloudwatch:4316/v1/metrics"},
{Name: "OTEL_METRICS_EXPORTER", Value: "none"},
{Name: "OTEL_DOTNET_DISTRO", Value: "aws_distro"},
{Name: "OTEL_DOTNET_CONFIGURATOR", Value: "aws_configurator"},
{Name: "OTEL_LOGS_EXPORTER", Value: "none"},
},
},
},
}

Expand Down
18 changes: 18 additions & 0 deletions pkg/instrumentation/podmutator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ import (
const (
defaultJavaInstrumentationImage = "test.registry/adot-autoinstrumentation-java:test-tag"
defaultPythonInstrumentationImage = "test.registry/adot-autoinstrumentation-python:test-tag"
defaultDotNetInstrumentationImage = "test.registry/adot-autoinstrumentation-dotnet:test-tag"
)

func TestGetInstrumentationInstanceFromNameSpaceDefault(t *testing.T) {
os.Setenv("AUTO_INSTRUMENTATION_JAVA", defaultJavaInstrumentationImage)
os.Setenv("AUTO_INSTRUMENTATION_PYTHON", defaultPythonInstrumentationImage)
os.Setenv("AUTO_INSTRUMENTATION_DOTNET", defaultDotNetInstrumentationImage)

defaultInst := &v1alpha1.Instrumentation{
Status: v1alpha1.InstrumentationStatus{},
Expand Down Expand Up @@ -80,6 +82,22 @@ func TestGetInstrumentationInstanceFromNameSpaceDefault(t *testing.T) {
{Name: "OTEL_LOGS_EXPORTER", Value: "none"},
},
},
// temporary environment variables. Need to be updated with the latest values
DotNet: v1alpha1.DotNet{
Image: defaultDotNetInstrumentationImage,
Env: []corev1.EnvVar{
{Name: "OTEL_AWS_APP_SIGNALS_ENABLED", Value: "true"},
{Name: "OTEL_TRACES_SAMPLER_ARG", Value: "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000"},
{Name: "OTEL_TRACES_SAMPLER", Value: "xray"},
{Name: "OTEL_EXPORTER_OTLP_PROTOCOL", Value: "http/protobuf"},
{Name: "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT", Value: "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces"},
{Name: "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT", Value: "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/metrics"},
{Name: "OTEL_METRICS_EXPORTER", Value: "none"},
{Name: "OTEL_DOTNET_DISTRO", Value: "aws_distro"},
{Name: "OTEL_DOTNET_CONFIGURATOR", Value: "aws_configurator"},
{Name: "OTEL_LOGS_EXPORTER", Value: "none"},
},
},
},
}
namespace := corev1.Namespace{
Expand Down
3 changes: 3 additions & 0 deletions versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ cloudwatch-agent=1.300041.0b681
operator=1.4.1

# Represents the current release of ADOT language instrumentation.

# This needs to be updated with the latest release of ADOT SDK
aws-otel-dotnet-instrumentation=1.6.0
aws-otel-java-instrumentation=v1.32.2
aws-otel-python-instrumentation=v0.2.0

Expand Down
Loading