Giter Site home page Giter Site logo

apm-bot's Introduction

APM Bot

This demo sends error and resolution messages with Buttons and Cards to the logged-in user when that user toggles the simulated server. That user can interact with the Card buttons, and post comments back to the web page. This showcases the art of the possible for handling notifications from APM Services like AppDynamics, Datadog, Splunk, Dynatrace and more!
View Demo · Report Bug · Request Feature

About The Project

Video Demo

APM Bot Video Demo

Walkthrough

  1. To use this application as it exists in production, click here.
  2. Sign in with your Webex account credentials.
  3. Toggle the server switch.

  4. Check your Webex client. Toggling the switch should have caused the bot to sent you an alert card.
  5. Add a comment to the card.

  6. Submitting the comment should result in an update on the production page after a few seconds:

Setup

If you simply want to use this application, you only need to follow the Walkthrough.

Installation is only needed if you wish to host a version of this bot yourself.

Prerequisites & Dependencies:

  • Python3 (v3.8.1)

Installation

  1. Clone the repo
    git clone https://github.com/WXSD-Sales/BlurBackground.git
  2. Install the required python modules:
    pip install pymongo==3.10.1
    pip install pymongo[srv]
    pip install tornado==4.5.2
    pip install requests
    pip install requests-toolbelt
    
  3. The following Environment variables are required for this demo, set with the appropriate values (see the Environment Variables section below for more details):
    MY_BOT_ID=1234567890
    MY_BOT_TOKEN=ABCDEFG-1234-567A_ZYX
    MY_SECRET_PHRASE=apmtestexample
    MY_BOT_PORT=10031
    
    MY_CLIENT_ID=C51234567890
    MY_CLIENT_SECRET=7851234567890
    MY_BASE_URI=https://1234.eu.ngrok.io
    MY_REDIRECT_URI=/auth
    MY_SCOPES=spark%3Akms%20spark%3Apeople_read
    
    MY_MONGO_URL="mongodb+srv://username:password@your_instance.abcdef.mongodb.net/apm_demo?retryWrites=true&w=majority"
    MY_MONGO_DB=apm_demo
    
  4. Create the Webhooks (see below).
  5. Start the server
    python apm_bot.py
    

Environment Variables

MY_BOT_TOKEN
  1. login to the my-apps section of the developer portal
  2. Click "Create a New App"
  3. Select Bot
  4. Fill in the required fields You will be returned a unique bearer token for the bot.

MY_BOT_ID This is actually the bot's personId (NOT application_id). To get the bot's personId,

  1. click here.
  2. Use the Try It editor on the right side of the page.
  3. toggle off the "Use personal access token" switch.
  4. paste the bot's token from step 1
  5. click Run The JSON returned will include an "id" property. This is the bot's personId.

MY_BASE_URI
  1. This will need to be a publicly accessible location where your bot will be exposed. You can use something like ngrok to provide a tunnel from your laptop or desktop to the world.
  2. You will use this value again when you create your webhooks, and will use it + /auth as the redirect_uri when you create the integration for MY_CLIENT_ID and MY_CLIENT_SECRET.

MY_REDIRECT_URI=/auth
MY_SCOPES=spark%3Akms%20spark%3Apeople_read

These can remain unchanged.

MY_CLIENT_ID
MY_CLIENT_SECRET
  1. login to the my-apps section of the developer portal
  2. Click "Create a New App"
  3. Select Integration
  4. Fill in the required fields.
    a. Your redirect_uri value when creating this integration will need to be the MY_BASE_URI + MY_REDIRECT_URI values
    b. For example, if you were to use the values given in the examples from the Installation step, your redirect_uri would be:
    https://1234.eu.ngrok.io/auth
    You will be returned a unique clientId and clientSecret when the application is created.

MY_MONGO_URL

You will need a MongoDB instance to store data. You can setup a free cluster using MongoDB Atlas. Notice the url in the example wraps the string in quotation marks ". Be aware of any special characters when setting the environment variables.

MY_MONGO_DB=apm_demo

This can remain unchanged. Remember to update the DB in the MY_MONGO_URL string to match this value.

Webhooks

This application requires 2 webhooks. To create them through the developer portal click here. 1.Use the Try It Editor on the right side of the page
2.Untoggle the "Use my personal access token" switch
3.Paste the bot's token in that field.
4.Enter any name
5.targetUrl: Enter your BASE_URI
6.resource: messages
7.event: created
8.secret: Enter your MY_SECRET_PHRASE value

Repeat this process a second time, to create an attachment Action webhook, will slight differences:
4.Enter any name
5.targetUrl: Enter your BASE_URI + /cards
6.resource: attachmentActions
7.event: created
8.secret: Enter your MY_SECRET_PHRASE value

License

All contents are licensed under the MIT license. Please see license for details.

Disclaimer

Everything included is for demo and Proof of Concept purposes only. Use of the site is solely at your own risk. This site may contain links to third party content, which we do not warrant, endorse, or assume liability for. These demos are for Cisco Webex usecases, but are not Official Cisco Webex Branded demos.

Contact

Please contact us at [email protected]

apm-bot's People

Contributors

tahanson-cisco avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.