Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

TeamCodeStream/python_clm_demo

 
 

Repository files navigation

Source Code Context Demo

This demo is meant to provide a proof of concept as well as example data for the experimental source code context for the New Relic Python Agent.

Usage (Docker)

Requirements

  • Docker
  • docker-compose (shipped with Docker desktop for Mac)
  • GNU Make (Optional, for scripting shortcuts)
  • New Relic license key set in environment variable (export NEW_RELIC_LICENSE_KEY=mylicensekey)
  • Port 8000 available (port can also be changed in compose file, eg. 127.0.0.1:9999:8000 for port 9999)

Instructions

  1. Build and start the application with make up or docker-compose up -d --build.
  2. View logs for various components in the generated logs/ directory.
  3. Stop the application make down or docker-compose down.

Development (Local)

Requirements

  • Python
  • Python virtual_env package (if on Python 2)
  • New Relic license key set in environment variable (export NEW_RELIC_LICENSE_KEY=mylicensekey)
  • Port 8000 available (port can also be changed in compose file, eg. 127.0.0.1:9999:8000 for port 9999)

Instructions

  1. Create a virtual environment with python -m virtualenv .venv.
  2. Activate the new virtual environment with source .venv/bin/activate (for bash).
  3. Install requirments with pip install -r requirements.txt.
  4. Navigate to src/ with cd src.
  5. Start the application with newrelic-admin run-program gunicorn main:app -w 3 -t 120.
  6. Optionally start the traffic driver from another terminal with cd src and locust --headless --users 5 --spawn-rate 1 -f locustfile.py
  7. View logs in the src/logs/ directory.
  8. Stop the application with Ctrl-C.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 56.7%
  • Dockerfile 35.1%
  • Shell 5.9%
  • Makefile 2.3%