Skip to content

Commit 69d6220

Browse files
Copilottrask
andcommitted
Remove fibonacci endpoint per specification - keep implementation minimal
Co-authored-by: trask <218610+trask@users.noreply.github.com>
1 parent a4a9fd5 commit 69d6220

File tree

6 files changed

+8
-169
lines changed

6 files changed

+8
-169
lines changed

reference-application/E2E-TEST.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ The test verifies:
4949
- `GET /rolldice` - Basic dice rolling
5050
- `GET /rolldice?player=testuser` - Parameterized requests
5151
- `GET /rolldice?rolls=3` - Multiple dice rolls
52-
- `GET /fibonacci?n=10` - Computational example
5352
- `GET /health` - Health check
54-
- `GET /actuator/prometheus` - Metrics export
5553

5654
### OpenTelemetry Integration
5755
- Java Agent instrumentation

reference-application/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ The reference application is a dice rolling service that demonstrates OpenTeleme
2222
- `GET /rolldice` - Basic dice roll (returns random 1-6)
2323
- `GET /rolldice?player=<name>` - Dice roll for a specific player
2424
- `GET /rolldice?rolls=<n>` - Roll multiple dice
25-
- `GET /fibonacci?n=<number>` - Calculate fibonacci (demonstrates computation tracing)
2625
- `GET /health` - Health check endpoint
27-
- `GET /metrics` - Prometheus metrics endpoint (when enabled)
2826

2927
### Scenarios Demonstrated
3028

@@ -56,7 +54,7 @@ Then test the endpoints:
5654
```shell
5755
curl http://localhost:8080/rolldice
5856
curl http://localhost:8080/rolldice?player=alice
59-
curl http://localhost:8080/fibonacci?n=10
57+
curl http://localhost:8080/rolldice?rolls=3
6058
```
6159

6260
### Running with OpenTelemetry Collector

reference-application/TELEMETRY-TESTING.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,15 @@ Uses OpenTelemetry protocol buffers to parse captured requests:
3030

3131
### Traces
3232
- **HTTP spans**: Automatic instrumentation spans (e.g., `GET /rolldice`)
33-
- **Custom spans**: Manual spans created in application code (e.g., `roll-dice`, `fibonacci-calculation`)
33+
- **Custom spans**: Manual spans created in application code (e.g., `roll-dice`)
3434
- **Span hierarchy**: Parent-child relationships between spans
35-
- **Attributes**: Custom attributes like `dice.player`, `fibonacci.n`
36-
- **Events**: Custom events like `dice-rolled`, `fibonacci-calculated`
35+
- **Attributes**: Custom attributes like `dice.player`, `dice.rolls`
36+
- **Events**: Custom events like `dice-rolled`
3737
- **Error handling**: Exception recording and error status
3838

3939
### Metrics
40-
- **Custom counters**: `dice_rolls_total`, `fibonacci_calculations_total`
41-
- **Custom timers**: `dice_roll_duration_seconds`, `fibonacci_duration_seconds`
42-
- **Micrometer integration**: Metrics created via Micrometer and exported via OpenTelemetry
40+
- **Custom counters**: `dice_rolls_total`
41+
- **OpenTelemetry metrics**: Metrics created via OpenTelemetry API and exported by the Java Agent
4342

4443
### Baggage
4544
- **Cross-cutting data**: Player names, request types
@@ -59,7 +58,7 @@ public void testDiceRollTelemetry() {
5958
var spans = extractSpansFromRequests(requests);
6059
assertThat(spans)
6160
.extracting(Span::getName)
62-
.contains("GET /rolldice", "roll-dice", "roll-single-die");
61+
.contains("GET /rolldice", "roll-dice");
6362
});
6463
}
6564
```

reference-application/src/main/java/io/opentelemetry/example/FibonacciController.java

Lines changed: 0 additions & 134 deletions
This file was deleted.

reference-application/src/test/java/io/opentelemetry/example/ReferenceApplicationTests.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,6 @@ void testRollMultipleDice() throws Exception {
6262
assertEquals(3, json.get("results").size());
6363
}
6464

65-
@Test
66-
void testFibonacci() throws Exception {
67-
ResponseEntity<String> response =
68-
restTemplate.getForEntity("http://localhost:" + port + "/fibonacci?n=10", String.class);
69-
70-
assertEquals(200, response.getStatusCode().value());
71-
72-
JsonNode json = objectMapper.readTree(response.getBody());
73-
assertEquals(10, json.get("n").asInt());
74-
assertEquals("55", json.get("result").asText());
75-
}
76-
7765
@Test
7866
void testHealth() throws Exception {
7967
ResponseEntity<String> response =

reference-application/test-e2e.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,6 @@ test_endpoints() {
7777
return 1
7878
fi
7979

80-
# Test fibonacci endpoint
81-
print_status "Testing /fibonacci?n=10 endpoint..."
82-
response=$(curl -sf "http://localhost:8080/fibonacci?n=10")
83-
if echo "$response" | jq -r '.result' | grep -q "55"; then
84-
print_status "✓ /fibonacci endpoint working"
85-
else
86-
print_error "✗ /fibonacci endpoint failed"
87-
return 1
88-
fi
89-
9080
# Test health endpoint
9181
print_status "Testing /health endpoint..."
9282
response=$(curl -sf http://localhost:8080/health)
@@ -125,7 +115,7 @@ test_collector() {
125115

126116
# Generate some telemetry data
127117
curl -sf http://localhost:8080/rolldice > /dev/null
128-
curl -sf http://localhost:8080/fibonacci?n=5 > /dev/null
118+
curl -sf http://localhost:8080/rolldice?rolls=3 > /dev/null
129119

130120
# Wait a bit for data to be processed
131121
sleep 5

0 commit comments

Comments
 (0)