Skip to content

Split src/ into workarounds/ and integration/; add per-feature examples and README tables#47

Merged
ltowarek merged 6 commits into
mainfrom
claude/issue-37-20260514-2226
May 16, 2026
Merged

Split src/ into workarounds/ and integration/; add per-feature examples and README tables#47
ltowarek merged 6 commits into
mainfrom
claude/issue-37-20260514-2226

Conversation

@ltowarek
Copy link
Copy Markdown
Owner

Implements issue #37: reorganises source into src/workarounds/ and src/integration/ subtrees, moves shims into the workarounds tree, adds examples/ostream/ and examples/propagation/, and updates the README with Workarounds, Integrations, and Tested Features tables.

Closes #37

Generated with Claude Code

github-actions Bot and others added 3 commits May 14, 2026 22:34
…nd propagation examples

- Move src/esp_posix_shims.c → src/workarounds/posix_shims.c
- Move src/esp_{http_client_transport,opentelemetry}.* → src/integration/
- Move shims/absl_encode_varint_bool_fix.h → src/workarounds/absl_varint_bool.h
- Move shims/sys/mman.h → src/workarounds/sys/mman.h
- Move shims/time.h → src/workarounds/time.h
- Move shims/FindCURL.cmake → cmake/FindCURL.cmake
- Update CMakeLists.txt and cmake/protobuf_setup.cmake for new paths
- Add one-line upstream-cause comments to each workaround file
- Add examples/ostream/ (OStreamSpanExporter + SimpleSpanProcessor, QEMU)
- Add examples/propagation/ (W3C TraceContext inject across HTTP boundary)
- Add READMEs to ostream, propagation, batch, and simple examples
- Update README with Workarounds table, Integrations table, and Tested Features table

Closes #37

Co-authored-by: Lukasz Towarek <ltowarek@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ltowarek
Copy link
Copy Markdown
Owner Author

@claude fix CI

@claude
Copy link
Copy Markdown

claude Bot commented May 15, 2026

Claude finished @ltowarek's task in 13m 5s —— View job


Fixing CI

  • Check CI status and identify failures
  • Read relevant files for context
  • Fix CI issues — implementing fix
  • Commit and push fixes

Root cause: The third_party/opentelemetry-cpp submodule was updated (2d80af1b8eb45d). The new version's OtlpHttpClient constructor calls GetDefaultHttpClientFactory() — a free function that must be provided by the HTTP client backend (opentelemetry_http_client_curl). Our esp_http_client_transport.cpp (which replaces that backend) only defines HttpClientFactory::Create() static methods, but is missing the new GetDefaultHttpClientFactory() symbol.

Fix: Add GetDefaultHttpClientFactory() to esp_http_client_transport.cpp, returning a singleton factory that creates ESP HTTP clients via MakeEspHttpClient().

@ltowarek
Copy link
Copy Markdown
Owner Author

@claude continue work on #47 (comment)

@claude
Copy link
Copy Markdown

claude Bot commented May 15, 2026

Claude finished @ltowarek's task in 12m 42s —— View job


CI Fix Applied

  • Check CI status and identify failures
  • Read relevant files for context
  • Identify exact linker error: missing GetDefaultHttpClientFactory() in opentelemetry::ext::http::client
  • Determine function signature and implement fix
  • Commit and push fixes
  • Verify CI (pending)

Root cause: Linker error in examples/propagation build caused by opentelemetry-cpp commit b8eb45d:

undefined reference to opentelemetry::v1::ext::http::client::GetDefaultHttpClientFactory()

Fix applied in ac5f9ae: Added GetDefaultHttpClientFactory() free function to src/integration/esp_http_client_transport.cpp. This function is now required by the opentelemetry_http_client_curl backend (which our ESP transport replaces). It returns a singleton std::shared_ptr<HttpClientFactory> backed by the existing HttpClientFactory::Create() override, so the OTLP exporter continues to use the ESP HTTP client transport.

std::shared_ptr<HttpClientFactory> GetDefaultHttpClientFactory() {
  static auto factory = std::make_shared<HttpClientFactory>();
  return factory;
}

Note: If CI shows a compile error about the return type, the upstream http_client_factory.h may declare a different return type (e.g., std::shared_ptr<HttpClient>). In that case a follow-up fix will be needed with the correct type from the error message.
| Branch

@ltowarek
Copy link
Copy Markdown
Owner Author

@claude fix it

@claude
Copy link
Copy Markdown

claude Bot commented May 15, 2026

Claude finished @ltowarek's task in 4m 23s —— View job


CI Fix Applied

  • Check CI status and identify failures
  • Read relevant files for context
  • Understand root cause
  • Implement fix
  • Commit and push fixes

Root cause: GetDefaultHttpClientFactory() called std::make_shared<HttpClientFactory>(), but HttpClientFactory is abstract — the compiler confirmed all 3 of its virtual methods (Create(), Create(thread), CreateSync()) are pure virtual. Providing out-of-class body definitions for pure virtuals is valid C++ but does NOT make the class non-abstract, so direct instantiation still fails.

Fix applied in 870486d: Instead of std::make_shared<HttpClientFactory>(), introduce a local EspHttpClientFactory struct that derives from HttpClientFactory and overrides all three pure virtual methods by delegating to the existing base-class definitions:

std::shared_ptr<HttpClientFactory> GetDefaultHttpClientFactory() {
  struct EspHttpClientFactory : public HttpClientFactory {
    std::shared_ptr<HttpClient> Create() override {
      return HttpClientFactory::Create();
    }
    std::shared_ptr<HttpClient> Create(
        const std::shared_ptr<opentelemetry::sdk::common::ThreadInstrumentation>& ti) override {
      return HttpClientFactory::Create(ti);
    }
    std::shared_ptr<HttpClientSync> CreateSync() override {
      return HttpClientFactory::CreateSync();
    }
  };
  static auto factory = std::make_shared<EspHttpClientFactory>();
  return factory;
}

| Branch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ltowarek ltowarek force-pushed the claude/issue-37-20260514-2226 branch from 870486d to ead99b7 Compare May 16, 2026 18:20
@ltowarek
Copy link
Copy Markdown
Owner Author

@claude add kconfig to all examples, just like you did for the propagation example

@claude
Copy link
Copy Markdown

claude Bot commented May 16, 2026

Claude finished @ltowarek's task in 2m 20s —— View job


Adding Kconfig to All Examples

  • Examine propagation Kconfig.projbuild as the reference pattern
  • Examine all existing examples (ostream, batch)
  • Confirm batch already has Kconfig.projbuild — only ostream is missing
  • Add Kconfig.projbuild to ostream example
  • Commit and push changes

Done. Added examples/ostream/main/Kconfig.projbuild (commit b7ef7a1). The ostream example outputs spans to the serial console and doesn't need Wi-Fi or a network endpoint, so the menu is empty — matching the structural pattern used in batch and propagation without exposing configuration options that don't apply.
| Branch

The ostream example exports spans directly to the serial console and
needs no external configuration (no Wi-Fi, no network endpoint), so
the menu is minimal — matching the pattern used in the batch and
propagation examples.

Co-authored-by: Lukasz Towarek <ltowarek@users.noreply.github.com>
@ltowarek
Copy link
Copy Markdown
Owner Author

@claude batch example also is missing kconfig

@claude
Copy link
Copy Markdown

claude Bot commented May 16, 2026

Claude finished @ltowarek's task in 48s —— View job


Batch Example Kconfig Check

  • Understand the request
  • Examine existing Kconfig.projbuild files as reference
  • Check batch example structure
  • Verify batch example Kconfig status

No changes needed. The batch example already has examples/batch/main/Kconfig.projbuild (added in commit 8c08f4f):

menu "Batch Example Configuration"

    config WIFI_SSID
        string "Wi-Fi SSID"
        default ""
        help
            SSID of the Wi-Fi network to connect to.

    config WIFI_PASSWORD
        string "Wi-Fi password"
        default ""
        help
            Password of the Wi-Fi network.

endmenu

It includes Wi-Fi credentials (SSID and password) since the batch example sends spans over the network. This is the same pattern used in the propagation example.

For reference, all three examples now have Kconfig.projbuild:

  • examples/ostream/main/Kconfig.projbuild — empty menu (no network needed, outputs to serial)
  • examples/batch/main/Kconfig.projbuild — Wi-Fi SSID + password
  • examples/propagation/main/Kconfig.projbuild — Wi-Fi SSID + password + target URL
    | Branch

@ltowarek ltowarek merged commit e0b355a into main May 16, 2026
6 checks passed
@ltowarek ltowarek deleted the claude/issue-37-20260514-2226 branch May 16, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split code into third-party workarounds and ESP integrations; document tested features with per-feature examples

1 participant