Skip to content

Commit

Permalink
Merge pull request #4 from bettermarks/feature/enable-transaction-sam…
Browse files Browse the repository at this point in the history
…ple-rate

Feature/enable transaction sample rate
  • Loading branch information
saurabh2590 authored Apr 6, 2023
2 parents 39772ef + db40a50 commit faf2262
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ namespace:
package and put it into the metadata of every transaction.
* `elasticapm.transactions_ignore_patterns`: Whitespace separated list of
ignore patterns.
* `elasticapm.transaction_sample_rate`: Transaction sample rate
1 change: 1 addition & 0 deletions src/pyramid_elasticapm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(self, handler, registry):
'SERVER_URL': settings['elasticapm.server_url'],
'SECRET_TOKEN': settings['elasticapm.secret_token'],
'ENVIRONMENT': settings['elasticapm.environment'],
'TRANSACTION_SAMPLE_RATE': settings['elasticapm.transaction_sample_rate'],
}
if settings.get('elasticapm.transactions_ignore_patterns', ''):
config['TRANSACTIONS_IGNORE_PATTERNS'] = settings[
Expand Down
1 change: 1 addition & 0 deletions src/pyramid_elasticapm/tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def make_app(server_url):
'elasticapm.environment': 'testing',
'elasticapm.service_distribution': 'pytest',
'elasticapm.transactions_ignore_patterns': 'foo bar baz',
'elasticapm.transaction_sample_rate': 1.0,
}
config = Configurator(settings=settings)
config.include('pyramid_elasticapm')
Expand Down

0 comments on commit faf2262

Please sign in to comment.