Skip to content

Commit 235391e

Browse files
authored
Add simple & demo example (#51)
Signed-off-by: svrnm <[email protected]> Signed-off-by: svrnm <[email protected]>
1 parent da6ccdc commit 235391e

13 files changed

+252
-18
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
.DS_Store
44
build
55
/logs
6-
gradle/wrapper/gradle-wrapper.jar
6+
bin
7+
gradle/wrapper/gradle-wrapper.jar

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This tools can be added to your code as a dependency or executed from the comman
2626

2727
## Quickstart
2828

29-
For a quick start with a basic setup you can download the [latest fat-jar](https://github.com/cisco-open/test-telemetry-generator/releases/download/latest/test-telemetry-generator-otel-proto-0.18.0-fatjar.jar) and [example definitions](./example-definitions/) and put them all into one directory.
29+
For a quick start with a basic setup you can download the [latest fat-jar](https://github.com/cisco-open/test-telemetry-generator/releases/download/latest/test-telemetry-generator-otel-proto-0.18.0-fatjar.jar) and [example definitions](./example-definitions/) and put them all into one directory. We recommend that you start with the [simple example definitions](./example-definitions/simple/).
3030

3131
You can do all of that in the command line using [curl](https://curl.se/) like the following:
3232

@@ -50,9 +50,8 @@ Next, open the `cli-target-rest.yml` with an editor of your choice and set the `
5050
Collector](https://opentelemetry.io/docs/collector/) running on `localhost` with an `otlp` receiver listening on port `4318`, update your target config to look like the following:
5151

5252
```yaml
53-
username: "ignored"
54-
password: "ignored"
55-
restURL: "http://localhost:4318/v1/traces"
53+
authMode: none
54+
restURL: http://localhost:4318/v1/traces
5655
```
5756
5857
Finally, start the test-telemetry-generator:

example-definitions/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Example Definitions
2+
3+
In the subfolders you will find different sets of example definitions you can use
4+
with the test-telemetry-generator:
5+
6+
| Folder | Description |
7+
|--------|-------------|
8+
| [simple](./simple) | A very simple example, start here to learn how to use test-telemetry-generator |
9+
| [demo](./demo) | An example that simulates (parts of) the [OpenTelemetry demo](https://github.com/open-telemetry/opentelemetry-demo) |
10+
| [qa](./qa) | A complex example that is used for running quality assurance tests against an OTLP backend |
11+
12+
13+
Note that the target configuration does not change across examples, so you can
14+
use the same [grpc](./cli-target-grpc.yaml) or [rest](./cli-target-rest.yaml)
15+
configuration in all cases.
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
authMode: "basic"
2-
username: "your-username"
3-
password: "your-password"
4-
grpchost: "target-gRPC-host"
5-
grpcport: "target-gRPC-port"
1+
authMode: none
2+
# Set authmode to 'basic' and uncomment username & password if you need authentication
3+
# username: "username"
4+
# password: "password"
5+
grpchost: "localhost"
6+
grpcport: "4317"
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
authMode: "basic"
2-
username: "your-username"
3-
password: "your-password"
4-
restURL: "target-rest-URL"
1+
authMode: "none"
2+
# Set authmode to 'basic' and uncomment username & password if you need authentication
3+
# username: "your-username"
4+
# password: "your-password"
5+
restURL: "http://localhost:4318/v1/traces"
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#
2+
# Copyright 2022 AppDynamics Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
entities:
18+
- name: frontend
19+
count: 3
20+
childrenDistribution:
21+
frontend_instance: distribution(1, 1, 1)
22+
attributes:
23+
service.name: '"frontend"'
24+
service.namespace: '"opentelemetry-demo"'
25+
- name: frontend_instance
26+
count: 6
27+
attributes:
28+
telemetry.sdk.name: '"opentelemetry"'
29+
telemetry.sdk.language: '"nodejs"'
30+
telemetry.sdk.version: counter('1.2.')
31+
attributeOperations:
32+
- 'copyFromParent("container", "container.name")'
33+
- 'copyFromParent("container", "container.id")'
34+
- 'copyFromParent("frontend", "service.name")'
35+
- 'copyFromParent("frontend", "telemetry.sdk.language")'
36+
- 'copyFromParent("frontend", "service.namespace")'
37+
- 'modifyFromParent("frontend", "service.name", "service.instance_id", "counter(\"-\")")'
38+
- name: checkout
39+
count: 3
40+
childrenDistribution:
41+
checkout_instance: distribution(1, 1, 1)
42+
attributes:
43+
service.name: '"checkout"'
44+
service.namespace: '"opentelemetry-demo"'
45+
- name: checkout_instance
46+
count: 6
47+
attributes:
48+
telemetry.sdk.name: '"opentelemetry"'
49+
telemetry.sdk.language: '"go"'
50+
telemetry.sdk.version: counter('1.3.')
51+
attributeOperations:
52+
- 'copyFromParent("container", "container.name")'
53+
- 'copyFromParent("container", "container.id")'
54+
- 'copyFromParent("checkout", "service.name")'
55+
- 'copyFromParent("checkout", "telemetry.sdk.language")'
56+
- 'copyFromParent("checkout", "service.namespace")'
57+
- 'modifyFromParent("checkout", "service.name", "service.instance_id", "counter(\"-\")")'
58+
- name: email
59+
count: 3
60+
childrenDistribution:
61+
email_instance: distribution(1, 1, 1)
62+
attributes:
63+
service.name: '"email"'
64+
service.namespace: '"opentelemetry-demo"'
65+
- name: email_instance
66+
count: 6
67+
attributes:
68+
telemetry.sdk.name: '"opentelemetry"'
69+
telemetry.sdk.language: '"ruby"'
70+
telemetry.sdk.version: counter('0.1.')
71+
attributeOperations:
72+
- 'copyFromParent("container", "container.name")'
73+
- 'copyFromParent("container", "container.id")'
74+
- 'copyFromParent("email", "service.name")'
75+
- 'copyFromParent("email", "telemetry.sdk.language")'
76+
- 'copyFromParent("email", "service.namespace")'
77+
- 'modifyFromParent("email", "service.name", "service.instance_id", "counter(\"-\")")'
78+
- name: currency
79+
count: 3
80+
childrenDistribution:
81+
currency_instance: distribution(1, 1, 1)
82+
attributes:
83+
service.name: '"currency"'
84+
service.namespace: '"opentelemetry-demo"'
85+
- name: currency_instance
86+
count: 6
87+
attributes:
88+
telemetry.sdk.name: '"opentelemetry"'
89+
telemetry.sdk.language: '"cpp"'
90+
telemetry.sdk.version: counter('0.1.')
91+
attributeOperations:
92+
- 'copyFromParent("container", "container.name")'
93+
- 'copyFromParent("container", "container.id")'
94+
- 'copyFromParent("currency", "service.name")'
95+
- 'copyFromParent("currency", "telemetry.sdk.language")'
96+
- 'copyFromParent("currency", "service.namespace")'
97+
- 'modifyFromParent("currency", "service.name", "service.instance_id", "counter(\"-\")")'
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# Copyright 2022 AppDynamics Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
traceCompletionTimeoutSecs: 120
18+
rootSpans:
19+
- name: "checkout"
20+
spanKind: SPAN_KIND_SERVER
21+
reportingResource: frontend_instance
22+
attributes:
23+
http.method: '"POST"'
24+
http.url: '"/checkout/".concat(UUIDFromStringCounter("checkout"))'
25+
childSpans: ["doCheckout"]
26+
payloadCount: 10
27+
copyCount: 5
28+
childSpans:
29+
- name: doCheckout
30+
errorFrequency: 5
31+
reportingResource: checkout_instance
32+
spanKind: SPAN_KIND_SERVER
33+
childSpans: ["sendEmail", "convertCurrency"]
34+
attributes:
35+
http.method: '"POST"'
36+
http.url: '"/api/v1/checkout/".concat(UUIDFromStringCounter("checkout"))'
37+
- name: sendEmail
38+
reportingResource: email_instance
39+
spanKind: SPAN_KIND_SERVER
40+
attributes:
41+
http.method: '"POST"'
42+
http.url: '"/sendEmail"'
43+
- name: convertCurrency
44+
errorFrequency: 7
45+
reportingResource: currency_instance
46+
spanKind: SPAN_KIND_SERVER
47+
attributes:
48+
http.method: '"GET"'
49+
http.url: '"/currency/convert/".concat(roundRobin(["YEN","BZR"])).concat("/").concat(roundRobin(["EUR", "USD"]))'

example-definitions/entity-definition.yaml renamed to example-definitions/qa/entity-definition.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ entities:
2929
managed_replicaset: 'distribution(2, 0, 0)'
3030
workload: 'distribution(3, 5, 5)'
3131
attributes:
32-
k8s.namespace.name: 'counter("namesxace")'
32+
k8s.namespace.name: 'counter("namespace")'
3333
attributeOperations:
3434
- 'copyFromParent("cluster", "k8s.cluster.name")'
3535
- name: node
@@ -101,7 +101,7 @@ entities:
101101
attributes:
102102
k8s.replicaset.uid: 'alphanumericSequence("remodel").concat(".managed_replicaset")'
103103
k8s.replicaset.owner.name: 'alphanumericSequence("dpprep").concat(".replicaset-owner")'
104-
k8s.namespace.name: 'counter("namesxace")'
104+
k8s.namespace.name: 'counter("namespace")'
105105
k8s.cluster.name: '"cluster-".concat(alphanumericSequence("dppteam"))'
106106
k8s.replicaset.name: 'alphanumericSequence("nrec").concat(".replicaset")'
107107
k8s.workload.kind: 'roundRobin(["managed_replicaset"])'
@@ -158,7 +158,7 @@ entities:
158158
container.id: 'alphanumericSequence("iz1").concat("xr1f79").concat(alphanumericSequence("i5q")).concat("1v0dka4appd07oc11v0dka4appd07oc11v0dka4appd07oc1peak")'
159159
container.id.short: 'alphanumericSequence("iz1").concat("xr1f79").concat(alphanumericSequence("i5q"))'
160160
container.name: 'alphanumericSequence("omat").concat(".container")'
161-
container.image.name: '"dtr.corp.appdynamics.com/".concat(roundRobin(["cps", "dpp", "dis", "fmm"])).concat("/").concat(alphanumericSequence("a1sat34x"))'
161+
container.image.name: '"dtr.corp.example.com/".concat(roundRobin(["cps", "dpp", "dis", "fmm"])).concat("/").concat(alphanumericSequence("a1sat34x"))'
162162
attributeOperations:
163163
- 'copyFromParent("pod", "k8s.namespace.name")'
164164
- 'copyFromParent("pod", "k8s.pod.name")'
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)