Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pump, Cedric
lab-tracing
Commits
220fd813
Commit
220fd813
authored
Mar 07, 2021
by
Nane Kratzke
Browse files
Improved service naming
parent
2aac41dd
Changes
1
Show whitespace changes
Inline
Side-by-side
hiphop/service.py
View file @
220fd813
...
...
@@ -12,7 +12,7 @@ service = os.environ.get('HIPHOP', 'hiphop')
tier
=
int
(
os
.
environ
.
get
(
'TIER'
,
'1'
))
app
=
Flask
(
__name__
)
apm
=
ElasticAPM
(
app
,
service_name
=
os
.
environ
.
get
(
'SERVICE'
,
'space'
)
,
service_name
=
f
"
{
service
}
-
{
tier
}
"
,
)
@
app
.
route
(
'/'
)
...
...
@@ -23,9 +23,9 @@ def index():
def
hip
():
logging
.
info
(
f
"Request from
{
request
.
remote_addr
}
with headers
{
json
.
dumps
(
dict
(
request
.
headers
))
}
"
)
r
=
""
url
=
f
"http://
{
service
}
-
{
tier
+
1
}
/hip"
url
=
f
"http://
{
service
}
-
{
tier
+
1
}
/hip"
try
:
with
elasticapm
.
capture_span
(
f
"
{
service
}
-
{
tier
+
1
}
"
):
with
elasticapm
.
capture_span
(
f
"
{
service
}
-
{
tier
+
1
}
"
):
r
=
requests
.
get
(
url
).
content
except
Exception
as
ex
:
logging
.
error
(
f
"Fetching
{
url
}
failed (
{
ex
}
)"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment