Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
cd04e84
Add non-test code from last serverless effort
basepi Jul 13, 2021
b59194e
Fix lambda support to send to APM Server directly
basepi Jul 13, 2021
ed5b6e4
Bad boolean
basepi Jul 14, 2021
8d2ea27
Merge remote-tracking branch 'upstream/master' into lambda
basepi Jul 14, 2021
2c013f5
Don't collect cloud metadata
basepi Jul 15, 2021
5f54f41
Start transaction from api gateway timestamp
basepi Jul 15, 2021
7f26df5
start= needs duration= at the end
basepi Jul 15, 2021
f97d2f2
start_time is in milliseconds
basepi Jul 16, 2021
84ead98
Allow for start_time without duration for transactions
basepi Jul 16, 2021
b5ea23b
Revert "Allow for start_time without duration for transactions"
basepi Jul 16, 2021
ba663e1
Add elasticapm.utils.time.time_to_perf_counter()
basepi Jul 19, 2021
c72160a
Add default context fields plus faas context for API gateway
basepi Jul 21, 2021
b4a0885
Fix context references
basepi Jul 21, 2021
84c53fd
Use metrics_interval=0 for disabling metrics thread
basepi Jul 22, 2021
6111989
Add unit test for aws serverless from API gateway
basepi Jul 22, 2021
00a8fb2
Add test data for s3/sqs/sns
basepi Jul 22, 2021
c39c623
Add some test prints
basepi Jul 22, 2021
0d9b929
Review suggestions for time.py
basepi Aug 2, 2021
ca45a3e
Merge remote-tracking branch 'upstream/master' into lambda
basepi Aug 2, 2021
13d152d
Remove transaction backdating to match spec
basepi Aug 3, 2021
44d2bd8
Fix metrics_interval suffix
basepi Aug 3, 2021
135ebf9
Add tests for s3/sns/sqs/s3_batch
basepi Aug 5, 2021
7cd8c90
Merge branch 'master' into lambda
basepi Aug 5, 2021
e97b2be
Disable server version checks
basepi Oct 1, 2021
0bf0f1c
Make sure the client exists first
basepi Oct 1, 2021
11fbcdd
Merge remote-tracking branch 'upstream/master' into lambda
basepi Oct 4, 2021
30b96c3
Add `server_version_override` config for skipping server version checks
basepi Oct 4, 2021
349eab5
Switch to a JIT model for writing metadata to transport buffer
basepi Oct 7, 2021
3f52537
Fix for uninitialized metadata (probably test-only)
basepi Oct 12, 2021
81ac8f9
Add metadata and context for everything except s3
basepi Oct 12, 2021
05ff903
Merge remote-tracking branch 'upstream/master' into lambda
basepi Oct 13, 2021
679695c
Merge metadata one key deep
basepi Oct 13, 2021
996e7a5
Add s3 context
basepi Oct 13, 2021
fea623a
Manage metadata overrides
basepi Oct 13, 2021
8fcc05f
Better logging
basepi Oct 13, 2021
ac8c828
Remove time_to_perf_counter stuff (will submit in different PR)
basepi Oct 14, 2021
d7b30f2
Merge remote-tracking branch 'upstream/master' into lambda
basepi Oct 14, 2021
4746f93
Clarify CHANGELOG and add a usage example
basepi Oct 15, 2021
41e8af5
Remove unnecessary exclude for license check
basepi Oct 15, 2021
ff2860c
Use `server_version` instead of adding `server_version_override`
basepi Oct 15, 2021
302365c
Merge remote-tracking branch 'upstream/master' into lambda
basepi Oct 15, 2021
ee242af
Ignore case when looking for "statusCode"
basepi Oct 15, 2021
95c0fbc
Merge branch 'master' into lambda
basepi Oct 15, 2021
1372e46
Merge remote-tracking branch 'upstream/master' into lambda
basepi Oct 18, 2021
570ea9d
Add note that lambda is experimental
basepi Oct 18, 2021
744a39e
Add a bunch of missing CHANGELOGs for upcoming release
basepi Oct 18, 2021
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,20 @@ endif::[]

// Unreleased changes go here
// When the next release happens, nest these changes under the "Python Agent version 6.x" heading
//[float]
//===== Features
//
//
[float]
===== Features

* Add experimental support for AWS lambda instrumentation {pull}1193[#1193]
* Add support for span compression {pull}1321[#1321]
* Auto-infer destination resources for easier instrumentation of new resources {pull}1359[#1359]
* Add support for dropped span statistics {pull}1327[#1327]

[float]
===== Bug fixes

* Ensure that Prometheus histograms are encoded correctly for APM Server {pull}1354[#1354]
* Remove problematic (and duplicate) `event.dataset` from logging integrations {pull}1365[#1365]
* Fix for memcache instrumentation when configured with a unix socket {pull}1357[#1357]

[[release-notes-6.x]]
=== Python Agent version 6.x
Expand Down
1 change: 1 addition & 0 deletions elasticapm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

from elasticapm.base import Client, get_client # noqa: F401
from elasticapm.conf import setup_logging # noqa: F401
from elasticapm.contrib.serverless import capture_serverless # noqa: F401
from elasticapm.instrumentation.control import instrument, uninstrument # noqa: F401
from elasticapm.traces import ( # noqa: F401
capture_span,
Expand Down
5 changes: 3 additions & 2 deletions elasticapm/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def __init__(self, config=None, **inline):
constants.EVENTS_API_PATH,
)
transport_class = import_string(self.config.transport_class)
self._transport = transport_class(self._api_endpoint_url, self, **transport_kwargs)
self._transport = transport_class(url=self._api_endpoint_url, client=self, **transport_kwargs)
self.config.transport = self._transport
self._thread_managers["transport"] = self._transport

Expand Down Expand Up @@ -200,7 +200,8 @@ def __init__(self, config=None, **inline):
self._metrics.register("elasticapm.metrics.sets.breakdown.BreakdownMetricSet")
if self.config.prometheus_metrics:
self._metrics.register("elasticapm.metrics.sets.prometheus.PrometheusMetrics")
self._thread_managers["metrics"] = self._metrics
if self.config.metrics_interval:
self._thread_managers["metrics"] = self._metrics
compat.atexit_register(self.close)
if self.config.central_config:
self._thread_managers["config"] = self.config
Expand Down
41 changes: 41 additions & 0 deletions elasticapm/contrib/serverless/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# BSD 3-Clause License
#
# Copyright (c) 2019, Elasticsearch BV
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import os

# Future providers such as GCP and Azure will be added to this if/elif block
# This way you can use the same syntax for each of the providers from a user
# perspective
if os.environ.get("AWS_REGION"):
from elasticapm.contrib.serverless.aws import capture_serverless
else:
from elasticapm.contrib.serverless.aws import capture_serverless

__all__ = ("capture_serverless",)
Loading