-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WFLY-18943] Fix automated testing of OpenTelemetry QS under OpenShift #870
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: collector-config | ||
data: | ||
collector.yml: | | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
http: | ||
processors: | ||
exporters: | ||
logging: | ||
verbosity: detailed | ||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
processors: [] | ||
exporters: [logging] | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: opentelemetrycollector | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: opentelemetrycollector | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: opentelemetrycollector | ||
spec: | ||
containers: | ||
- name: otelcol | ||
args: | ||
- --config=/conf/collector.yml | ||
image: otel/opentelemetry-collector:0.89.0 | ||
volumeMounts: | ||
- mountPath: /conf | ||
name: collector-config | ||
volumes: | ||
- configMap: | ||
items: | ||
- key: collector.yml | ||
path: collector.yml | ||
name: collector-config | ||
name: collector-config | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: opentelemetrycollector | ||
spec: | ||
ports: | ||
- name: otlp-grpc | ||
port: 4317 | ||
protocol: TCP | ||
targetPort: 4317 | ||
- name: otlp-http | ||
port: 4318 | ||
protocol: TCP | ||
targetPort: 4318 | ||
selector: | ||
app.kubernetes.io/name: opentelemetrycollector | ||
type: ClusterIP | ||
--- | ||
apiVersion: route.openshift.io/v1 | ||
kind: Route | ||
metadata: | ||
name: otelcol-otlp-grpc | ||
labels: | ||
app.kubernetes.io/name: microprofile | ||
spec: | ||
port: | ||
targetPort: otlp-grpc | ||
to: | ||
kind: Service | ||
name: opentelemetrycollector | ||
tls: | ||
termination: edge | ||
insecureEdgeTerminationPolicy: Redirect | ||
wildcardPolicy: None | ||
--- | ||
apiVersion: route.openshift.io/v1 | ||
kind: Route | ||
metadata: | ||
name: otelcol-otlp-http | ||
labels: | ||
app.kubernetes.io/name: microprofile | ||
spec: | ||
port: | ||
targetPort: otlp-http | ||
to: | ||
kind: Service | ||
name: opentelemetrycollector | ||
tls: | ||
termination: edge | ||
insecureEdgeTerminationPolicy: Redirect | ||
wildcardPolicy: None |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
=== Install OpenTelemetry Collector on OpenShift | ||
|
||
The functionality of this quickstart depends on a running instance of the https://opentelemetry.io/docs/collector/[OpenTelemetry Collector]. To deploy and configure the OpenTelemetry Collector, you will need to apply a set of configurations to your OpenShift cluster. In your terminal, run the following command to configure the OpenTelemetry Collector as well as any external routes needed: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO we should not ask them to run the huge command first, here is my suggestion:
|
||
|
||
[source,options="nowrap",subs="+attributes"] | ||
---- | ||
$ oc apply -f - <<EOF | ||
include::charts/opentelemetry-collector.yaml[] | ||
---- | ||
|
||
To make things simpler, you can find these commands in `charts/opentelemetry-collector.yaml`, and can apply them with this command: | ||
|
||
[source] | ||
---- | ||
$ oc apply -f charts/opentelemetry-collector.yaml | ||
---- |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,6 +162,16 @@ | |
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>11</source> | ||
<target>11</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
|
@@ -220,6 +230,9 @@ | |
<layer>jaxrs-server</layer> | ||
<layer>opentelemetry</layer> | ||
</layers> | ||
<plugin-options> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dupe, please remove this change |
||
<jboss-fork-embedded>true</jboss-fork-embedded> | ||
</plugin-options> | ||
<cli-sessions> | ||
<cli-session> | ||
<script-files> | ||
|
@@ -264,14 +277,19 @@ | |
<layer>jaxrs-server</layer> | ||
<layer>opentelemetry</layer> | ||
</layers> | ||
<filename>ROOT.war</filename> | ||
<packaging-scripts> | ||
<packaging-script> | ||
<scripts> | ||
<script>${basedir}/configure-opentelemetry.cli</script> | ||
</scripts> | ||
<commands> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO it is preferable to use the cli script, since that is used also for baremetal config. I did some tests with Openshift Local and a modified branch of and the following worked fine:
|
||
<command>/subsystem=opentelemetry:write-attribute(name=endpoint,value=http://\${OTEL_COLLECTOR_HOST}:4317)</command> | ||
<command>/subsystem=opentelemetry:write-attribute(name=exporter-type,value=otlp)</command> | ||
<command>/subsystem=opentelemetry:write-attribute(name=sampler-type,value=on)</command> | ||
<command>/subsystem=opentelemetry:write-attribute(name=max-queue-size,value=1)</command> | ||
<command>/subsystem=opentelemetry:write-attribute(name=max-export-batch-size,value=512)</command> | ||
</commands> | ||
<resolve-expressions>false</resolve-expressions> | ||
</packaging-script> | ||
</packaging-scripts> | ||
<name>ROOT.war</name> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, the openshift profile is used by default.