Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
- name: Setup Spin
uses: fermyon/actions/spin/setup@v1
with:
version: "v3.6.1"
version: "v4.0.0"

- name: Run Tests
run: just test
3 changes: 1 addition & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,4 @@ test:
@cd go && go test ./...

# Test: Integration tests
# TODO: Until this issue is taken care of, these will continue to fail: https://github.com/bytecodealliance/opentelemetry-wasi/issues/45
# @cargo test --manifest-path integration_tests/Cargo.toml
@cargo test --manifest-path integration_tests/Cargo.toml
2 changes: 1 addition & 1 deletion go/examples/spin-basic/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ component = "go-spin-basic"
source = "main.wasm"
key_value_stores = ["default"]
[component.go-spin-basic.build]
command = "go tool componentize-go build"
command = "go mod tidy && go tool componentize-go build"
watch = ["**/*.go", "go.mod"]
11 changes: 10 additions & 1 deletion integration_tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ mod tests {
let child = Command::new("spin")
.env("OTEL_EXPORTER_OTLP_ENDPOINT", self.collector_endpoint)
.env("OTEL_EXPORTER_OTLP_PROTOCOL", "grpc")
// Reduce BatchSpanProcessor export interval to 100ms
.env("OTEL_BSP_SCHEDULE_DELAY", "100")
.args(["up", "--experimental-wasi-otel", "-f", self.path])
.spawn()?;

Expand Down Expand Up @@ -340,9 +342,16 @@ mod tests {

/// Recursively parse the children of an `ExportedSpan` into a `SpanTree`.
fn build_node(parent: &'a ExportedSpan, all_spans: &'a [ExportedSpan]) -> Self {
let children: Vec<SpanTree<'a>> = all_spans
let mut child_spans: Vec<&'a ExportedSpan> = all_spans
.iter()
.filter(|e| e.parent_span_id == parent.span_id)
.collect();

// If the spans aren't sorted, the `span_paternity_test` might return a false negative
child_spans.sort_by_key(|s| s.start_time_unix_nano);

let children: Vec<SpanTree<'a>> = child_spans
.into_iter()
.map(|child| Self::build_node(child, all_spans))
.collect();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ expression: log_data
body: "AnyValue { value: Some(StringValue(\"Hello from Go!\")) }"
attributes: {}
dropped_attributes_count: 0
flags: 0
flags: 1
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
source: src/lib.rs
expression: log_data
---
- trace_id: "[trace_id:len(0)]"
span_id: "[span_id:len(0)]"
- trace_id: "[trace_id:len(32)]"
span_id: "[span_id:len(16)]"
observed_time_unix_nano: "[timestamp]"
severity_number: 9
severity_text: INFO
body: "AnyValue { value: Some(StringValue(\"Hello from TypeScript!\")) }"
attributes: {}
dropped_attributes_count: 0
flags: 0
flags: 1
Loading