Skip to content

Commit 9584ba9

Browse files
fix(jp): reinstate JP region handling across recipes with region-specific endpoint logic (#1392)
fix(jp): reinstate JP region handling across recipes with region-specific endpoint logic (#1392)
1 parent c7e90db commit 9584ba9

18 files changed

Lines changed: 75 additions & 40 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/ebpf/awslinux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ install:
282282
# -- Unique name for the deployment to identify data posting via eBPF Agent
283283
deploymentName: "${DEPLOYMENT_NAME:-}"
284284
# -- If using a customSecretLicenseKey, you must supply your
285-
# region "US"/"EU". Otherwise, leave this value as an empty string.
285+
# region "US"/"EU"/"JP". Otherwise, leave this value as an empty string.
286286
region: "${NEW_RELIC_REGION}"
287287
# -- Custom OTLP endpoint URL. When set, this takes precedence over the region-based static endpoints.
288288
customOtlpEndpoint: ""

recipes/newrelic/ebpf/centos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ install:
271271
# -- Unique name for the deployment to identify data posting via eBPF Agent
272272
deploymentName: "${DEPLOYMENT_NAME:-}"
273273
# -- If using a customSecretLicenseKey, you must supply your
274-
# region "US"/"EU". Otherwise, leave this value as an empty string.
274+
# region "US"/"EU"/"JP". Otherwise, leave this value as an empty string.
275275
region: "${NEW_RELIC_REGION}"
276276
# -- Custom OTLP endpoint URL. When set, this takes precedence over the region-based static endpoints.
277277
customOtlpEndpoint: ""

recipes/newrelic/ebpf/ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ install:
271271
# -- Unique name for the deployment to identify data posting via eBPF Agent
272272
deploymentName: "${DEPLOYMENT_NAME:-}"
273273
# -- If using a customSecretLicenseKey, you must supply your
274-
# region "US"/"EU". Otherwise, leave this value as an empty string.
274+
# region "US"/"EU"/"JP". Otherwise, leave this value as an empty string.
275275
region: "${NEW_RELIC_REGION}"
276276
# -- Custom OTLP endpoint URL. When set, this takes precedence over the region-based static endpoints.
277277
customOtlpEndpoint: ""

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

0 commit comments

Comments
 (0)