Skip to content

Commit

Permalink
blog(submit article): run test and format
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanrahic authored and chalin committed Jul 27, 2023
1 parent be8fc6d commit fb017c1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
28 changes: 13 additions & 15 deletions content/en/blog/2023/testing-otel-demo/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@ author: '[Daniel Dias](https://github.com/danielbdias) (Tracetest)'
body_class: otel-with-contributions-from
spelling: cSpell:ignore apiserver choren tracetest kube kubelet containerd
spelling: cSpell:ignore Adnan Rahić Hamric kubetracing healthcheck apparmor
spelling: cSpell:ignore tracetesting oteldemo nanos
---

With contributions from [Adnan Rahić](https://github.com/adnanrahic) and
[Ken Hamric](https://github.com/kdhamric).

The [OpenTelemetry Demo](../../../ecosystem/demo/) is a system
that simulates a Telescope Shop, consisting of multiple microservices written in
different languages, each handling a specific capability of this distributed
system. Its purpose is to demonstrate how
[OpenTelemetry](/) tools and SDKs can be used in an
application to obtain telemetry for monitoring results and even to
[track problems](../../../docs/demo/#scenarios) across multiple
services.
The [OpenTelemetry Demo](../../../ecosystem/demo/) is a system that simulates a
Telescope Shop, consisting of multiple microservices written in different
languages, each handling a specific capability of this distributed system. Its
purpose is to demonstrate how [OpenTelemetry](/) tools and SDKs can be used in
an application to obtain telemetry for monitoring results and even to
[track problems](../../../docs/demo/#scenarios) across multiple services.

One challenge when maintaining the demo is to add new features to the ecosystem
and guarantee that the current features and telemetry work as intended. Thinking
Expand All @@ -38,8 +37,8 @@ greater confidence.
Trace-based testing is a type of testing that validates a system's behavior by
triggering an operation against the system and validating its result by checking
the system output with the emitted
[traces](../../../docs/concepts/signals/traces/) generated by
the system during this call.
[traces](../../../docs/concepts/signals/traces/) generated by the system during
this call.

This term was popularized by Ted Young in the talk
[Trace Driven Development: Unifying Testing and Observability](https://www.youtube.com/watch?v=NU-fTr-udZg)
Expand Down Expand Up @@ -155,8 +154,7 @@ We can see two types of assertions:
`CurrencyService` emitted. It checks if the service received a conversion
operation from USD to CAD by checking if the
[span attributes](../../../docs/concepts/signals/traces/#attributes)
`app.currency.conversion.from` and
`app.currency.conversion.to` have correct
`app.currency.conversion.from` and `app.currency.conversion.to` have correct
values;
- The second assertion is made on a trace span representing the operation
output, where we check if the response body has an attribute `nanos` with a
Expand Down Expand Up @@ -372,7 +370,7 @@ We should pass them as `snake_case`, which the Checkout service does correctly:
By doing that, we have a successful call to the service, and it evaluates
correctly as seen here:

![email-succeess-formated.png](./email-succeess-formated.png)
![email-success-formatted.png](./email-success-formatted.png)

This type of case is interesting because it could happen in other real-world
scenarios, and with the help of the tests and telemetry data, we were able to
Expand All @@ -390,12 +388,12 @@ With these tests, the OpenTelemetry community can add new features to the demo,
have an easy way to validate if other components did not suffer any unwanted
side effects, and still report telemetry correctly.

As a team building an open-source observability tool, we value the opportunity
As a team building an open source observability tool, we value the opportunity
to contribute to the overall OpenTelemetry community. That's why we took action
on [the issue](https://github.com/open-telemetry/opentelemetry-demo/issues/873)
as soon as it was opened two months ago.

Daniel Dias is working on Tracetest, an open-source tool that allows you to
Daniel Dias is working on Tracetest, an open source tool that allows you to
develop and test your distributed system with OpenTelemetry. It works with any
OTel-compatible system and enables trace–based tests to be created. Check it out
at [https://github.com/kubeshop/tracetest](https://github.com/kubeshop/tracetest).
20 changes: 20 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
"StatusCode": 200,
"LastSeen": "2023-06-29T12:27:30.178352-04:00"
},
"https://avajs.dev/": {
"StatusCode": 200,
"LastSeen": "2023-07-18T14:38:02.687502+02:00"
},
"https://aws-otel.github.io": {
"StatusCode": 206,
"LastSeen": "2023-06-29T12:27:13.017869-04:00"
Expand Down Expand Up @@ -2355,6 +2359,22 @@
"StatusCode": 200,
"LastSeen": "2023-06-30T09:23:34.5691-04:00"
},
"https://github.com/open-telemetry/opentelemetry-demo/issues/873": {
"StatusCode": 200,
"LastSeen": "2023-07-18T14:38:00.524443+02:00"
},
"https://github.com/open-telemetry/opentelemetry-demo/pull/877": {
"StatusCode": 200,
"LastSeen": "2023-07-18T14:38:01.810575+02:00"
},
"https://github.com/open-telemetry/opentelemetry-demo/pull/905#discussion_r1207101535": {
"StatusCode": 200,
"LastSeen": "2023-07-18T14:38:05.072723+02:00"
},
"https://github.com/open-telemetry/opentelemetry-demo/pull/950": {
"StatusCode": 200,
"LastSeen": "2023-07-18T14:38:03.839749+02:00"
},
"https://github.com/open-telemetry/opentelemetry-demo/releases": {
"StatusCode": 200,
"LastSeen": "2023-06-30T09:42:09.866812-04:00"
Expand Down

0 comments on commit fb017c1

Please sign in to comment.