Skip to content

Instantly share code, notes, and snippets.

View jpkrohling's full-sized avatar
🌱
Gardening

Juraci Paixão Kröhling jpkrohling

🌱
Gardening
View GitHub Profile
@jpkrohling
jpkrohling / centos-origin-ansible-logging-metrics.sh
Last active June 9, 2017 14:51
Provision CentOS and install Origin with Logging and Metrics via Ansible
###### This is not a shell script that you just execute and everything works.
###### There are two sections: one to run on your host, and one to run on the VM
###### On the host, there's a manual step
###### On the VM, you can just copy/paste, perhaps pausing before the Ansible command itself
## provision the VM
IMAGES_DIR="/mnt/storage/jpkroehling/Tools/images"
LOGGING_HOSTNAME="logging.dev.kroehling.de"
@jpkrohling
jpkrohling / swarm-1398-without-installer.diff
Created June 16, 2017 09:26
SWARM-1398 PR without the Installer class
diff --git a/fractions/opentracing/src/main/java/org/wildfly/swarm/opentracing/deployment/OpenTracingInitializer.java b/fractions/opentracing/src/main/java/org/wildfly/swarm/opentracing/deployment/OpenTracingInitializer.java
index 0e4bead71..cbd26004b 100644
--- a/fractions/opentracing/src/main/java/org/wildfly/swarm/opentracing/deployment/OpenTracingInitializer.java
+++ b/fractions/opentracing/src/main/java/org/wildfly/swarm/opentracing/deployment/OpenTracingInitializer.java
@@ -20,7 +20,6 @@ import io.opentracing.contrib.tracerresolver.TracerResolver;
import io.opentracing.util.GlobalTracer;
import org.jboss.logging.Logger;
-import javax.enterprise.inject.Vetoed;
import javax.servlet.ServletContextEvent;
@jpkrohling
jpkrohling / opentracing-jaeger-prometheus-openshift.sh
Last active June 30, 2017 08:04
Metric collection using OpenTracing, sending spans to Jaeger and metrics to Prometheus, deployed on OpenShift
oc cluster up --version=latest
oc login -u system:admin
oc adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:myproject:prometheus-operator
oc adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:myproject:default
oc create -f https://raw.githubusercontent.com/coreos/prometheus-operator/master/bundle.yaml
oc create -f prometheus-kubernetes.yml
oc create route edge prometheus --service=prometheus
oc process -f https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/master/all-in-one/jaeger-all-in-one-template.yml -p IMAGE_VERSION=latest | oc create -f -
cd simple
mvn clean install docker:build
@jpkrohling
jpkrohling / rhsso-on-openshift.sh
Created July 14, 2017 09:36
Red Hat SSO on OpenShift
SECRETS_KEYSTORE_PASSWORD=$(openssl rand -base64 512 | tr -dc A-Z-a-z-0-9 | head -c 17)
oc cluster up --version=latest
oc login -u system:admin
oc new-project redhat-sso
oc create serviceaccount sso-service-account
oc policy add-role-to-user view system:serviceaccount:redhat-sso:sso-service-account
oc create -n openshift -f https://raw.githubusercontent.com/jboss-openshift/application-templates/ose-v1.3.7/jboss-image-streams.json
for template in sso71-https.json \
sso71-mysql-persistent.json \
@jpkrohling
jpkrohling / pom.xml
Created July 26, 2017 09:35
fraction dependencies
<dependencies>
<!-- Java EE 7 dependency -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<!-- WildFly Swarm Fractions -->
<!-- WildFly Swarm Fractions -->
/opt/hawkular/scripts/hawkular-metrics-wrapper.sh \
-b \
0.0.0.0 \
-Dhawkular.metrics.cassandra.nodes=hawkular-cassandra \
-Dhawkular.metrics.cassandra.use-ssl \
-Dhawkular.metrics.openshift.auth-methods=openshift-oauth,htpasswd \
-Dhawkular.metrics.openshift.htpasswd-file=/secrets/hawkular-metrics.htpasswd.file \
-Dhawkular.metrics.allowed-cors-access-control-allow-headers=authorization \
-Dhawkular.metrics.default-ttl=7 \
-Dhawkular-alerts.cassandra-nodes=hawkular-cassandra \
@jpkrohling
jpkrohling / publish-to-github-release.rb
Created August 17, 2017 10:05
Hawkular Services pipeline script to publish artifacts on a GitHub release
#!/usr/bin/env ruby
require 'rest-client'
require 'json'
require 'open-uri'
require 'digest'
organization = 'hawkular'
repository = 'hawkular-services'
@Test
public void concurrentParents() {
IntStream.rangeClosed(1, 150).parallel().forEach(i -> {
// each iteration is like a request
try (ActiveSpan parent = tracer.buildSpan("parent_" + i).startActive()) {
jdbcTemplate.execute("select 1");
}
});
// for each request, we have one extra span, the jdbc one
@jpkrohling
jpkrohling / travis.yaml
Last active August 31, 2017 12:01
matrix
sudo: required
dist: trusty
language: java
jdk:
- oraclejdk8
env:
- VER=3.3.0
- VER=3.4.0
- VER=3.5.0.Beta1
/// original
@Metric(
name = "baggage-update",
tags = {@Tag(key = "result", value = "err")}
)
// Number of times baggage failed to write or update on spans
public Counter baggageUpdateFailure;
/// new version