opentelemetry.io icon indicating copy to clipboard operation
opentelemetry.io copied to clipboard

Registry: validate language and component-type fields

Open chalin opened this issue 2 years ago • 0 comments

The registry allows folks to add languages and component types on the fly. I think that's fine, but we need a way to ensure that this addition doesn't slip by unnoticed by reviewers.

Adding a cross-check against a fixed list/text file might be all we need. For example we could track the output of the following:

$ cd opentelemetry.io 
$ find content/en/registry/*.* -exec grep -e 'registryType:' {} \; | sort | uniq
registryType: core
registryType: exporter
registryType: extension
registryType: instrumentation
registryType: processor
registryType: receiver
registryType: utilities
$ find content/en/registry/*.* -exec grep -e 'language:' {} \; | sort | uniq    
language: kotlin
language: collector
language: cpp
language: dotnet
language: elixir
language: erlang
language: go
language: java
language: js
language: lua
language: php
language: python
language: ruby
language: rust
language: swift

And advantage of doing this outside of the build cycle is that it doesn't slow down the build. A disadvantage is that it might not be easy to run this check for users under Windows.

An alternative is to create data files with the currently supported values, and check each registry entry as it's page is generated.

Related:

  • #900

chalin avatar May 17 '22 13:05 chalin