Metadata-Version: 2.4
Name: apminsight
Version: 1.6.1
Summary: Site24x7 application performance monitoring
Home-page: https://site24x7.com
Author: Zoho Corporation Pvt. Ltd.
Author-email: "Zoho Corporation PVt .Ltd." <apm-insight@zohocorp.com>
Maintainer: ManageEngine Site24x7
Maintainer-email: ManageEngine Site24x7 <apm-insight@zohocorp.com>
License: PLEASE  READ  THE  FOLLOWING  LICENSE  AGREEMENT  CAREFULLY. BY DOWNLOADING THIS
        SOFTWARE YOU AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE AGREEMENT. 
        
        This  License  Agreement  details the  policy for license of APM  Insight Python 
        Agent ("Licensed Software") on the following topics: 
         
        * Free License
        * Technical Support
        
        
        1. FREE LICENSE:
        ZOHO  grants you a non-exclusive, non-transferable, worldwide license to use the
        Licensed  Software  for  no cost in perpetuity. You are forbidden from using the
        Licensed  Software  for  any other use or otherwise offering it for resale under
        the  terms  of  this Section 1. ZOHO retains all rights not specifically granted
        to you herein. 
        
        2. THIRD PARTY PRODUCTS:
        The  Licensed  Software  may  contain software which originated with third party
        vendors  and  without limiting the general applicability of the other provisions
        of  this  Agreement,  you  agree  that (a) the title to any third party software
        incorporated  in  the  Licensed Software shall remain with the third party which
        supplied  the  same;  and  (b)  you  will  not  distribute  any such third party
        software  available with the Licensed Software, unless the license terms of such
        third party software provide otherwise. 
        
        3. RESTRICTIONS ON USE:
        In addition to all other terms and conditions of this Agreement, you shall not:
        
        i.  remove  any  copyright,  trademark  or  other  proprietary  notices from the
        Licensed Software or its copies; 
        ii.  make  any  copies  except  for  one back-up or archival copy, for temporary
        emergency purpose; 
        iii.  rent,  lease,  license,  sublicense or distribute the Licensed Software or
        any portions of it on a standalone basis or as part of your application; 
           iv. modify or enhance the Licensed Software; 
           v. reverse engineer, decompile or disassemble the Licensed Software;
        vi. allow any third parties to access, use or support the Licensed Software. 
        
        4. TECHNICAL SUPPORT:
        You  may  submit technical support queries through our discussion forums. Though
        ZOHO  will  respond  to such queries within a reasonable time in most cases, you
        are not entitled to claim technical support as a matter of right. 
        
        5. OWNERSHIP AND INTELLECTUAL PROPERTY:
        ZOHO  owns  all  right, title and interest in and to the Licensed Software. ZOHO
        expressly  reserves  all  rights  not granted to you herein, notwithstanding the
        right  to  discontinue  or  not  to  release  any  Software and to alter prices,
        features,  specifications,  capabilities,  functions,  licensing  terms, release
        dates,  general  availability  or  characteristics of the Licensed Software. The
        Software is only licensed and not sold to you by ZOHO. 
        
        6. AUDIT:
        ZOHO  has  the  right to audit your Use of the Licensed Software by providing at
        least  seven  (7)  days prior written notice of its intention to conduct such an
        audit at your facilities during normal business hours. 
        
        7. CONFIDENTIALITY:
        The  Licensed  Software  contains  proprietary  information  of  ZOHO  that  are
        protected  by  the  laws  of  the United States and you hereby agree to take all
        reasonable  efforts  to  maintain  the confidentiality of the Licensed Software.
        You  agree  to reasonably communicate the terms and conditions of this Agreement
        to  those  persons  employed  by  you  who  come into contact with or access the
        Licensed  Software,  and  to  use  reasonable efforts to ensure their compliance
        with  such  terms  and  conditions,  including but not limited to, not knowingly
        permitting  such  persons  to  use  any  portion  of the Licensed Software for a
        purpose that is not allowed under this Agreement. 
        
        8. WARRANTY DISCLAIMER:
        ZOHO  does  not warrant that the Licensed Software will be error-free. Except as
        provided  herein, the Licensed Software is furnished "as is" without warranty of
        any  kind,  including  the  warranties  of  merchantability  and  fitness  for a
        particular  purpose  and  without  warranty as to the performance or results you
        may  obtain  by  using  the  Licensed  Software.  You are solely responsible for
        determining  the  appropriateness  of using the Licensed Software and assume all
        risks  associated  with the use of it, including but not limited to the risks of
        program  errors,  damage  to  or  loss  of  data,  programs  or  equipment,  and
        unavailability or interruption of operations. 
        Because  some  jurisdictions  do  not  allow  for the exclusion or limitation of
        implied warranties, the above exclusions or limitations may not apply to you. 
        
        9. LIMITATION OF LIABILITY:
        In  no  event  will  ZOHO  be  liable to you or any third party for any special,
        incidental,  indirect,  punitive  or  exemplary  or  consequential  damages,  or
        damages  for  loss  of business, loss of profits, business interruption, or loss
        of  business  information arising out of the use or inability to use the program
        or  for  any  claim  by  any  other  party  even if ZOHO has been advised of the
        possibility  of  such  damages.  ZOHO's  entire  liability  with  respect to its
        obligations  under  this  agreement  or  otherwise  with respect to the Licensed
        Software  shall not exceed the amount of the named developer license fee paid by
        you for the Licensed Software. 
        Because  some  jurisdictions  do  not  allow  the  exclusion  or  limitation  of
        liability  for  incidental  or  consequential  damages,  the above exclusions or
        limitations may not apply to you. 
        
        10. INDEMNIFICATION:
        ZOHO  agrees  to  indemnify  and defend you from and against any and all claims,
        actions  or  proceedings,  arising  out  of any claim that the Licensed Software
        infringes  or violates any valid U.S. patent, copyright or trade secret right of
        any  third  party;  so long as you provide; (i) prompt written notice to ZOHO of
        such  claim;  (ii) cooperate with ZOHO in the defense and/or settlement thereof,
        at  ZOHO's expense; and, (iii) allow ZOHO to control the defense and all related
        settlement  negotiations.  The  above is ZOHO's sole obligation to you and shall
        be  your  sole  and exclusive remedy pursuant to this Agreement for intellectual
        property infringement. 
        ZOHO  shall  have  no  indemnity  obligation  for  claims of infringement to the
        extent  resulting  or  alleged to result from (i) any combination, operation, or
        use  of  the  Licensed  Software  with any programs or equipment not supplied by
        ZOHO;  (ii)  any  modification  of  the  Licensed Software by a party other than
        ZOHO;  and  (iii) your failure, within a reasonable time frame, to implement any
        replacement or modification of Licensed Software provided by ZOHO. 
        
        11. TERMINATION:
        This  Agreement is effective until terminated by either party. You may terminate
        this  Agreement at any time by destroying or returning to ZOHO all copies of the
        Licensed  Software in your possession. ZOHO may terminate this Agreement for any
        reason,  including  but  not  limited to your breach of any of the terms of this
        Agreement.  Upon  termination, you shall destroy or return to ZOHO all copies of
        the  Licensed  Software  and  certify  in writing that all know copies have been
        destroyed.  All  provisions  relating  to  confidentiality,  proprietary rights,
        non-disclosure,  and  limitation  of  liability shall survive the termination of
        this Agreement. 
        
        12. GENERAL:
        This  Agreement  shall be construed, interpreted and governed by the laws of the
        State  of  California  exclusive  of  its  conflicts  of  law  provisions.  This
        Agreement  constitutes  the entire agreement between the parties, and supersedes
        all  prior communications, understandings or agreements between the parties. Any
        waiver  or  modification  of  this Agreement shall only be effective if it is in
        writing  and  signed  by  both  parties hereto. If any part of this Agreement is
        found  invalid  or  unenforceable,  the  remainder shall be interpreted so as to
        reasonable  effect  the  intention  of  the  parties.  You  shall not export the
        Licensed  Software  or  your application containing the Licensed Software except
        in  compliance  with  United  States  export regulations and applicable laws and
        regulations. 
        
Project-URL: Homepage, https://sit24x7.com/
Project-URL: Documentation, https://www.site24x7.com/help/apm/python-agent.html
Project-URL: Changelog, https://www.site24x7.com/help/apm/python-agent/release-notes.html
Keywords: apm,profiler,site24x7,apminsight,monitoring
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: psutil
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: maintainer
Dynamic: requires-python

Site24x7 Python Application Performance Monitoring
=========================================

Monitor and optimize the performance of your Python application with the Site24x7 APM Insight Python agent. The agent provides you with information on the response time, throughput, database operations, and errors of your application. Keep track of these metrics over time to identify where they can be improved for better performance.

Make sure you have a Site24x7 account before you use an APM Insight agent to monitor metrics.

Requirements: Python version 3.7.0 and above.

Supported frameworks: Bottle, CherryPy, Django, Flask, and Pyramid.

Supported databases and components: PyMySQL, Psycopg2, Pymemcache, Redis, SQLite, Cassandra, Jinja2, Genshi, and Mako.

Supported HTTP libraries: http.client, httplib2, httpx, urllib, urllib3.

**S247DataExporter**

    The S247DataExporter is an independent process dedicated for communicating application metrics and traces to the Site24x7 server.

**Installation instructions for S247DataExporter:**

* Run the following commands in your terminal

        wget -O "InstallDataExporter.sh" https://staticdownloads.site24x7.com/apminsight/S247DataExporter/linux/InstallDataExporter.sh
        sudo sh InstallDataExporter.sh install -lk <S247_LICENSE_KEY>

* If you are using proxy, add the following snippet to the command 'sudo sh InstallDataExporter.sh install -lk <S247_LICENSE_KEY>'
       
        -pau <Proxy auth username> -pap <Proxy auth password> -psh <Proxy server host:Proxy server port>  -psph <Boolean value whether to use HTTPS protocol for proxy> -bp <Bollean value whether to use proxy or not>


  > *Note: By default, S247DataExporter uses 20021 as the AGENT STATUS PORT and 20022 as the AGENT DATA PORT. 

If you want to run the S247DataExporter in different ports, add the below configurations to the above mentioned command.

| Option | Description  |
| ------ | ------ |
| '-asp <Agent Status Port>' | To configure the custom Exporter Status Port |
| '-adp <Agent Data Port>' | To configure the custom Exporter Data Port |
| '-sld <Directory path>' | To log the Exporter logs to a custom directory |
| '-sll <Log level>' | To configure the Log level of Exporter logs |
| '-sls <Exporter log size>' | To configure the Exporter Log file size |

**Installation instructions for the S247 Python agent:**

If you are using a virtual environment, activate the virtual environment and run the following command to install the S247 APMINSIGHT Python package into your virtual environment

        pip install apminsight

**Integrate the Python agent to your application**
        
* *Using the command line* \
   You can use the below command for adding extra configurations:

        $ apminsight-run -lk "license_key" <apm-options> <user application execute command> 

| apm-options | Description |
| ------ | ------ |
| -lk, --license_key | To add the site24x7 license key or device key |
| -apmname, --apm_app_name | To add the APM application name |
| -ald, --apm_log_dir | To add a custom log directory for storing APM logs |
| -ad, --apm_debug | To enable debug mode |
| -aeh, --apm_exp_host | To configure the S247DataExporter host |
| -aesp, --apm_exp_status_port | To configure the S247DataExporter status port |
| -aedp, --apm_exp_data_port | To configure the S247DataExporter data port |

Examples:
 If you want to configure the application name, use the below command:

      apminsight-run --apm_app_name "monitorname" <user application execute command> 

  If you want to configure the directory location, use the below command:

      apminsight-run --apm_app_name "monitorname" --apm_log_dir "logs location" <user application execute command> 

* *Using the code snippet*
  > Note: Update the configuration in the code snippet below and place it at the top of your application route file or application start file.

        
        from apminsight import initialize_agent
        initialize_agent({
            "appname" : "<Your application name>",
            "license_key" : "< your site24x7 license key>",
            '''change if  S247DataExporter is not running in the default ports(20021, 20022):'''
            "exporter_status_port" : "<S247DataExporter status port>",
            "exporter_data_port" : "<S247DataExporter data port>",

            '''If you are running S247DataExporter on a separate machine/server or as a Docker container:'''
            "exporter_host" : "<HostName/ContainerName where S247DataExporter is running>"
        })

  For example, for Django applications, add the code snippet at the top of the Django settings.py file. The name of your Django application will be automatically detected by your WSGI_APPLICATION in the application's settings.py.

  For other applications and frameworks, such as Flask, add the code snippet at the top of the application start file.


* *Configure the agent using environment variables*

| Configuration | Description |
| ------ | ------ |
| $ export S247_LICENSE_KEY=< license key > | To add your site2x7 License or Device key |
| $ export APM_APP_NAME=<Your application name > | To add the APM application name |
| $ export APM_LOGS_DIR=< logs storing path > | To configure the log directory |
| $ export APM_EXPORTER_STATUS_PORT=< S247DataExporter status port >,
$ export APM_EXPORTER_DATA_PORT=< S247DataExporter data port > | To change the S247DataExporter's default running ports (20021, 20022) |
| $ export APM_EXPORTER_HOST=< HostName/ContainerName where S247DataExporter is running > | To change the host of the S247DataExporter to a different machine or server or as a Docker container |

* Restart your WSGI application and Perform some transactions so that the agent can collect data.
* Log in to your Site24x7 account.
* Navigate to APM Insight and click your application to view application metrics.
* You can view agent log files in the apminsightdata/logs directory, which will be present in the process-generated location.

