Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods for capturing spans in our SDK #8473

Open
ccschmitz opened this issue May 6, 2024 — with Linear · 2 comments
Open

Add methods for capturing spans in our SDK #8473

ccschmitz opened this issue May 6, 2024 — with Linear · 2 comments

Comments

Copy link
Contributor

Allow SDK users to start sending custom spans to Highlight.

Copy link

linear bot commented May 6, 2024

Copy link

greptile-apps bot commented May 6, 2024

To implement methods for capturing custom spans across our SDKs, follow these steps tailored to each SDK's language and architecture, ensuring consistency and adherence to OpenTelemetry standards where applicable.

Rust SDK

  • Add a start_span method in the Highlight struct. This method should accept parameters like name, attributes, and start_time. Use the OpenTelemetry Rust SDK to start a new span with these parameters.
  • Implement an end_span method to close the span and send it to Highlight.

Node.js SDK

  • In client.ts, introduce a startSpan function that initializes a new span using the OpenTelemetry API. Parameters should include name, attributes, and optionally startTime.
  • Add an endSpan method to finalize the span and export it.

Cloudflare Workers SDK

  • Modify sdk.ts to include a startSpan method, leveraging the Workers environment to create spans. This method should mirror the parameters and functionality of the Node.js SDK.
  • Implement an endSpan function to conclude and dispatch the span data.

Java SDK

  • In the Java SDK, introduce a startSpan method within the Highlight class. This method should create a new span with OpenTelemetry Java API, accepting similar parameters as the Rust and Node.js SDKs.
  • Add an endSpan method to complete and send the span information.

General Implementation Notes

  • Ensure that all SDKs include error handling within the span methods to capture any issues during span creation or completion.
  • Consider adding utility methods for common span operations, such as setting attributes or events, to simplify the API.
  • Update the SDK documentation to include examples and best practices for using the new span capturing methods.

This approach ensures a unified and standard way of handling custom spans across different environments, making it easier for users to integrate and leverage the full capabilities of the Highlight platform.

References

highlight/highlight/docs-content/sdk/rust.md
highlight/highlight/sdk/highlight-node/src/client.ts
highlight/highlight/sdk/highlight-cloudflare/src/sdk.ts
highlight/highlight/docs-content/sdk/java.md
highlight/highlight/docs-content/sdk/client.md
highlight/highlight/docs-content/general/4_company/open-source/contributing/adding-an-sdk.md
highlight/highlight/sdk/highlight-py/highlight_io/integrations/fastapi.py
highlight/highlight/sdk/client/src/index.tsx
highlight/highlight/sdk/highlight-py/highlight_io/sdk.py
highlight/highlight/sdk/highlight-ruby/highlight/lib

Ask Greptile

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

No branches or pull requests

1 participant