Skip to content

Commit eb393ac

Browse files
Install OTEL app
1 parent 63ef2f5 commit eb393ac

File tree

5 files changed

+59
-25
lines changed

5 files changed

+59
-25
lines changed

charts/nr-k8s-otel-collector/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,16 @@ install-helm-dependencies:
33
echo 'Installing Helm Dependencies nr-k8s-otel-collector-> prometheus-community...'; \
44
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
55

6+
NEWRELIC_E2E ?= go run github.com/newrelic/newrelic-integration-e2e-action@latest
7+
.PHONY: e2e-test
8+
e2e-test:
9+
$(NEWRELIC_E2E) \
10+
--commit_sha=test-string \
11+
--retry_attempts=5 \
12+
--retry_seconds=60 \
13+
--account_id=${ACCOUNT_ID} \
14+
--api_key=${API_REST_KEY} \
15+
--license_key=${LICENSE_KEY} \
16+
--spec_path=./e2e/test-specs.yml \
17+
--verbose_mode=true \
18+
--agent_enabled="false"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
components:
2+
frontendProxy:
3+
service:
4+
type: LoadBalancer
5+
frontend:
6+
resources:
7+
limits:
8+
memory: 400Mi
9+
10+
opentelemetry-collector:
11+
config:
12+
exporters:
13+
otlphttp/newrelic:
14+
endpoint: https://otlp.nr-data.net:4317
15+
headers:
16+
api-key: NEW_RELIC_LICENSE_KEY
17+
18+
processors:
19+
resource:
20+
attributes:
21+
- key: k8s.cluster.name
22+
value: SCENARIO_TAG
23+
action: insert
24+
25+
service:
26+
pipelines:
27+
traces:
28+
receivers: [otlp]
29+
processors: [batch, resource]
30+
exporters: [otlphttp/newrelic]
31+
metrics:
32+
receivers: [otlp]
33+
processors: [batch, resource]
34+
exporters: [otlphttp/newrelic]
35+
logs:
36+
receivers: [otlp]
37+
processors: [batch, resource]
38+
exporters: [otlphttp/newrelic]

charts/nr-k8s-otel-collector/e2e/e2e-cluster-values.yml

Whitespace-only changes.

charts/nr-k8s-otel-collector/e2e/e2e-values.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
description: New Relic K8s OTEL E2E Test
22

3-
custom_test_key: cluster_name
3+
custom_test_key: k8s.cluster.name
44

55
permissions:
66
contents: read
77

88
scenarios:
99
- description: This scenario will verify that metrics from a K8s OTEL Cluster are correctly collected
1010
before:
11-
# - cd ../../ && NR_PROM_LICENSE_KEY=${LICENSE_KEY} NR_PROM_CLUSTER=${SCENARIO_TAG} make tilt-ci
11+
- helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
1212
- helm dependency update ../
13-
- helm upgrade --install ${SCENARIO_TAG} --namespace nr-${SCENARIO_TAG} --create-namespace ../ --values e2e-values.yml --set global.licenseKey=${LICENSE_KEY} --set global.cluster=${SCENARIO_TAG}
13+
- helm upgrade --install ${SCENARIO_TAG} --namespace nr-${SCENARIO_TAG} --create-namespace ../ --values e2e-cluster-values.yml --set global.licenseKey=${LICENSE_KEY} --set global.cluster=${SCENARIO_TAG}
14+
- helm upgrade --install app-${SCENARIO_TAG} --namespace nr-${SCENARIO_TAG} --create-namespace open-telemetry/opentelemetry-demo --version 0.28 --values e2e-app-values.yml --set opentelemetry-collector.config.exporters.otlphttp/newrelic.headers.api-key=${LICENSE_KEY} --set opentelemetry-collector.config.processors.resource.attributes[0].value=${SCENARIO_TAG}
1415
after:
15-
# - kubectl logs -l app.kubernetes.io/name=newrelic-prometheus-agent --all-containers --prefix=true
16+
- kubectl logs -l app.kubernetes.io/name=nr-k8s-otel-collector --all-containers --prefix=true
1617
- kubectl get all -o wide
17-
# - cd ../../ && tilt down
18+
- helm uninstall app-${SCENARIO_TAG} --namespace nr-${SCENARIO_TAG}
19+
- helm uninstall ${SCENARIO_TAG} --namespace nr-${SCENARIO_TAG}
20+
- kubectl delete namespace nr-${SCENARIO_TAG}
1821
tests:
1922
metrics:
2023
- source: "metrics.yml"

0 commit comments

Comments
 (0)