Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
16 changes: 16 additions & 0 deletions .chloggen/crds_wip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
component: webhook

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Allow to run the mutating webhook using static configuration, without the need for CRDs.

# One or more tracking issues related to the change
issues: [4201]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
49 changes: 49 additions & 0 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
java-autoinstrumentation:
env:
KUBECONFIG: /tmp/kube-config
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: make our image
run: VERSION=dev make container
- name: make java autoinstrumentation image
run: |
cd autoinstrumentation/java && docker build -t java-autoinstrumentation:dev --build-arg version=$(cat version.txt) .
- name: Create kind cluster
uses: helm/[email protected]
with:
cluster_name: kind
node_image: kindest/node:v1.27.3
- name: Deploy certificate signing request
run: kubectl apply -f tests/integration/certs.yaml
- name: Approve our certificate signing request
run: kubectl certificate approve operator
- name: register our image
run: |
img=$(docker images | grep operator | awk '{print $1":"$2}')
docker tag $img manager:dev
kind load docker-image manager:dev --name kind
kind load docker-image java-autoinstrumentation:dev --name kind
- name: Deploy collector
run: kubectl apply -f tests/integration/collector.yaml
- name: Deploy operator
run: kubectl apply -f tests/integration/operator.yaml
- name: Sleep 10s
run: sleep 10
- name: Deploy java app
run: kubectl apply -f tests/integration/java.yaml
- name: Sleep 20s
run: sleep 20
- name: Check logs
run: |
COLLECTOR_POD=$(kubectl get pod -l app=collector -o jsonpath="{.items[0].metadata.name}")
LOGS=$(kubectl logs ${COLLECTOR_POD})
echo ${LOGS}
echo ${LOGS} | grep "Starting Servlet engine"
18 changes: 17 additions & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,21 @@ type Config struct {
Zap ZapConfig `yaml:"zap"`
// EnableWebhooks enables the webhooks used by controllers.
EnableWebhooks bool `yaml:"enable-webhooks"`
// Instrumentation is the set of instrumentations to use if CRDs are not present
Instrumentation Instrumentation `yaml:"instrumentations"`
// EnableInstrumentationCRDs enables looking for instrumentation CRDs.
EnableInstrumentationCRDs bool `yaml:"enable-instrumentation-crds"`
}

type Instrumentation struct {
ApacheHttpd *InstrumentationSpec `yaml:"apache-httpd,omitempty"`
DotNet *InstrumentationSpec `yaml:"dotnet,omitempty"`
Java *InstrumentationSpec `yaml:"java,omitempty"`
Go *InstrumentationSpec `yaml:"go,omitempty"`
NodeJS *InstrumentationSpec `yaml:"nodejs,omitempty"`
Python *InstrumentationSpec `yaml:"python,omitempty"`
Nginx *InstrumentationSpec `yaml:"nginx,omitempty"`
Sdk *InstrumentationSpec `yaml:"sdk,omitempty"`
}

// New constructs a new configuration.
Expand Down Expand Up @@ -172,7 +187,8 @@ func New() Config {
LevelKey: "level",
LevelFormat: "uppercase",
},
EnableWebhooks: true,
EnableWebhooks: true,
EnableInstrumentationCRDs: true,
}
}

Expand Down
1 change: 1 addition & 0 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func TestToStringMap(t *testing.T) {
"enable-apache-httpd-instrumentation": "false",
"enable-cr-metrics": "false",
"enable-dot-net-auto-instrumentation": "false",
"enable-instrumentation-crds": "false",
"enable-go-auto-instrumentation": "false",
"enable-java-auto-instrumentation": "false",
"enable-leader-election": "false",
Expand Down
Loading
Loading