Skip to content

Commit 061e2f0

Browse files
NR-560729 Add Japan region support for log ingestion endpoint
1 parent b49f595 commit 061e2f0

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/handler.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
US_LOGGING_INGEST_HOST = "https://log-api.newrelic.com/log/v1"
2020
EU_LOGGING_INGEST_HOST = 'https://log-api.eu.newrelic.com/log/v1'
21+
JP_LOGGING_INGEST_HOST = 'https://log-api.jp.newrelic.com/log/v1'
2122
LOGGING_LAMBDA_VERSION = '1.3.0'
2223
LOGGING_PLUGIN_METADATA = {
2324
'type': "s3-lambda",
@@ -166,11 +167,12 @@ def _get_logging_endpoint(ingest_url=None):
166167
return ingest_url
167168
if "NR_LOGGING_ENDPOINT" in os.environ:
168169
return os.environ["NR_LOGGING_ENDPOINT"]
169-
return (
170-
EU_LOGGING_INGEST_HOST
171-
if _get_license_key().startswith("eu")
172-
else US_LOGGING_INGEST_HOST
173-
)
170+
license_key = _get_license_key()
171+
if license_key.startswith("eu"):
172+
return EU_LOGGING_INGEST_HOST
173+
elif license_key.startswith("jp"):
174+
return JP_LOGGING_INGEST_HOST
175+
return US_LOGGING_INGEST_HOST
174176

175177

176178
def _compress_payload(data):

0 commit comments

Comments
 (0)