Skip to content

Commit 92fde87

Browse files
Observability lab (#183)
* inventory-helidon fix * mongodb install * mongodm * mongodb install * mongodm * mongodm * mongo-kafka-postgres work * mongodb-kafka-postgres work * mongo * postgres work * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongo etc work * mongo kafka postgres work * mongo kafka postgres work * mongo kafka postgres work * removed sqlnet.ora edit * removed sqlnet.ora edit * removed sqlnet.ora edit * dotnet docker work and password/url fix * dotnet docker work and password/url fix * dotnet docker work and password/url fix * dotnet docker work and password/url fix * dotnet docker work and password/url fix * dotnet docker work and password/url fix * dotnet docker work and password/url fix * dotnet docker work and password/url fix * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * remove sqlnet.ora edit work * recovery test work * recovery test work * recovery test work * recovery test work * replace postgres configmap with secret * replace postgres configmap with secret * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * TEQ setup and tracing * mongo, postgres, kafka crash tests * mongo, postgres, kafka crash tests * grafana work * grafana work * grafana work * grafana work * grafana work * grafana work * observability work * observability work * observability work * observability work * observability work * observability work * observability work * observability work * observability work * observability work * observability work * dotnet work * dotnet work * dotnet work * dotnet work * dotnet work * observability, dotnet, go, etc. work - move kafka etc. build to nonjava * observability, dotnet, go, etc. work - move kafka etc. build to nonjava * observability, dotnet, go, etc. work - move kafka etc. build to nonjava * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * observability * enable teq * enable teq * enable teq
1 parent 8eeb4eb commit 92fde87

File tree

117 files changed

+13801
-790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+13801
-790
lines changed

.vscode/settings.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

grabdish/docs/AutoTest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export TEST_USER_OCID='ocid1.user.oc1..xxxxx'
3030
export GITHUB_BRANCH='main'
3131
export GITHUB_USER='myghuser'
3232
export TEST_DB_PASSWORD='Welcome12345;#!:'
33-
export TEST_UI_PASSWORD='Welcome1;#!"'
33+
export TEST_UI_PASSWORD='Welcome1;#!:"'
3434
```
3535

3636
6. Clone the code

grabdish/env.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ alias secrets='kubectl get secrets --all-namespaces'
5757
alias ingresssecret='kubectl get secrets --all-namespaces | grep istio-ingressgateway-certs'
5858
alias virtualservices='kubectl get virtualservices --all-namespaces'
5959
alias deployments='kubectl get deployments --all-namespaces'
60+
alias servicemonitors='kubectl get servicemonitors --all-namespaces'
61+
alias configmaps='kubectl get configmaps --all-namespaces'
6062
alias msdataworkshop='echo deployments... ; deployments|grep msdataworkshop ; echo pods... ; pods|grep msdataworkshop ; echo services... ; services | grep msdataworkshop ; echo secrets... ; secrets|grep msdataworkshop ; echo "other shortcut commands... most can take partial podname as argument, such as [logpod front] or [deletepod order]... pods services secrets deployments "'
6163

6264
export PATH=$PATH:$GRABDISH_HOME/utils/

grabdish/frontend-helidon/build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ SCRIPT_DIR=$(dirname $0)
1010
IMAGE_NAME=frontend-helidon
1111
IMAGE_VERSION=0.1
1212

13-
export DOCKER_REGISTRY=$(state_get DOCKER_REGISTRY)
13+
if [ -z "$DOCKER_REGISTRY" ]; then
14+
echo "DOCKER_REGISTRY not set. Will get it with state_get"
15+
export DOCKER_REGISTRY=$(state_get DOCKER_REGISTRY)
16+
fi
1417

15-
if [ -z "DOCKER_REGISTRY" ]; then
18+
if [ -z "$DOCKER_REGISTRY" ]; then
1619
echo "Error: DOCKER_REGISTRY env variable needs to be set!"
1720
exit 1
1821
fi
1922

2023
export IMAGE=${DOCKER_REGISTRY}/${IMAGE_NAME}:${IMAGE_VERSION}
2124

22-
# mvn install
23-
# mvn package docker:build
2425
mvn package
2526

2627
docker push $IMAGE
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: monitoring.coreos.com/v1
2+
kind: ServiceMonitor
3+
metadata:
4+
name: prometheus-frontend
5+
labels:
6+
release: stable
7+
spec:
8+
endpoints:
9+
- interval: 5s
10+
port: metrics
11+
selector:
12+
matchLabels:
13+
app: frontend
14+
15+
#apiVersion: monitoring.coreos.com/v1
16+
#kind: ServiceMonitor
17+
#metadata:
18+
# name: prometheus-frontend
19+
# labels:
20+
# release: stable
21+
#spec:
22+
# endpoints:
23+
# - interval: 5s
24+
# port: https
25+
# scheme: https
26+
# tlsConfig:
27+
# insecureSkipVerify: true
28+
# basicAuth:
29+
# password:
30+
# name: frontendadmin
31+
# key: password
32+
# username:
33+
# name: frontendadmin
34+
# key: user
35+
# selector:
36+
# matchLabels:
37+
# app: frontend

grabdish/frontend-helidon/frontend-service.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ metadata:
1212
# service.beta.kubernetes.io/oci-load-balancer-ssl-ports: "443"
1313
# service.beta.kubernetes.io/oci-load-balancer-tls-secret: ssl-certificate-secret
1414
spec:
15-
#type: LoadBalancer
15+
# type: LoadBalancer
1616
type: ClusterIP
1717
ports:
1818
- port: 80
19-
name: http
19+
name: metrics
2020
targetPort: 8080
2121
selector:
2222
app: frontend

grabdish/frontend-helidon/pom.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,23 @@
129129
<groupId>io.helidon.microprofile.bundles</groupId>
130130
<artifactId>helidon-microprofile</artifactId>
131131
</dependency>
132-
<!--tracing-->
133132
<dependency>
134133
<groupId>io.helidon.tracing</groupId>
135134
<artifactId>helidon-tracing-jaeger</artifactId>
136135
</dependency>
136+
<dependency>
137+
<groupId>io.helidon.metrics</groupId>
138+
<artifactId>helidon-metrics</artifactId>
139+
</dependency>
140+
<dependency>
141+
<groupId>io.helidon.tracing</groupId>
142+
<artifactId>helidon-tracing-jaeger</artifactId>
143+
</dependency>
144+
<!-- <dependency>-->
145+
<!-- <groupId>io.helidon.metrics</groupId>-->
146+
<!-- <artifactId>helidon-metrics-trace-exemplar</artifactId>-->
147+
<!-- <scope>runtime</scope>-->
148+
<!-- </dependency>-->
137149
<dependency>
138150
<groupId>org.jboss</groupId>
139151
<artifactId>jandex</artifactId>

grabdish/frontend-helidon/src/main/java/io/helidon/data/examples/FrontEndResource.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import io.opentracing.Tracer;
1616
import org.eclipse.microprofile.auth.LoginConfig;
1717
import org.eclipse.microprofile.config.inject.ConfigProperty;
18+
import org.eclipse.microprofile.metrics.annotation.Counted;
19+
import org.eclipse.microprofile.metrics.annotation.Timed;
1820
import org.eclipse.microprofile.opentracing.Traced;
1921

2022
import javax.annotation.security.DeclareRoles;
@@ -188,8 +190,10 @@ public Response jsResources(@PathParam("path") final String path) {
188190
@POST
189191
@Consumes(MediaType.APPLICATION_JSON)
190192
@Produces(MediaType.APPLICATION_JSON)
191-
@Traced(operationName = "Frontend.placeOrder")
192193
@Path("/placeorder")
194+
@Traced(operationName = "Frontend.placeOrder")
195+
@Timed(name = "frontend_placeOrder_timed") //length of time of an object
196+
@Counted(name = "frontend_placeOrder_counted") //amount of invocations
193197
public String placeorder(Command command) {
194198
try {
195199
System.out.println("FrontEndResource.serviceName " + command.serviceName);
@@ -247,7 +251,9 @@ public String command(Command command) {
247251
@Consumes(MediaType.APPLICATION_JSON)
248252
@Produces(MediaType.TEXT_PLAIN)
249253
@Traced(operationName = "FrontEnd.getmetrics")
250-
@Path("/metrics")
254+
@Path("/getmetrics")
255+
//not to be confused with the /metrics of this frontend service,
256+
// this is a call through to a service (can be any service but the frontend only calls order service) to get and display it's metrics
251257
public String getMetrics(Command command) {
252258
String urlString = "http://" + command.serviceName + ".msdataworkshop:8080/" + command.commandName;
253259
System.out.println("FrontEndResource.getMetrics url:" + urlString);

grabdish/frontend-helidon/src/main/resources/web/index.html

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ <h1 class="oj-sm-only-hide oj-web-applayout-header-title" title="Application Nam
147147
<br><br>
148148
<br>Transactional Exactly-Once Message Delivery Tests...
149149
<br>
150-
<oj-button disabled="[[inProgress]]" on-oj-action="[[lab11CrashAfterInsertAction]]">Crash order service after Order is inserted (before Order message is sent to Inventory service)</oj-button>
150+
<oj-button disabled="[[inProgress]]" on-oj-action="[[lab11CrashAfterInsertAction]]">Crash Order service after Order is inserted (before Order message is sent to Inventory service)</oj-button>
151151
<br><oj-button disabled="[[inProgress]]" on-oj-action="[[lab11CrashAfterOrderMessageReceivedAction]]">Crash Inventory service after Order message is received (before inventory for order is checked)</oj-button>
152152
<br><oj-button disabled="[[inProgress]]" on-oj-action="[[lab11CrashAfterOrderMessageProcessedAction]]">Crash Inventory service after inventory for order is checked (before Inventory status message is sent)</oj-button>
153+
<br><oj-button disabled="[[inProgress]]" on-oj-action="[[lab11CrashAfterInventoryMessageReceivedAction]]">Crash Order service after Inventory message is received (before Order status is updated)</oj-button>
153154
</div>
154155
<!-- lab10 -->
155156
<div slot="lab10">
@@ -674,7 +675,7 @@ <h1 class="oj-sm-only-hide oj-web-applayout-header-title" title="Application Nam
674675
body: JSON.stringify(order)
675676
};
676677

677-
fetch('/metrics', fetchOptions).then(fetchResult => {
678+
fetch('/getmetrics', fetchOptions).then(fetchResult => {
678679
vm.httpCode(fetchResult.status);
679680
fetchResult.text().then(payload => {
680681
vm.labResult(payload);
@@ -880,6 +881,30 @@ <h1 class="oj-sm-only-hide oj-web-applayout-header-title" title="Application Nam
880881
});
881882
};
882883

884+
this.lab11CrashAfterInventoryMessageReceivedAction = function (event, vm) {
885+
vm.inProgress(true);
886+
var order = {
887+
serviceName: 'order',
888+
commandName: 'crashAfterInventoryMessageReceived',
889+
orderId: -1,
890+
orderItem: '',
891+
deliverTo: ''
892+
};
893+
var fetchOptions = {
894+
method: 'POST',
895+
headers: { 'Content-Type': 'application/json' },
896+
body: JSON.stringify(order)
897+
};
898+
899+
fetch('/command', fetchOptions).then(fetchResult => {
900+
vm.httpCode(fetchResult.status);
901+
fetchResult.text().then(payload => {
902+
vm.labResult(payload);
903+
vm.inProgress(false);
904+
});
905+
});
906+
};
907+
883908

884909
// Footer
885910
this.footerLinks = [

grabdish/inventory-dotnet/build.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55

66
IMAGE_NAME=inventory-dotnet
77
IMAGE_VERSION=0.1
8-
export DOCKER_REGISTRY=$(state_get DOCKER_REGISTRY)
9-
if [ -z "DOCKER_REGISTRY" ]; then
8+
9+
if [ -z "$DOCKER_REGISTRY" ]; then
10+
echo "DOCKER_REGISTRY not set. Will get it with state_get"
11+
export DOCKER_REGISTRY=$(state_get DOCKER_REGISTRY)
12+
fi
13+
14+
if [ -z "$DOCKER_REGISTRY" ]; then
1015
echo "Error: DOCKER_REGISTRY env variable needs to be set!"
1116
exit 1
1217
fi

0 commit comments

Comments
 (0)