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

[feat] Add skipOptionsValidation or similar for silencing warnings #68

Closed
JamieDanielson opened this issue Feb 12, 2024 · 0 comments · Fixed by #77
Closed

[feat] Add skipOptionsValidation or similar for silencing warnings #68

JamieDanielson opened this issue Feb 12, 2024 · 0 comments · Fixed by #77
Assignees
Labels
type: enhancement New feature or request
Milestone

Comments

@JamieDanielson
Copy link
Contributor

Is your feature request related to a problem? Please describe.

When sending to an OpenTelemetry Collector, you don't want the apiKey in the config because it's in the collector config. However, we emit warnings when an API Key is missing from the config.

Describe the solution you'd like

We can add the skipOptionsValidation config option to silence these warnings, similar to what we have in the node distro.

Describe alternatives you've considered

Maybe a better name or configuration for this?

Additional context

This is listed already in our SDK Configuration and has some parts built but commented out in the repo already.

@JamieDanielson JamieDanielson added the type: enhancement New feature or request label Feb 12, 2024
@JamieDanielson JamieDanielson added this to the Beta milestone Feb 12, 2024
@pkanal pkanal self-assigned this Feb 14, 2024
pkanal added a commit that referenced this issue Feb 16, 2024
## Which problem is this PR solving?

- Closes #68 

Adds validation warnings for options. 
Adds `skipOptionsValidation` option to config. This option is used when
sending directly to a collector so warnings for not providing an
`apiKey` can be suppressed.

## Short description of the changes
- Warns if there is an `apiKey` missing
- Warns if there is a `serviceName` missing
- Warns if a `dataset` is provided but the `apiKey` is a E&S key and a
`serviceName is provided
- Warns if `dataset` is missing if a Classic `apiKey` is provided
- Warns if `sampler` has been overridden
- Adds `skipOptionsValidation` option that doesn't show any of these
warnings if set to `true`, set to `false` by default

## How to verify that this has the expected result
- Run the example app and don't provide an `apiKey`, you should see the
`apiKey` warning and so forth
- Run the example app and set `skipOptionsValidation` to `true`, you
should see the skip options validation message and no other warnings
- Tests pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
2 participants