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

Mostly fix json schema generation for otel config. #607

Merged
merged 4 commits into from
Mar 10, 2022

Conversation

BrynCooke
Copy link
Contributor

This is such a big part of the config that it's worth having.

Previously we were short circuiting the schema mechanism as there various types are reused from Otel and these do not have schema generation.

It's possible that the schema is a little too lenient, and would allow invalid config for custom attributes or headers, but mostly it is OK.

This is such a big part of the config that it's worth having.
It's possible that the schema is a little too lenient, and would allow invalid config for custom attributes or headers, but mostly it is OK.
@BrynCooke BrynCooke requested a review from garypen March 10, 2022 11:13
@github-actions

This comment has been minimized.

Copy link
Contributor

@garypen garypen left a comment

Choose a reason for hiding this comment

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

Naming is hard...

Comment on lines +117 to +126
#[derive(JsonSchema)]
#[allow(dead_code)]
enum ProtocolMirror {
/// GRPC protocol
Grpc,
// HttpJson,
/// HTTP protocol with binary protobuf
HttpBinary,
}

Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: I presume this is a restricted copy of the telemetry Protocol struct which only contains the protocols we support.

In which case, maybe rename to ImplementedProtocol or RestrictedProtocol or ProtocolSubset...?

(It's definitely not a Mirror and that name doesn't give much of a hint about its purpose.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not even that, it is an exact copy of the otel struct. I'll add a comment though.

Add comment to say what a mirror enum is used for.
@BrynCooke BrynCooke merged commit 3e42bf6 into main Mar 10, 2022
@BrynCooke BrynCooke deleted the bryn/reporting-json-schema branch March 10, 2022 15:03
@abernix abernix mentioned this pull request Mar 16, 2022
@BrynCooke BrynCooke self-assigned this Mar 25, 2022
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.

3 participants