-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The user event service enables aggregating the metric events sent on `events` topic and expose them as Prometheus (or Kamon) metrics. Out of the box dashboards are provided for the Grafana/Prometheus mode which provide detailed insights on performance metrics at cluster/namespace/action level.
- Loading branch information
Showing
37 changed files
with
4,139 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* | ||
!transformEnvironment.sh | ||
!init.sh | ||
!build/distributions | ||
!Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
FROM scala | ||
|
||
ENV UID=1001 \ | ||
NOT_ROOT_USER=owuser | ||
|
||
# Copy app jars | ||
ADD build/distributions/user-events.tar / | ||
|
||
COPY init.sh / | ||
RUN chmod +x init.sh | ||
|
||
RUN adduser -D -u ${UID} -h /home/${NOT_ROOT_USER} -s /bin/bash ${NOT_ROOT_USER} | ||
USER ${NOT_ROOT_USER} | ||
|
||
# Prometheus port | ||
EXPOSE 9095 | ||
CMD ["./init.sh", "0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!-- | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
--> | ||
|
||
# ![OpenWhisk User Events](https://raw.githubusercontent.com/apache/openwhisk/master/core/monitoring/user-events/images/demo_landing.png) | ||
|
||
# OpenWhisk User Events | ||
|
||
This service connects to `events` topic and publishes the events to various services like Prometheus, Datadog etc via Kamon. Refer to [user specific metrics][1] on how to enable them. | ||
|
||
|
||
## Local Run | ||
>First configure and run `openwhisk docker-compose` that can be found in the [openwhisk-tools][2] project. | ||
- Start service inside the cluster (on the same docker-compose network: `openwhisk_default`) | ||
- The service will be available on port `9095` | ||
- The endpoint for exposing the metrics for Prometheus can be found on `/metrics`. | ||
|
||
## Usage | ||
|
||
The service needs the following env variables to be set | ||
|
||
- `KAFKA_HOSTS` - For local env it can be set to `172.17.0.1:9093`. When using [OpenWhisk Devtools][2] based setup use `kafka` | ||
|
||
Integrations | ||
------------ | ||
|
||
#### Prometheus | ||
The docker container would run the service and expose the metrics in format required by [Prometheus][3] at `9095` port | ||
|
||
#### Grafana | ||
The `Openwhisk - Action Performance Metrics` Grafana[4] dashboard is available on localhost port `3000` at this address: | ||
http://localhost:3000/d/Oew1lvymk/openwhisk-action-performance-metrics | ||
|
||
The latest version of the dashboard can be found in the "compose/dashboard/openwhisk_events.json" | ||
|
||
[1]: https://github.com/apache/incubator-openwhisk/blob/master/docs/metrics.md#user-specific-metrics | ||
[2]: https://github.com/apache/incubator-openwhisk-devtools/tree/master/docker-compose | ||
[3]: https://hub.docker.com/r/prom/prometheus/ | ||
[4]: https://hub.docker.com/r/grafana/grafana/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
apply plugin: 'scala' | ||
apply plugin: 'application' | ||
apply plugin: 'org.scoverage' | ||
|
||
ext.dockerImageName = 'user-events' | ||
apply from: "../../../gradle/docker.gradle" | ||
distDocker.dependsOn ':common:scala:distDocker', 'distTar' | ||
|
||
project.archivesBaseName = "openwhisk-user-events" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile "org.scala-lang:scala-library:${gradle.scala.version}" | ||
compile project(':common:scala') | ||
|
||
compile 'com.typesafe.akka:akka-stream-kafka_2.12:0.22' | ||
|
||
compile 'io.prometheus:simpleclient:0.6.0' | ||
compile 'io.prometheus:simpleclient_common:0.6.0' | ||
|
||
testCompile 'junit:junit:4.11' | ||
testCompile 'org.scalatest:scalatest_2.12:3.0.1' | ||
testCompile 'net.manub:scalatest-embedded-kafka_2.12:2.0.0' | ||
testCompile 'com.typesafe.akka:akka-testkit_2.12:2.5.17' | ||
testCompile 'com.typesafe.akka:akka-stream-testkit_2.12:2.5.17' | ||
testCompile 'com.typesafe.akka:akka-http-testkit_2.12:10.1.5' | ||
} | ||
|
||
tasks.withType(ScalaCompile) { | ||
scalaCompileOptions.additionalParameters = gradle.scala.compileFlags | ||
} | ||
|
||
mainClassName = "org.apache.openwhisk.core.monitoring.metrics.Main" |
Oops, something went wrong.