Skip to content

Commit 5f7c293

Browse files
authored
Add instrumentation for remoulade (#1082)
1 parent c6f9dcd commit 5f7c293

File tree

18 files changed

+631
-5
lines changed

18 files changed

+631
-5
lines changed

.github/component_owners.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
components:
22

3+
instrumentation/opentelemetry-instrumentation-boto3sqs:
4+
- oxeye-nikolay
5+
- nikosokolik
6+
37
instrumentation/opentelemetry-instrumentation-kafka-python:
48
- nozik
59

610
instrumentation/opentelemetry-instrumentation-pika:
711
- oxeye-nikolay
812
- nikosokolik
913

10-
instrumentation/opentelemetry-instrumentation-boto3sqs:
11-
- oxeye-nikolay
12-
- nikosokolik
14+
instrumentation/opentelemetry-instrumentation-remoulade:
15+
- ben-natan
16+
- machine424
1317

1418
propagator/opentelemetry-propagator-aws-xray:
1519
- NathanielRN

CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
([1109](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1109))
1313
- cleanup type hints for textmap `Getter` and `Setter` classes
1414
([1106](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1106))
15+
16+
### Added
17+
- `opentelemetry-instrumentation-remoulade` Initial release
18+
([#1082](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1082))
1519

1620
## [1.12.0rc1-0.31b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.12.0rc1-0.31b0) - 2022-05-17
1721

18-
19-
2022
### Fixed
2123
- `opentelemetry-instrumentation-aiohttp-client` make span attributes available to sampler
2224
([1072](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1072))

docs-requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pymongo~=3.1
3333
PyMySQL~=0.9.3
3434
pyramid>=1.7
3535
redis>=2.6
36+
remoulade>=0.50
3637
sqlalchemy>=1.0
3738
tornado>=5.1.1
3839
ddtrace>=0.34.0

instrumentation/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
| [opentelemetry-instrumentation-pymysql](./opentelemetry-instrumentation-pymysql) | PyMySQL < 2 |
3030
| [opentelemetry-instrumentation-pyramid](./opentelemetry-instrumentation-pyramid) | pyramid >= 1.7 |
3131
| [opentelemetry-instrumentation-redis](./opentelemetry-instrumentation-redis) | redis >= 2.6 |
32+
| [opentelemetry-instrumentation-remoulade](./opentelemetry-instrumentation-remoulade) | remoulade >= 0.50 |
3233
| [opentelemetry-instrumentation-requests](./opentelemetry-instrumentation-requests) | requests ~= 2.0 |
3334
| [opentelemetry-instrumentation-sklearn](./opentelemetry-instrumentation-sklearn) | scikit-learn ~= 0.24.0 |
3435
| [opentelemetry-instrumentation-sqlalchemy](./opentelemetry-instrumentation-sqlalchemy) | sqlalchemy |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
graft src
2+
graft tests
3+
global-exclude *.pyc
4+
global-exclude *.pyo
5+
global-exclude __pycache__/*
6+
include CHANGELOG.md
7+
include MANIFEST.in
8+
include README.rst
9+
include LICENSE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
OpenTelemetry Remoulade Instrumentation
2+
=======================================
3+
4+
|pypi|
5+
6+
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-remoulade.svg
7+
:target: https://pypi.org/project/opentelemetry-instrumentation-remoulade/
8+
9+
This library allows tracing requests made by the Remoulade library.
10+
11+
Installation
12+
------------
13+
14+
::
15+
16+
pip install opentelemetry-instrumentation-remoulade
17+
18+
References
19+
----------
20+
21+
* `OpenTelemetry Remoulade Instrumentation <https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/remoulade/remoulade.html>`_
22+
* `OpenTelemetry Project <https://opentelemetry.io/>`_
23+
* `OpenTelemetry Python Examples <https://github.com/open-telemetry/opentelemetry-python/tree/main/docs/examples>`_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Copyright The OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
[metadata]
16+
name = opentelemetry-instrumentation-remoulade
17+
description = OpenTelemetry Remoulade instrumentation
18+
long_description = file: README.rst
19+
long_description_content_type = text/x-rst
20+
author = OpenTelemetry Authors
21+
author_email = [email protected]
22+
url = https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-remoulade
23+
platforms = any
24+
license = Apache-2.0
25+
classifiers =
26+
Development Status :: 4 - Beta
27+
Intended Audience :: Developers
28+
License :: OSI Approved :: Apache Software License
29+
Programming Language :: Python
30+
Programming Language :: Python :: 3
31+
Programming Language :: Python :: 3.7
32+
Programming Language :: Python :: 3.8
33+
Programming Language :: Python :: 3.9
34+
Programming Language :: Python :: 3.10
35+
36+
[options]
37+
python_requires = >=3.7
38+
package_dir=
39+
=src
40+
packages=find_namespace:
41+
install_requires =
42+
opentelemetry-api ~= 1.10
43+
opentelemetry-semantic-conventions == 0.31b0
44+
opentelemetry-instrumentation == 0.31b0
45+
46+
[options.extras_require]
47+
test =
48+
opentelemetry-test-utils == 0.31b0
49+
opentelemetry-sdk ~= 1.10
50+
51+
[options.packages.find]
52+
where = src
53+
54+
[options.entry_points]
55+
opentelemetry_instrumentor =
56+
remoulade = opentelemetry.instrumentation.remoulade:RemouladeInstrumentor
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Copyright The OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
17+
# RUN `python scripts/generate_setup.py` TO REGENERATE.
18+
19+
20+
import distutils.cmd
21+
import json
22+
import os
23+
from configparser import ConfigParser
24+
25+
import setuptools
26+
27+
config = ConfigParser()
28+
config.read("setup.cfg")
29+
30+
# We provide extras_require parameter to setuptools.setup later which
31+
# overwrites the extras_require section from setup.cfg. To support extras_require
32+
# section in setup.cfg, we load it here and merge it with the extras_require param.
33+
extras_require = {}
34+
if "options.extras_require" in config:
35+
for key, value in config["options.extras_require"].items():
36+
extras_require[key] = [v for v in value.split("\n") if v.strip()]
37+
38+
BASE_DIR = os.path.dirname(__file__)
39+
PACKAGE_INFO = {}
40+
41+
VERSION_FILENAME = os.path.join(
42+
BASE_DIR,
43+
"src",
44+
"opentelemetry",
45+
"instrumentation",
46+
"remoulade",
47+
"version.py",
48+
)
49+
with open(VERSION_FILENAME, encoding="utf-8") as f:
50+
exec(f.read(), PACKAGE_INFO)
51+
52+
PACKAGE_FILENAME = os.path.join(
53+
BASE_DIR,
54+
"src",
55+
"opentelemetry",
56+
"instrumentation",
57+
"remoulade",
58+
"package.py",
59+
)
60+
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
61+
exec(f.read(), PACKAGE_INFO)
62+
63+
# Mark any instruments/runtime dependencies as test dependencies as well.
64+
extras_require["instruments"] = PACKAGE_INFO["_instruments"]
65+
test_deps = extras_require.get("test", [])
66+
for dep in extras_require["instruments"]:
67+
test_deps.append(dep)
68+
69+
extras_require["test"] = test_deps
70+
71+
72+
class JSONMetadataCommand(distutils.cmd.Command):
73+
74+
description = (
75+
"print out package metadata as JSON. This is used by OpenTelemetry dev scripts to ",
76+
"auto-generate code in other places",
77+
)
78+
user_options = []
79+
80+
def initialize_options(self):
81+
pass
82+
83+
def finalize_options(self):
84+
pass
85+
86+
def run(self):
87+
metadata = {
88+
"name": config["metadata"]["name"],
89+
"version": PACKAGE_INFO["__version__"],
90+
"instruments": PACKAGE_INFO["_instruments"],
91+
}
92+
print(json.dumps(metadata))
93+
94+
95+
setuptools.setup(
96+
cmdclass={"meta": JSONMetadataCommand},
97+
version=PACKAGE_INFO["__version__"],
98+
extras_require=extras_require,
99+
)

0 commit comments

Comments
 (0)