Add pyroscope integration (#1176)

# What this PR does

## Which issue(s) this PR fixes

## Checklist

- [ ] Tests updated
- [ ] Documentation added
- [ ] `CHANGELOG.md` updated
This commit is contained in:
Ildar Iskhakov 2023-01-20 18:47:16 +08:00 committed by GitHub
parent c06709fdb6
commit aec54707ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -45,3 +45,4 @@ opentelemetry-instrumentation-celery==0.36b0
opentelemetry-instrumentation-pymysql==0.36b0
opentelemetry-instrumentation-wsgi==0.36b0
opentelemetry-exporter-otlp-proto-grpc==1.15.0
pyroscope-io==0.8.1

View file

@ -648,3 +648,16 @@ if OSS_INSTALLATION:
"schedule": crontab(hour="*/12"), # noqa
"args": (),
} # noqa
PYROSCOPE_PROFILER_ENABLED = getenv_boolean("PYROSCOPE_PROFILER_ENABLED", default=False)
if PYROSCOPE_PROFILER_ENABLED:
import pyroscope
pyroscope.configure(
application_name=os.getenv("PYROSCOPE_APPLICATION_NAME", "oncall"),
server_address=os.getenv("PYROSCOPE_SERVER_ADDRESS", "http://pyroscope:4040"),
auth_token=os.getenv("PYROSCOPE_AUTH_TOKEN", ""),
tags={
"celery_worker": os.getenv("CELERY_WORKER_QUEUE", None),
},
)