cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Include Java or binaries in Extensions2.0

TorstenHellwig
Organizer

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

Dynatrace Master, Appmon Master
5 REPLIES 5

Julius_Loman
DynaMight Legend
DynaMight Legend

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.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Mike_L
Dynatrace Guru
Dynatrace Guru

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']},
      )
Mike

TorstenHellwig
Organizer

That looks good! You should really publish the full possibilities of the EF2 framework (json schemas and everything) ;-)!

Thanks Michael!

Dynatrace Master, Appmon Master

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

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!

Dynatrace Master, Appmon Master

Featured Posts