Skip to content

Commit

Permalink
opensource.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariane van der Steldt committed Jun 23, 2016
0 parents commit 314fa50
Show file tree
Hide file tree
Showing 369 changed files with 43,039 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
environment:
language: java
language_versions: 1.8.0_60
packages:
- apache_maven-3.1.1
- npm_npm-2015.02.27_20.23
- node-v6.1.0
build:
run: mvn -U clean deploy
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
target
dependency-reduced-pom.xml

.project
.settings
.classpath

# IntelliJ project directories
**/*.idea
**/*.iml
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Copyright (c) 2016, Groupon, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

Neither the name of GROUPON nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Mon-soon
====

An extensible monitor system that checks java processes and exposes metrics based on them.

The project is extensible and allows for new datasources to be created, so it's not just Java it can monitor.

It should be easy to implement a new processor, to direct monitored data to systems other than monitord.

Usage
----

The system uses processors to hook up to external metric and alerting systems.
Processors are what turns the system from a pile of code into a useful component of your production deployment.

Configuration
----

Please refer to the [configuration documentation](doc/config.md).

----

Prometheus Integration
----

The Prometheus exporter will take all jmx metrics and convert them to a format that Prometheus can scrap
[prometheus.jar](doc/prometheus/README.md).



Development
----

Development documentation has its [own section](doc/dev/README.md).
162 changes: 162 additions & 0 deletions api_server/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.groupon.lex</groupId>
<artifactId>monsoon-basepom</artifactId>
<version>1.35-SNAPSHOT</version>
</parent>
<artifactId>monsoon-api</artifactId>
<packaging>jar</packaging>
<name>Mon-soon api server</name>
<url>https://github.com/groupon/monsoon</url>

<scm>
<connection>scm:git:github.com:groupon/monsoon.git</connection>
<developerConnection>scm:git:github.com:groupon/monsoon.git</developerConnection>
<url>https://github.com/groupon/monsoon</url>
<tag>HEAD</tag>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.javadoc.skip>true</maven.javadoc.skip>
<project.build.targetJdk>1.8</project.build.targetJdk>
</properties>

<dependencies>
<dependency>
<groupId>com.groupon.lex</groupId>
<artifactId>monsoon-collector-base</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.groupon.lex</groupId>
<artifactId>monsoon-lib</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.8</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jetty.version}</version>
</dependency>
</dependencies>

<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>target/npm</directory>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerReuseStrategy>alwaysNew</compilerReuseStrategy>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<source>1.8</source>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<index>true</index>
</archive>
</configuration>
</plugin>
<!-- Copy NPM sources pre-compilation. -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>generate-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target/npm/www</outputDirectory>
<resources>
<resource>
<directory>src/main/frontend</directory>
<filtering>false</filtering>
<excludes>
<exclude>node_modules/**</exclude>
<exclude>typings/**</exclude>
<exclude>app/*.js</exclude>
<exclude>app/*.js.map</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>exec-npm-install</id>
<phase>generate-sources</phase>
<configuration>
<executable>npm</executable>
<workingDirectory>target/npm/www</workingDirectory>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
<execution>
<id>exec-npm-tsc</id>
<phase>generate-sources</phase>
<configuration>
<executable>npm</executable>
<workingDirectory>target/npm/www</workingDirectory>
<arguments>
<argument>run-script</argument>
<argument>tsc</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
6 changes: 6 additions & 0 deletions api_server/src/main/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
typings
app/*.js
app/**/*.js
app/**/*.js.map
npm-debug.log
63 changes: 63 additions & 0 deletions api_server/src/main/frontend/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { Component, ViewChild } from '@angular/core';
import { Router, Routes, ROUTER_DIRECTIVES } from '@angular/router';
import { ChartEditComponent } from './chart/chart-edit.component';
import { ChartViewComponent } from './chart/chart-view.component';
import { ChartEditArgumentsService } from './chart/chart-edit-arguments.service';
import { ChartTimeSpecModalComponent } from './chart/chart-time-spec-modal.component';


@Component({
selector: 'my-app',
directives: [ROUTER_DIRECTIVES, ChartTimeSpecModalComponent],
providers: [ChartEditArgumentsService],
styles: [`
.my-app {
width: 100%;
height: 100%;
}
.content-fill {
width: 100%;
height: 100%;
margin-top: -72px;
padding-top: 72px;
}
`],
template: `
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Mon-soon</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a [routerLink]="['/fe/chart-edit', chartEditArguments.value]">Edit Chart</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#" (click)="_chartTimeSpecModal($event)">Change Time</a></li>
</ul>
</div>
</div>
</nav>
<div class="content-fill">
<router-outlet></router-outlet>
</div>
<chart-time-spec-modal #chartTimeSpecModal></chart-time-spec-modal>
`
})
@Routes([
{ path: '/fe/chart-edit', component: ChartEditComponent },
{ path: '/fe/chart-view', component: ChartViewComponent }
])
export class AppComponent {
@ViewChild('chartTimeSpecModal')
chartTimeSpecModal: ChartTimeSpecModalComponent;

constructor(private router: Router,
private chartEditArguments: ChartEditArgumentsService) {
}

_chartTimeSpecModal(event) {
event.preventDefault();
this.chartTimeSpecModal.open();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { EventEmitter, Injectable, Input, Output } from '@angular/core';

@Injectable()
export class ChartEditArgumentsService {
private _cur: Map<string, string> = new Map<string, string>();

@Output('value')
value_event : EventEmitter<Map<string, string>> = new EventEmitter<Map<string, string>>();

@Input('value')
set value(exprs: Map<string, string>) {
this._cur = exprs;
this.value_event.next(exprs);
}
get value(): Map<string, string> {
return this._cur;
}
}
52 changes: 52 additions & 0 deletions api_server/src/main/frontend/app/chart/chart-edit.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { Component } from '@angular/core';
import { ChartExprFormComponent } from './chart-expr-form.component';
import { ChartExpr } from './chart-expr';
import { OnActivate, Router, RouteSegment, RouteTree } from '@angular/router';


@Component({
selector: 'chart-edit',
directives: [ChartExprFormComponent],
styles: [`
.chart-edit {
width: 100%;
height: 100%;
}
`],
template: `
<h1>Monsoon Chart</h1>
<chart-expr-form #form (expr)="onRender($event)" [initial]="exprs"></chart-expr-form>
`
})
export class ChartEditComponent implements OnActivate {
private exprs: Map<string, string> = new Map<string, string>();

constructor(private router: Router) {}

routerOnActivate(curr: RouteSegment, prev?: RouteSegment, currTree?: RouteTree, prevTree?: RouteTree): void {
let exprs: Map<string, string> = new Map<string, string>();

Object.keys(curr.parameters).forEach((enc_k) => {
let k: string = decodeURIComponent(enc_k);
let v: string = decodeURIComponent(curr.getParam(enc_k));
if (k.startsWith("expr:")) {
exprs[k.substr(5)] = v;
}
});
this.exprs = exprs;
}

onRender(m: ChartExpr) {
let args = {};
Object.keys(m.expr).forEach((k) => {
args[this._encode('expr:' + k)] = this._encode(m.expr[k]);
});

this.router.navigate(['/fe/chart-view', args]);
}

_encode(s: string): string {
// Angular cannot handle round brackets in its argument. :'(
return encodeURIComponent(s).replace(/\(/g, '%28').replace(/\)/g, '%29');
}
}
Loading

0 comments on commit 314fa50

Please sign in to comment.