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 support for per-signal urls #56

Merged
merged 7 commits into from
Aug 12, 2024

Conversation

tatchi
Copy link
Contributor

@tatchi tatchi commented Aug 2, 2024

This PR adds support for per-signal URLs configuration. See https://opentelemetry.io/docs/specs/otel/protocol/exporter/#endpoint-urls-for-otlphttp

I've only modified the ocurl client for now to reduce diff. Once approved, I can make the same changes for the lwt client

@tatchi tatchi requested review from c-cube and mattjbray as code owners August 2, 2024 09:38
Comment on lines -6 to -10
val get_url : unit -> string

val set_url : string -> unit
(** Url of the endpoint. Default is "http://localhost:4318",
or "OTEL_EXPORTER_OTLP_ENDPOINT" if set. *)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to be able to change urls after setup? If so, I can re-introduce set_url_{traces,metrics,logs}.

For getters, I'm wondering if that's needed, one can always do:

let config = ref (Config.make ())

(* and then somewhere else *)
let url_traces = !config.url_traces

Or am I missing something ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be able to live without it. I'll double check but we normally use with_setup only which should be safe.

Copy link
Member

@c-cube c-cube left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a really good change, thank you!

src/client-ocurl/config.mli Outdated Show resolved Hide resolved
src/client-ocurl/common_.ml Show resolved Hide resolved
Comment on lines -6 to -10
val get_url : unit -> string

val set_url : string -> unit
(** Url of the endpoint. Default is "http://localhost:4318",
or "OTEL_EXPORTER_OTLP_ENDPOINT" if set. *)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be able to live without it. I'll double check but we normally use with_setup only which should be safe.

@tatchi
Copy link
Contributor Author

tatchi commented Aug 5, 2024

Thanks for the review, I've applied the same changes to the cohttp-lwt lib

src/client-ocurl/config.ml Outdated Show resolved Hide resolved
@c-cube c-cube merged commit 4f6cf08 into imandra-ai:main Aug 12, 2024
3 checks passed
@c-cube
Copy link
Member

c-cube commented Aug 12, 2024

Thank you :)

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.

2 participants