Skip to content

Commit f396317

Browse files
committed
Merge from master
2 parents fad8938 + 9b7040b commit f396317

File tree

98 files changed

+3501
-1004
lines changed

Some content is hidden

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

98 files changed

+3501
-1004
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: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,45 @@ 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

3333
```shell
3434
mkdir my-test-telemetry
3535
cd my-test-telemetry
3636
curl -O -L https://github.com/cisco-open/test-telemetry-generator/releases/latest/download/test-telemetry-generator-otel-proto-0.18.0-fatjar.jar
37-
curl -O https://raw.githubusercontent.com/cisco-open/test-telemetry-generator/master/example-definitions/entity-definition.yaml
38-
curl -O https://raw.githubusercontent.com/cisco-open/test-telemetry-generator/master/example-definitions/trace-definition.yaml
37+
curl -O https://raw.githubusercontent.com/cisco-open/test-telemetry-generator/master/example-definitions/simple/resource-definition.yaml
38+
curl -O https://raw.githubusercontent.com/cisco-open/test-telemetry-generator/master/example-definitions/simple/trace-definition.yaml
3939
curl -O https://raw.githubusercontent.com/cisco-open/test-telemetry-generator/master/example-definitions/cli-target-rest.yaml
4040
```
4141

4242
Your `my-test-telemetry` directory should now contain the following files:
4343

4444
```shell
4545
$ ls
46-
cli-target-rest.yaml entity-definition.yaml test-telemetry-generator-otel-proto-0.18.0-fatjar.jar trace-definition.yaml
46+
cli-target-rest.yaml resource-definition.yaml test-telemetry-generator-otel-proto-0.18.0-fatjar.jar trace-definition.yaml
4747
```
4848

4949
Next, open the `cli-target-rest.yml` with an editor of your choice and set the `restURL` to your OTLP HTTP endpoint. For example, if you use an [OpenTelemetry
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+
# Set authmode to 'basic' and uncomment username & password if you need authentication
55+
# username: "your-username"
56+
# password: "your-password"
57+
restURL:
58+
baseURL: "http://localhost:4318"
59+
metricsPath: "/v1/metrics"
60+
logsPath: "/v1/logs"
61+
tracesPath: "/v1/traces"
5662
```
5763
5864
Finally, start the test-telemetry-generator:
5965
6066
```shell
61-
java -jar test-telemetry-generator-otel-proto-0.18.0-fatjar.jar -e entity-definition.yaml -s trace-definition.yaml -t cli-target-rest.yaml
67+
java -jar test-telemetry-generator-otel-proto-0.18.0-fatjar.jar -r resource-definition.yaml -s trace-definition.yaml -t cli-target-rest.yaml
6268
```
6369

6470
If all goes well, you should see test-telemetry-generator printing out some logs for you:

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626
api group: 'org.projectlombok', name: 'lombok', version: '1.18.20'
2727
api group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.13.2'
2828
api group: 'io.opentelemetry.proto', name: 'opentelemetry-proto', version: '0.18.0-alpha'
29-
api group: 'io.opentelemetry', name: 'opentelemetry-sdk-trace', version: '1.12.0'
29+
api group: 'io.opentelemetry', name: 'opentelemetry-sdk-trace', version: '1.17.0'
3030
api group: 'com.google.guava', name: 'guava', version: 'r05'
3131
api group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'
3232
api group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'

example-definitions/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
| [json](./json) | An example in JSON format |
11+
| [qa](./qa) | A complex example that is used for running quality assurance tests against an OTLP backend |
12+
13+
14+
Note that the target configuration does not change across examples, so you can
15+
use the same [grpc](./cli-target-grpc.yaml) or [rest](./cli-target-rest.yaml)
16+
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: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
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:
6+
baseURL: "http://localhost:4318"
7+
metricsPath: "/v1/metrics"
8+
logsPath: "/v1/logs"
9+
tracesPath: "/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+
resources:
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"]))'
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"globalPayloadFrequencySeconds": 30,
3+
"logs": [
4+
{
5+
"attributes": {
6+
"log.labels": "{\"generator\": roundRobin([\"Telemetry-Generator\", \"Telemetry-Generator-v2\"]), \"type\": \"k8s\"}"
7+
},
8+
"severityOrderFunction": "severityDistributionCount([\"INFO\", \"ERROR\", \"DEBUG\"], [1, 2, 3])",
9+
"payloadFrequencySeconds": 20,
10+
"payloadCount": 10,
11+
"copyCount": 1000,
12+
"reportingResourcesCounts": {
13+
"container": 10,
14+
"pod": 10
15+
}
16+
},
17+
{
18+
"severityOrderFunction": "severityDistributionCount([\"ERROR\", \"WARN\", \"DEBUG\"], [1, 1, 4])",
19+
"payloadFrequencySeconds": 20,
20+
"payloadCount": 2,
21+
"copyCount": 200,
22+
"reportingResourcesCounts": {
23+
"node": 30
24+
}
25+
},
26+
{
27+
"severityOrderFunction": "severityDistributionPercentage([\"INFO\", \"TRACE\"], [20, 80])",
28+
"payloadFrequencySeconds": 10,
29+
"payloadCount": 5,
30+
"reportingResourcesCounts": {
31+
"ec2": 4,
32+
"container": 150
33+
}
34+
}
35+
]
36+
}

0 commit comments

Comments
 (0)