27 Sep 2024 11:59 AM - last edited on 30 Sep 2024 07:07 AM by MaciejNeumann
Hi all,
I'm converting an EF1 extension to EF2 that is similar to the old SQL-Extension. Since it talks to a DB2 on z/OS there is no pure Python driver available so I'm using Java. I'm able to include a jar-File in the extension folder so it get's zipped up with the build command.
But it's not deployed anywhere on the target active gate.
How do I do this? Also asking in case I want to include anything non-Python.
best,
Torsten
Solved! Go to Solution.
27 Sep 2024 01:00 PM
Did you try to configure this in the setup.py in the package_data? We include external native libraries with this approach, so I expect this will work with the JAR files too.
27 Sep 2024 01:15 PM
This is the example from the IBM MQ extension, which includes a jar:
setup(name='ibm_mq',
version=find_version(),
description='IBM MQ EF 2.0 extension',
author='Dynatrace',
packages=find_packages(),
package_data={"ibm_mq": ["pymqi/*", "lib/*", "shared/*"]},
python_requires='>=3.10',
include_package_data=True,
install_requires=['dt-extensions-sdk', 'requests', 'charset-normalizer<3.0.0', 'defusedxml', 'urllib3', 'psutil'],
extras_require={"dev": ['dt-cli','pyyaml']},
)
27 Sep 2024 01:54 PM
That looks good! You should really publish the full possibilities of the EF2 framework (json schemas and everything) ;-)!
Thanks Michael!
27 Sep 2024 03:41 PM - edited 27 Sep 2024 03:43 PM
I agree with the schema, but "full possibilities" is quite a lot.
Remember that an extension is just a python module, anything you can do with the python setup.py file and in python can be done, like adding static files, that is documented here for instance and it is not a Dynatrace Extension specific feature
We can't recreate the entire python and setuptools documentation in Dynatrace
27 Sep 2024 04:30 PM
Hi David,
you're right - I wasn't aware that setup-tools is used. Never worked with larger Python projects.
Without looking at the ibm mq extension however I would have had no chance to find my files afterwards...
Now it's working great, finds the java executable and everything.
I like!
Have a nice weekend!