-
Notifications
You must be signed in to change notification settings - Fork 737
Add instrumentation for remoulade #1082
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
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
56a7c2d
feat: add basic remoulade instrumentation
ben-natan 73da355
feat: add basic test
ben-natan 9cc3e2c
feat: add basic tests
ben-natan fc79f80
feat: add basic attributes
ben-natan 8eab917
feat: pass context in options["trace_ctx"] instead of options
ben-natan 53698aa
feat: add retries and retries tests
ben-natan b5ca442
fix: copy pasta
ben-natan 918405b
feat: add uninstrument logic (wait for remoulade release)
ben-natan 5e4e3e1
feat: add uninstrument
ben-natan 51b932e
chore: clean
ben-natan 8bcadcd
fix: typo and run tox
ben-natan ebf3066
fix: add docs-requirements.txt
ben-natan 36fff81
Merge branch 'main' into add-remoulade
ben-natan d1f7ed4
chore: set version to 0.30b1
ben-natan 94ab40a
docs: changelog update
ben-natan 236002b
feat: add auto-instrumentation
ben-natan 9d5abd3
feat: add RemouladeGetter
ben-natan d41444a
Merge branch 'main' into add-remoulade
ben-natan acd7884
test: add test_getter.py
ben-natan 75d2efe
chore: add copyright
ben-natan 4e2f1c6
fix: remoulade version
ben-natan 8507a74
fix: readme spaces
ben-natan 38d8622
Merge branch 'main' into add-remoulade
srikanthccv dc67bcc
fix: lint and opentelemetry-api version
ben-natan 18f487e
fix: typo in remoulade version
ben-natan f730c5f
Merge branch 'main' into add-remoulade
srikanthccv b745608
fix: python >= 3.7
ben-natan 2fdd776
Merge branch 'main' into add-remoulade
ben-natan 6b3718e
chore: bump to 31b0
ben-natan 4c2b4c0
docs: update CHANGELOG.md
ben-natan 911c142
run tox -e generate
ben-natan 4c2c478
lint
ben-natan 9471334
Izchen code review
ben-natan 0fc6b65
srikanthccv code review
ben-natan b18e951
remove pypy3 test
ben-natan 2a963f5
Merge branch 'main' into add-remoulade
ben-natan 314ee1a
31b0
ben-natan e6ecadd
Merge branch 'main' into add-remoulade
ben-natan e1a268c
Merge branch 'main' into add-remoulade
lzchen 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
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
instrumentation/opentelemetry-instrumentation-remoulade/MANIFEST.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
graft src | ||
graft tests | ||
global-exclude *.pyc | ||
global-exclude *.pyo | ||
global-exclude __pycache__/* | ||
include CHANGELOG.md | ||
include MANIFEST.in | ||
include README.rst | ||
include LICENSE |
23 changes: 23 additions & 0 deletions
23
instrumentation/opentelemetry-instrumentation-remoulade/README.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
OpenTelemetry Remoulade Instrumentation | ||
======================================= | ||
|
||
|pypi| | ||
|
||
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-remoulade.svg | ||
:target: https://pypi.org/project/opentelemetry-instrumentation-remoulade/ | ||
|
||
This library allows tracing requests made by the Remoulade library. | ||
|
||
Installation | ||
------------ | ||
|
||
:: | ||
|
||
pip install opentelemetry-instrumentation-remoulade | ||
|
||
References | ||
---------- | ||
|
||
* `OpenTelemetry Remoulade Instrumentation <https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/remoulade/remoulade.html>`_ | ||
* `OpenTelemetry Project <https://opentelemetry.io/>`_ | ||
* `OpenTelemetry Python Examples <https://github.com/open-telemetry/opentelemetry-python/tree/main/docs/examples>`_ |
56 changes: 56 additions & 0 deletions
56
instrumentation/opentelemetry-instrumentation-remoulade/setup.cfg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
[metadata] | ||
name = opentelemetry-instrumentation-remoulade | ||
description = OpenTelemetry Remoulade instrumentation | ||
long_description = file: README.rst | ||
long_description_content_type = text/x-rst | ||
author = OpenTelemetry Authors | ||
author_email = [email protected] | ||
url = https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-remoulade | ||
platforms = any | ||
license = Apache-2.0 | ||
classifiers = | ||
Development Status :: 4 - Beta | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: Apache Software License | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: 3.10 | ||
|
||
[options] | ||
python_requires = >=3.7 | ||
package_dir= | ||
=src | ||
packages=find_namespace: | ||
install_requires = | ||
opentelemetry-api ~= 1.10 | ||
opentelemetry-semantic-conventions == 0.31b0 | ||
opentelemetry-instrumentation == 0.31b0 | ||
|
||
[options.extras_require] | ||
test = | ||
opentelemetry-test-utils == 0.31b0 | ||
opentelemetry-sdk ~= 1.10 | ||
|
||
[options.packages.find] | ||
where = src | ||
|
||
[options.entry_points] | ||
opentelemetry_instrumentor = | ||
remoulade = opentelemetry.instrumentation.remoulade:RemouladeInstrumentor |
99 changes: 99 additions & 0 deletions
99
instrumentation/opentelemetry-instrumentation-remoulade/setup.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt. | ||
# RUN `python scripts/generate_setup.py` TO REGENERATE. | ||
|
||
|
||
import distutils.cmd | ||
import json | ||
import os | ||
from configparser import ConfigParser | ||
|
||
import setuptools | ||
|
||
config = ConfigParser() | ||
config.read("setup.cfg") | ||
|
||
# We provide extras_require parameter to setuptools.setup later which | ||
# overwrites the extras_require section from setup.cfg. To support extras_require | ||
# section in setup.cfg, we load it here and merge it with the extras_require param. | ||
extras_require = {} | ||
if "options.extras_require" in config: | ||
for key, value in config["options.extras_require"].items(): | ||
extras_require[key] = [v for v in value.split("\n") if v.strip()] | ||
|
||
BASE_DIR = os.path.dirname(__file__) | ||
PACKAGE_INFO = {} | ||
|
||
VERSION_FILENAME = os.path.join( | ||
BASE_DIR, | ||
"src", | ||
"opentelemetry", | ||
"instrumentation", | ||
"remoulade", | ||
"version.py", | ||
) | ||
with open(VERSION_FILENAME, encoding="utf-8") as f: | ||
exec(f.read(), PACKAGE_INFO) | ||
|
||
PACKAGE_FILENAME = os.path.join( | ||
BASE_DIR, | ||
"src", | ||
"opentelemetry", | ||
"instrumentation", | ||
"remoulade", | ||
"package.py", | ||
) | ||
with open(PACKAGE_FILENAME, encoding="utf-8") as f: | ||
exec(f.read(), PACKAGE_INFO) | ||
|
||
# Mark any instruments/runtime dependencies as test dependencies as well. | ||
extras_require["instruments"] = PACKAGE_INFO["_instruments"] | ||
test_deps = extras_require.get("test", []) | ||
for dep in extras_require["instruments"]: | ||
test_deps.append(dep) | ||
|
||
extras_require["test"] = test_deps | ||
|
||
|
||
class JSONMetadataCommand(distutils.cmd.Command): | ||
|
||
description = ( | ||
"print out package metadata as JSON. This is used by OpenTelemetry dev scripts to ", | ||
"auto-generate code in other places", | ||
) | ||
user_options = [] | ||
|
||
def initialize_options(self): | ||
pass | ||
|
||
def finalize_options(self): | ||
pass | ||
|
||
def run(self): | ||
metadata = { | ||
"name": config["metadata"]["name"], | ||
"version": PACKAGE_INFO["__version__"], | ||
"instruments": PACKAGE_INFO["_instruments"], | ||
} | ||
print(json.dumps(metadata)) | ||
|
||
|
||
setuptools.setup( | ||
cmdclass={"meta": JSONMetadataCommand}, | ||
version=PACKAGE_INFO["__version__"], | ||
extras_require=extras_require, | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.