open-telemetry / opentelemetry-collector

OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
4.5k stars 1.48k forks source link

[cmd/mdatagen] Add support for declaring feature gates in metadata.yaml file #11634

Open mx-psi opened 1 year ago

mx-psi commented 1 year ago

Component(s)

cmd/mdatagen

Describe the issue you're reporting

Components can use feature gates to have support for experimental functionality. We can add these to metadata.yaml together with a description. This information can then be used for code generation, documentation generation and by other consumers of the metadata.yaml file (e.g. it could be useful for a remote management system that wants to show a list of available feature gates).

Note that some feature gates do not fit a specific component (e.g. some of the ones we have in the core distro, or the one on pkg/translator/prometheus). These would not be listed for now.

Follow up tasks for individual components once support for this is available:

github-actions[bot] commented 1 year ago

Pinging code owners for cmd/mdatagen: @dmitryax. See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-actions[bot] commented 1 year ago

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

psk001 commented 1 year ago

Hi @mx-psi , is this issue still up for grab? Can I take it?

mx-psi commented 1 year ago

Hi @mx-psi , is this issue still up for grab? Can I take it?

Sure, feel free to work on it @psk001 :) The first step is to make the necessary changes on cmd/mdatagen to support this, by adding the new feature gates section.

cc @mackjmr since you were also interested on this one

psk001 commented 1 year ago

Great, starting with it

psk001 commented 1 year ago

Needed a little help on it, I am referring to featureGate in opentelemetry-collector. Is this the correct way to implement it?

mx-psi commented 1 year ago

@psk001 yes, that's what we are talking about :) We would need to define an equivalent YAML schema to then generate the code that creates a feature gate for each of the components listed above

psk001 commented 1 year ago

Great, on it

psk001 commented 1 year ago

Components can use feature gates to have support for experimental functionality. We can add these to metadata.yaml together with a description.

In the metadata.yaml file , is this how it should be added ?

feature-gates:
  SplitTraces:
    description: |
      It returns one ptrace.
      Traces for each trace in the given ptrace.Traces input. Each of the resulting ptrace.Traces contains exactly one trace.

  SplitLogs:
    description: |
      It returns one plog.
      Logs for each trace in the given plog.Logs input. Each of the resulting plog.Logs contains exactly one log.
mx-psi commented 1 year ago

@psk001 that sounds good to me. My wording was too specific on the original post, they should have a description as well as the other fields that are needed to define feature gates. For example, here you can see other fields being used: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/65e6596c0283bb4de876ae24374d22439f45e788/processor/k8sattributesprocessor/internal/kube/client.go#L29-L35

github-actions[bot] commented 1 year ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-actions[bot] commented 9 months ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

narcis96 commented 1 month ago

I am continuing the work on this feature (As discussed with @mx-psi )