My team already has kibana account in which all project logs come up. Now how do I set up elastic APM on my python-fast API project?
How to set up APM Server and get the SERVER_URL to use in my project - APM Server
What is GLOBAL_LABELS and in which case is it used?
apm_config = {
'SERVICE_NAME': 'server',
'SERVER_URL': 'http://localhost:8200',
'ENVIRONMENT': 'env',
'GLOBAL_LABELS': 'platform=Demo, application=demo_testing'
}
apm = make_apm_client(apm_config)
app.add_middleware(ElasticAPM, client=apm)
GLOBAL_LABELS
defines labels that will be added to every transaction that the APM Agent generates. You can also add a label on the fly viaelasticapm.label()
.You can get your
secret_token
out of your APM Server config. Or, if you're using Elastic Cloud you can go to the APM page in Kibana, click "Add Data" at the top right, then scroll down and you can get yoursecret_token
/server_url
from the sample config.