Skip to content

cfggen: recognize comments in the struct while generating output #4751

@Dentrax

Description

@Dentrax

Is your proposal related to a problem?

As we discussed with @saswatamcode at PR #4749, the problem simply identifies that we had better to improve the tracing configuration doc as we proposed at #4748.

(Write your answer here.)

Describe the solution you'd like

We have to do some enhancements in the scripts/cfggen to make that tool recognize the comments.

Let's assume we have the following config struct:

// Config - YAML configuration.
type Config struct {
  // Foo used for to store string
  Foo  string   `yaml:"foo"`
  // Bar used for to store bool
  // true by default
  Bar  bool     `yaml:"bar"`
  // Baz used for to store float64
  Baz  float64  `yaml:"baz"`
}

cfggen should generate the following yaml snippet:

type: JAEGER
config:
  # Foo used for to store string
  foo: ""
  # Bar used for to store bool
  # true by default
  bar: false
  # Baz used for to store float64
  baz: 0

Describe alternatives you've considered

We can add Markdown table in below for each configuration like the following:

Property Description
sampler_type The sampler type: remote , const , probabilistic , ratelimiting (default remote). More information

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions