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

wip: Add settings for the things that used to be env-vars #6

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lf-
Copy link
Owner

@lf- lf- commented Oct 22, 2022

broken since the settings don't seem to be applying properly.

@lheckemann

@lheckemann
Copy link
Collaborator

lheckemann commented Oct 24, 2022

So what's happening currently is, I think:

  • Nix reads config files
    • Plugins setting is loaded
    • nix-otel settings are loaded and not recognised
  • Plugin is loaded by initPlugins()
    • nix-otel plugin is loaded
      • [with the change I've made] OtelConfig is instantiated
      • GlobalConfig::Register is instantiated, registering settings
      • PluginInstance is instantiated, initialising the plugin
    • initPlugins reapplies unknown settings, leading to the settings being actually set

IOW, the instantiation of the plugin happens before the settings are available. We need a way to pass the parameters into the Rust side after initialisation -- and a way to deal with them not being available yet...

I'm extremely unfamiliar with Rust/C++ FFI. Additionally, I'm not sure there's any way in which Nix communicates to a plugin that settings are fully loaded, so we might even need to add a hook inside Nix for that :/

And as if that weren't already enough Fun, I think I've discovered a bug in Nix's settings handling as far as plugins and command-line options are given. Usually, command-line settings like --option otel-otlp-endpoint foo override settings in nix.conf. But apparently, they don't for settings defined by plugins!?

Maybe we should stick with environment variables.

johnrichardrinehart pushed a commit to johnrichardrinehart/nix-otel that referenced this pull request Oct 29, 2023
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