Skip to content

Commit b53db4b

Browse files
feat(jp): add JP region handling to 15 recipes with EU-specific logic
Some recipes contained region-specific endpoint logic covering US, EU, and staging but did not have a JP branch. This adds JP as a first-class branch in the same conditional blocks and normalises the ordering to staging → EU → JP → US (default). Two patterns of missing JP handling were addressed: 1) NerdGraph API URL selection (3 files, 'grep -i eu' shell pattern): recipes/newrelic/apm/java/linux.yml recipes/newrelic/infrastructure/alerts/golden.yml (2 blocks) recipes/newrelic/infrastructure/cloud/aws-linux.yml Added a 'grep -i jp' branch pointing at 'https://api.jp.newrelic.com' alongside the existing EU branch. 2) OTLP endpoint selection (12 nrdot files, '$NEW_RELIC_REGION = "EU"' shell-check pattern): recipes/newrelic/infrastructure/nrdot/elasticsearch-otel/{debian,rhel}.yml recipes/newrelic/infrastructure/nrdot/haproxy/{debian,rhel}.yml recipes/newrelic/infrastructure/nrdot/kafka/{debian,rhel}.yml recipes/newrelic/infrastructure/nrdot/nginx/{debian,rhel}.yml recipes/newrelic/infrastructure/nrdot/nginx-plus/{debian,rhel}.yml recipes/newrelic/infrastructure/nrdot/rabbitmq/{debian,rhel}.yml Added a JP elif branch pointing at 'https://otlp.jp.nr-data.net[:PORT]' between the existing 'staging' and default 'else' branches, matching the JP endpoint convention (note: no '01' suffix, unlike EU's 'eu01'). nrdot/ibm-mq/{debian,rhel}.yml already handled JP and is unchanged. The full recipes/ tree was audited for other JP gaps: * Files that only handle a 'staging' special case (APM PHP awslinux/ debian/redhat, APM dotNet linux-systemd/windows-iis, Infrastructure awslinux/centos_rhel/darwin/debian/suse/ubuntu/windows, Kubernetes, APM Node linux) do NOT need JP additions — they don't handle EU either; regional routing (US/EU/JP) is done via the agent's own license-key prefix detection. * recipes/newrelic/ebpf/{awslinux,centos,ubuntu}.yml only mention EU in a comment ('# region "US"/"EU".'); they pass NEW_RELIC_REGION through as an env var to the eBPF Helm chart, which handles JP routing internally. Left unchanged (functionally correct as-is).
1 parent c7e90db commit b53db4b

15 files changed

Lines changed: 72 additions & 37 deletions

File tree

recipes/newrelic/apm/java/linux.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,9 @@ install:
508508
if [ $(echo {{.NEW_RELIC_REGION}} | grep -i eu | wc -l) -gt 0 ]; then
509509
NEW_RELIC_API_URL=$(echo -n 'https://api.eu.newrelic.com')
510510
fi
511+
if [ $(echo {{.NEW_RELIC_REGION}} | grep -i jp | wc -l) -gt 0 ]; then
512+
NEW_RELIC_API_URL=$(echo -n 'https://api.jp.newrelic.com')
513+
fi
511514
sudo sed -i "s,DEFAULT_API_URL,$NEW_RELIC_API_URL,g" /etc/newrelic-java/dynamic-attach.sh
512515
513516
javaAgentVersion=$(nri-lsi-java -agentVersion | grep -Po '"agentVersion":.*"' | awk -F': ' '{print $2}' | tr -d '"')

recipes/newrelic/infrastructure/alerts/golden.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ preInstall:
3333
if [ $(echo $NEW_RELIC_REGION | grep -i eu | wc -l) -gt 0 ]; then
3434
NEW_RELIC_API_URL=$(echo -n 'https://api.eu.newrelic.com')
3535
fi
36-
36+
if [ $(echo $NEW_RELIC_REGION | grep -i jp | wc -l) -gt 0 ]; then
37+
NEW_RELIC_API_URL=$(echo -n 'https://api.jp.newrelic.com')
38+
fi
39+
3740
POLICY_RESULT=$(curl -sX POST $NEW_RELIC_API_URL'/graphql' \
3841
-H "Api-Key:$NEW_RELIC_API_KEY" \
3942
-L -H 'Content-Type: application/json' \
@@ -73,6 +76,9 @@ install:
7376
if [ $(echo {{.NEW_RELIC_REGION}} | grep -i eu | wc -l) -gt 0 ]; then
7477
NEW_RELIC_API_URL=$(echo -n 'https://api.eu.newrelic.com')
7578
fi
79+
if [ $(echo {{.NEW_RELIC_REGION}} | grep -i jp | wc -l) -gt 0 ]; then
80+
NEW_RELIC_API_URL=$(echo -n 'https://api.jp.newrelic.com')
81+
fi
7682
7783
echo 'Creating alert policy {{.ALERT_POLICY_NAME}}...'
7884

recipes/newrelic/infrastructure/cloud/aws-linux.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ install:
209209
NEW_RELIC_API_URL='https://staging-api.newrelic.com/graphql'
210210
elif [ $(echo {{.NEW_RELIC_REGION}} | grep -i eu | wc -l) -gt 0 ]; then
211211
NEW_RELIC_API_URL='https://api.eu.newrelic.com/graphql'
212+
elif [ $(echo {{.NEW_RELIC_REGION}} | grep -i jp | wc -l) -gt 0 ]; then
213+
NEW_RELIC_API_URL='https://api.jp.newrelic.com/graphql'
212214
fi
213215
214216
curlQuery=$(echo $query | curl $NEW_RELIC_API_URL \

recipes/newrelic/infrastructure/nrdot/elasticsearch-otel/debian.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,12 @@ install:
158158
echo "NEW_RELIC_LICENSE_KEY={{.NEW_RELIC_LICENSE_KEY}}" | tee -a "$CONFIG_FILE" > /dev/null
159159
fi
160160
161-
if [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
162-
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net"
163-
elif [ "{{.NEW_RELIC_REGION}}" = "staging" ]; then
161+
if [ "{{.NEW_RELIC_REGION}}" = "staging" ]; then
164162
OTLP_ENDPOINT="https://staging-otlp.nr-data.net"
163+
elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
164+
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net"
165+
elif [ "{{.NEW_RELIC_REGION}}" = "JP" ]; then
166+
OTLP_ENDPOINT="https://otlp.jp.nr-data.net"
165167
else
166168
OTLP_ENDPOINT="https://otlp.nr-data.net"
167169
fi

recipes/newrelic/infrastructure/nrdot/elasticsearch-otel/rhel.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,12 @@ install:
168168
echo "NEW_RELIC_LICENSE_KEY={{.NEW_RELIC_LICENSE_KEY}}" | tee -a "$CONFIG_FILE" > /dev/null
169169
fi
170170
171-
if [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
172-
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net"
173-
elif [ "{{.NEW_RELIC_REGION}}" = "staging" ]; then
171+
if [ "{{.NEW_RELIC_REGION}}" = "staging" ]; then
174172
OTLP_ENDPOINT="https://staging-otlp.nr-data.net"
173+
elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
174+
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net"
175+
elif [ "{{.NEW_RELIC_REGION}}" = "JP" ]; then
176+
OTLP_ENDPOINT="https://otlp.jp.nr-data.net"
175177
else
176178
OTLP_ENDPOINT="https://otlp.nr-data.net"
177179
fi

recipes/newrelic/infrastructure/nrdot/haproxy/debian.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,12 @@ install:
175175
echo "NEW_RELIC_LICENSE_KEY=${NEW_RELIC_LICENSE_KEY}" | tee -a "$CONFIG_FILE" > /dev/null
176176
fi
177177
178-
if [ "${NEW_RELIC_REGION}" = "EU" ]; then
179-
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net"
180-
elif [ "${NEW_RELIC_REGION}" = "staging" ]; then
178+
if [ "${NEW_RELIC_REGION}" = "staging" ]; then
181179
OTLP_ENDPOINT="https://staging-otlp.nr-data.net"
180+
elif [ "${NEW_RELIC_REGION}" = "EU" ]; then
181+
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net"
182+
elif [ "${NEW_RELIC_REGION}" = "JP" ]; then
183+
OTLP_ENDPOINT="https://otlp.jp.nr-data.net"
182184
else
183185
OTLP_ENDPOINT="https://otlp.nr-data.net"
184186
fi

recipes/newrelic/infrastructure/nrdot/haproxy/rhel.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,12 @@ install:
180180
echo "NEW_RELIC_LICENSE_KEY=${NEW_RELIC_LICENSE_KEY}" | tee -a "$CONFIG_FILE" > /dev/null
181181
fi
182182
183-
if [ "${NEW_RELIC_REGION}" = "EU" ]; then
184-
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net"
185-
elif [ "${NEW_RELIC_REGION}" = "staging" ]; then
183+
if [ "${NEW_RELIC_REGION}" = "staging" ]; then
186184
OTLP_ENDPOINT="https://staging-otlp.nr-data.net"
185+
elif [ "${NEW_RELIC_REGION}" = "EU" ]; then
186+
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net"
187+
elif [ "${NEW_RELIC_REGION}" = "JP" ]; then
188+
OTLP_ENDPOINT="https://otlp.jp.nr-data.net"
187189
else
188190
OTLP_ENDPOINT="https://otlp.nr-data.net"
189191
fi

recipes/newrelic/infrastructure/nrdot/kafka/debian.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,12 @@ install:
111111
LEVEL="${NR_CLI_MONITORING_LEVEL:-complete}"
112112
COLLECTOR_CONFIG="{{.CONFIG_DIR}}/kafka-collector-config.yaml"
113113
114-
if [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
115-
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net:4317"
116-
elif [ "{{.NEW_RELIC_REGION}}" = "staging" ]; then
114+
if [ "{{.NEW_RELIC_REGION}}" = "staging" ]; then
117115
OTLP_ENDPOINT="https://staging-otlp.nr-data.net:4317"
116+
elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
117+
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net:4317"
118+
elif [ "{{.NEW_RELIC_REGION}}" = "JP" ]; then
119+
OTLP_ENDPOINT="https://otlp.jp.nr-data.net:4317"
118120
else
119121
OTLP_ENDPOINT="https://otlp.nr-data.net:4317"
120122
fi

recipes/newrelic/infrastructure/nrdot/kafka/rhel.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ install:
117117
LEVEL="${NR_CLI_MONITORING_LEVEL:-complete}"
118118
COLLECTOR_CONFIG="{{.CONFIG_DIR}}/kafka-collector-config.yaml"
119119
120-
if [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
121-
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net:4317"
122-
elif [ "{{.NEW_RELIC_REGION}}" = "staging" ]; then
120+
if [ "{{.NEW_RELIC_REGION}}" = "staging" ]; then
123121
OTLP_ENDPOINT="https://staging-otlp.nr-data.net:4317"
122+
elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
123+
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net:4317"
124+
elif [ "{{.NEW_RELIC_REGION}}" = "JP" ]; then
125+
OTLP_ENDPOINT="https://otlp.jp.nr-data.net:4317"
124126
else
125127
OTLP_ENDPOINT="https://otlp.nr-data.net:4317"
126128
fi

recipes/newrelic/infrastructure/nrdot/nginx-plus/debian.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,12 @@ install:
214214
echo "NEW_RELIC_LICENSE_KEY=${NEW_RELIC_LICENSE_KEY}" | tee -a "$CONFIG_FILE" > /dev/null
215215
fi
216216
217-
if [ "${NEW_RELIC_REGION}" = "EU" ]; then
218-
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net"
219-
elif [ "${NEW_RELIC_REGION}" = "staging" ]; then
217+
if [ "${NEW_RELIC_REGION}" = "staging" ]; then
220218
OTLP_ENDPOINT="https://staging-otlp.nr-data.net"
219+
elif [ "${NEW_RELIC_REGION}" = "EU" ]; then
220+
OTLP_ENDPOINT="https://otlp.eu01.nr-data.net"
221+
elif [ "${NEW_RELIC_REGION}" = "JP" ]; then
222+
OTLP_ENDPOINT="https://otlp.jp.nr-data.net"
221223
else
222224
OTLP_ENDPOINT="https://otlp.nr-data.net"
223225
fi

0 commit comments

Comments
 (0)