-
Notifications
You must be signed in to change notification settings - Fork 1
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
Not easy to configure Exporters with block #23
Comments
Yep. The examples cover this, though they don't explain why. e.x. OpenTelemetry.configure do |config|
config.service_name = "Fibonacci Server"
config.service_version = Fibonacci::VERSION
config.exporter = OpenTelemetry::Exporter.new(variant: :http) do |exporter|
exporter = exporter.as(OpenTelemetry::Exporter::Http)
exporter.endpoint = "https://otlp.nr-data.net:4318/v1/traces"
headers = HTTP::Headers.new
headers["api-key"] = ENV["NEW_RELIC_LICENSE_KEY"]?.to_s
exporter.headers = headers
end
end That There may well be a better solution, but I have not gone back into that part of the code to see if something better comes to mind yet. I am open to suggestions. |
I have a fix. It may not be the best fix, but I have a fix.
|
@wyhaines what do you think also to support configure option via Hash argument? Example:
It would potentialy cover the case of configuring Exporters via environment variables as well. |
That gets deceptively tricky. Every exporter would have to have a method that can take an options hash and use it for configuration, and I'm not sure what the benefit would be. Keyword args do work, and I do think that they look better than options hashes. Can you tell me what benefit that you see to hash based initialization? |
I think to not replace current one, but to add as seperate method. Here is something that helped me in other projects:
My proposal is not critical at all, because the solution you advised in #23 (comment) should cover Types' issue and would support minimum required solution. |
Here is an example of the code:
it raises the error:
it makes sense that Stdout, because Stdout does not implement Batch processor.
Currently workaroud:
The text was updated successfully, but these errors were encountered: