Skip to content

Kafka support #1555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 24, 2022
Prev Previous commit
Next Next commit
Merge branch 'main'
  • Loading branch information
beniwohli committed May 10, 2022
commit c52aa8852610abf460f6481f24e0a0e5dba84c4d
21 changes: 1 addition & 20 deletions elasticapm/contrib/flask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,6 @@

logger = get_logger("elasticapm.errors.client")

_client = None


def make_client(client_cls, app, **defaults):
config = app.config.get("ELASTIC_APM", {})

if "framework_name" not in defaults:
defaults["framework_name"] = "flask"
defaults["framework_version"] = getattr(flask, "__version__", "<0.7")

client = client_cls(config, **defaults)
global _client
_client = client
return client


def get_client():
global _client
return _client


class ElasticAPM(object):
"""
Expand Down Expand Up @@ -164,6 +144,7 @@ def init_app(self, app, **defaults):
# Instrument to get spans
if self.client.config.instrument and self.client.config.enabled:
elasticapm.instrumentation.control.instrument()

signals.request_started.connect(self.request_started, sender=app)
signals.request_finished.connect(self.request_finished, sender=app)
try:
Expand Down
4 changes: 3 additions & 1 deletion elasticapm/instrumentation/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@
"elasticapm.instrumentation.packages.urllib.UrllibInstrumentation",
"elasticapm.instrumentation.packages.graphql.GraphQLExecutorInstrumentation",
"elasticapm.instrumentation.packages.graphql.GraphQLBackendInstrumentation",
"elasticapm.instrumentation.packages.httpcore.HTTPCoreInstrumentation",
"elasticapm.instrumentation.packages.httpx.sync.httpcore.HTTPCoreInstrumentation",
"elasticapm.instrumentation.packages.httplib2.Httplib2Instrumentation",
"elasticapm.instrumentation.packages.azure.AzureInstrumentation",
"elasticapm.instrumentation.packages.kafka.KafkaInstrumentation",
}

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.