Skip to content

Commit 116d0c1

Browse files
committed
address review comments from Claude Code
1 parent 6e86f88 commit 116d0c1

3 files changed

Lines changed: 29 additions & 10 deletions

File tree

README.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,36 @@
33
[![](https://images.microbadger.com/badges/image/dwolla/otel-collector.svg)](https://microbadger.com/images/dwolla/otel-collector)
44
[![license](https://img.shields.io/github/license/dwolla/dwolla-adot-collector.svg?style=flat-square)](https://github.com/Dwolla/dwolla-adot-collector/blob/master/LICENSE)
55

6-
Docker image that adds Dwolla's configuration to the AWS distribution of OpenTelemetry collector.
6+
Custom OpenTelemetry Collector distribution with AWS components and Dwolla-specific processors.
7+
8+
## Why a Custom Build?
9+
10+
This distribution builds upon the AWS Distro for OpenTelemetry (ADOT) by adding:
11+
12+
1. **Transform Processor** - Enables efficient pattern replacement in span attributes (e.g., replacing `!` with `:` in `peer.service`)
13+
2. **Link Extractor Processor** - Custom processor that extracts linked trace IDs from OpenTelemetry span links and copies them to span attributes
14+
15+
### The Link Extractor Problem
16+
17+
AWS X-Ray does not natively support OpenTelemetry's [span links](https://opentelemetry.io/docs/concepts/signals/traces/#span-links) concept. When traces reference other traces via links, this relationship is lost when exported to X-Ray.
18+
19+
The `linkextractor` processor solves this by:
20+
- Extracting trace IDs from `span.links`
21+
- Copying them to a `linked_trace_ids` attribute on the span
22+
- Making these relationships visible in X-Ray as indexed attributes
23+
24+
This allows Dwolla to maintain trace relationships and query for linked traces in X-Ray.
725

826
## Local Development
927

10-
With [jq](https://jqlang.github.io/jq/manual/) installed, to build this image locally run the following command:
28+
To build this image locally:
29+
30+
```bash
31+
make all
32+
```
33+
34+
For multi-architecture builds:
1135

1236
```bash
13-
make \
14-
OTEL_TAG=$(curl --silent https://api.github.com/repos/aws-observability/aws-otel-collector/releases/latest | jq -r .name) \
15-
all
37+
make PLATFORM=linux/arm64,linux/amd64 OUTPUT=--push all
1638
```

pkg/processor/linkprocessor/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ func createTracesProcessor(
3333
nextConsumer consumer.Traces,
3434
) (processor.Traces, error) {
3535
processorConfig := cfg.(*Config)
36-
return newLinkProcessor(processorConfig, set.Logger, nextConsumer)
36+
return newLinkProcessor(processorConfig, nextConsumer)
3737
}

pkg/processor/linkprocessor/processor.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,15 @@ import (
88
"go.opentelemetry.io/collector/consumer"
99
"go.opentelemetry.io/collector/pdata/ptrace"
1010
"go.opentelemetry.io/collector/processor"
11-
"go.uber.org/zap"
1211
)
1312

1413
type linkProcessor struct {
15-
logger *zap.Logger
1614
nextConsumer consumer.Traces
1715
attributeName string
1816
}
1917

20-
func newLinkProcessor(cfg *Config, logger *zap.Logger, next consumer.Traces) (processor.Traces, error) {
18+
func newLinkProcessor(cfg *Config, next consumer.Traces) (processor.Traces, error) {
2119
return &linkProcessor{
22-
logger: logger,
2320
nextConsumer: next,
2421
attributeName: cfg.AttributeName,
2522
}, nil

0 commit comments

Comments
 (0)