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
9b9380cf
Commit
9b9380cf
authored
Mar 07, 2021
by
Nane Kratzke
Browse files
Service naming
parent
9d5d03ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
hiphop/service.py
View file @
9b9380cf
...
...
@@ -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
=
f
"
{
service
}
"
,
#
-{ tier }",
service_name
=
f
"
{
service
}
-
{
tier
}
"
,
)
@
app
.
route
(
'/'
)
...
...
@@ -25,8 +25,8 @@ def hip():
r
=
""
url
=
f
"http://
{
service
}
-
{
tier
+
1
}
/hip"
try
:
with
elasticapm
.
capture_span
(
f
"
{
service
}
-
{
tier
+
1
}
"
):
r
=
requests
.
get
(
url
).
content
#
with elasticapm.capture_span(f"{ service }-{ tier + 1 }"):
r
=
requests
.
get
(
url
).
content
except
Exception
as
ex
:
logging
.
error
(
f
"Fetching
{
url
}
failed (
{
ex
}
)"
)
r
=
"END"
...
...
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