appdynamics

package
v0.0.0-...-fb315dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2019 License: MIT Imports: 28 Imported by: 0

README

Appdynamics

The module allows HAL to communicate with App Dynamics

REST

Please refer to the swagger endpoint for details

Alerts
Text Alert

HAL has an endpoint available for appdynamics to send a HTTP rest request to HAL. HAL will then send the alert to telegram

Endpoint is available as a POST to /api/appdynamics/group id

Sample request

{
  "environment": "test",
  "events": [
    {
      "severity": "ERROR",
      "application": {
        "name": "TESTAPP"
      },
      "tier": {
        "name": "TESTTIER"
      },
      "node": {
        "name": "test"
      },
      "displayName": "Business Transaction Error",
      "eventMessage": "[Error]  - ServletException: java.lang.NumberFormatException: For input string: \"\""
    }
  ]
}

To setup a appdynamics action

  1. go to "Alert & Respond"
  2. Create a new HTTP Request template
  3. Method is POST
  4. RAW URL is {hal base url}/api/appdynamics/{group id} so if your base url is http://hal.interwebz.com and your group id is 45678 then the final url would be http://hal.interwebz.com/api/appdynamics/45678
  5. Under payload, paste the JSON Template below. Change environment as you please.
  6. Once done, under actions, create a new HTTP Requets action and link it to the HTTP request template.
  7. Use your policies to define the rules you want alerted on.

JSON Template

#macro(EntityInfo $item)
	"name": "${item.name}"
#end	
	
	{
	"environment": "DEV / SIT",
	"policy" : {
		"digestDurationInMins": "${policy.digestDurationInMins}",
		"name": "${policy.name}"

	},
	"action": {
		"triggerTime":  "${action.triggerTime}",
		"name": "${action.name}"
		
	},
	"events": [
		#foreach(${event} in ${fullEventList})
		{
			"severity": "${event.severity}",
			"application": {
				#EntityInfo($event.application)
			},
			"tier": {
				#EntityInfo($event.tier)
			},
			"node": {
				#EntityInfo($event.node)
			},

			"displayName": "$event.displayName",
			"eventMessage": "$event.eventMessage"
		}
		#if($foreach.count != $fullEventList.size()) , #end
		#end
	]
}

Config

To get HAL to query Appdynamics, you will need to provide HAL with the information it needs to query Appdynamics

Endpoint

HAL needs to know the URL, user and password to use to query appdynamics

so, if your user is A-user, your group is customer1 and your password is secret, with app dynamics available on http://appd.yourcomany.com:8090 then the Endpoint address would be

http://A-user%40customer1:secret@appd.yourcomany.com:8090

endpoint is a POST request to /api/appdynamics/"group id"/endpoint


Custom Metrics

IBM MQ Client

Documentation

Overview

Package appdynamics is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHandler

func MakeHandler(service Service, logger kitlog.Logger, ml machineLearning.Service) http.Handler

MakeHandler returns a restful http handler for the appdynamics service the Machine Learning service can be set to nil if you do not wish to log the http requests

func MakeMqHandler

func MakeMqHandler(service MqService, logger kitlog.Logger, ml machineLearning.Service) http.Handler

MakeHandler returns a restful http handler for the appdynamics service the Machine Learning service can be set to nil if you do not wish to log the http requests

func NewDisableMqCommand

func NewDisableMqCommand(store Store, telegram telegram.Store, alert alert.Service) telegram.Command

func NewEnableMqCommand

func NewEnableMqCommand(store Store, telegram telegram.Store, alert alert.Service) telegram.Command

Types

type AddAppdynamicsEndpointRequest

type AddAppdynamicsEndpointRequest struct {
	Endpoint string
}

type AddAppdynamicsQueueEndpointRequest

type AddAppdynamicsQueueEndpointRequest struct {
	Name         string
	Application  string
	Metricpath   string
	IgnorePrefix []string `json:"ignore_prefix"`
}

Request object to add a new IBM MQ Queue to be monitored from App Dynamics swagger:model

type AppDynamics

type AppDynamics struct {
	ChatId      uint32 `json:"id" bson:"_id,omitempty"`
	Endpoint    string
	MqEndpoints []*MqEndpoint
}

swagger:model

type AppdynamicsMessage

type AppdynamicsMessage struct {
	Environment string `json:"environment"`
	Policy      struct {
		TriggerTime string `json:"triggerTime"`
		Name        string `json:"name"`
	}
	Events        []Event `json:"events"`
	InvokeCallout bool    `json:"invoke_callout"`
}

swagger:model

type BusinessAlertRequest

type BusinessAlertRequest struct {
	Severity, Type, DisplayName, SummaryMessage string
}

type Event

type Event struct {
	Severity     string `json:"severity"`
	Application  Name
	Tier         Name
	Node         Name
	DisplayName  string `json:"displayName"`
	EventMessage string `json:"eventMessage"`
}

type ExecuteAppDynamicsCommandRequest

type ExecuteAppDynamicsCommandRequest struct {
	CommandName   string `json:"command_name"`
	NodeID        string `json:"node_id"`
	ApplicationID string `json:"application_id"`
}

swagger:model

type MockStore

type MockStore struct {
	// contains filtered or unexported fields
}

MockStore is a mock of Store interface

func NewMockStore

func NewMockStore(ctrl *gomock.Controller) *MockStore

NewMockStore creates a new mock instance

func (*MockStore) EXPECT

func (m *MockStore) EXPECT() *MockStoreMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockStore) GetAppDynamics

func (m *MockStore) GetAppDynamics(chat uint32) (*AppDynamics, error)

GetAppDynamics mocks base method

type MockStoreMockRecorder

type MockStoreMockRecorder struct {
	// contains filtered or unexported fields
}

MockStoreMockRecorder is the mock recorder for MockStore

func (*MockStoreMockRecorder) GetAppDynamics

func (mr *MockStoreMockRecorder) GetAppDynamics(chat interface{}) *gomock.Call

GetAppDynamics indicates an expected call of GetAppDynamics

type MqEndpoint

type MqEndpoint struct {
	Name          string
	Application   string
	MetricPath    string
	Chat          uint32
	MaxMessageAge float64  `json:"max_message_age" bson:"max_message_age"`
	IgnorePrefix  []string `json:"ignore_prefix"`
	Disabled      bool
}

swagger:model

type MqService

type MqService interface {
	// contains filtered or unexported methods
}

func NewMqInstrumentService

func NewMqInstrumentService(counter metrics.Counter, latency metrics.Histogram, s MqService) MqService

func NewMqLoggingService

func NewMqLoggingService(logger log.Logger, s MqService) MqService

func NewMqSercvice

func NewMqSercvice(alertService alert.Service, store Store) MqService

type Name

type Name struct {
	Name string `json:"name"`
}

type Service

type Service interface {
	// contains filtered or unexported methods
}

func NewInstrumentService

func NewInstrumentService(counter metrics.Counter, latency metrics.Histogram, s Service) Service

func NewLoggingService

func NewLoggingService(logger log.Logger, s Service) Service

func NewService

func NewService(alertService alert.Service, sshservice ssh.Service, store Store, callout callout.Service) Service

type Store

type Store interface {
	/*
		GetAppDynamics wll return the app dynamics object in the ob, Else, error if nothing exists.
	*/
	GetAppDynamics(chat uint32) (*AppDynamics, error)
	// contains filtered or unexported methods
}

func NewMongoStore

func NewMongoStore(mongo *mgo.Database) Store

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL