dash0hq / otelbin

Web-based tool to facilitate OpenTelemetry collector configuration editing and verification
https://www.otelbin.io
Apache License 2.0
299 stars 13 forks source link

More helpful error messages on validation issue #94

Open bripkens opened 1 year ago

bripkens commented 1 year ago

image

mmanciop commented 1 year ago

Also, we need to contextualise the schema validation warnings:

# Learn more about the OpenTelemetry Collector via
# https://opentelemetry.io/docs/collector/

receivers:
  otlp:
    protocols:
      grpc:
      http:

processors:
  batch:
    ciao: # This should read "The configuration property 'ciao' is not allowed for the 'batch' processor"
  ciao: # This should read "The processor type 'ciao' is unknown"

ciao: # This should read "The 'ciao' top-element configuration is invalid"

exporters:
  otlp:
    endpoint: otelcol:4317

extensions:
  health_check:
  pprof:
  zpages:

service:
  extensions: [health_check, pprof, zpages]
  ciao:
  pipelines:
    ciao: # This should read "The type 'ciao' is not a known type of pipeline"
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]
roshan-gh commented 1 year ago

@mmanciop @bripkens As I communicated with monaco-yaml dev about contextualize the schema validation warnings, for now it's impossible to change the warnings, they are only can accessible as read-only data.

The data is generating from vscode-json-languageservice / yaml-language-server. (just as example: https://github.com/microsoft/vscode-json-languageservice/blob/main/src/services/jsonValidation.ts#L101))

In addition, yaml-language-server still uses vscode-nls, but vscode-json-languageservice has moved on to the new @ vscode/l10n. Updates in yaml-language-server may be needed.

Finally, I assume we can only improve the parts like @bripkens mentioned in the description of the issue

mmanciop commented 1 year ago

@roshan-gh, are you saying that we cannot modify validation errors before they get to the editor?

roshan-gh commented 1 year ago

@mmanciop yes exactly

bripkens commented 1 year ago

Would it be possible to wrap the worker in some custom code and in there to update the texts @roshan-gh?

https://github.com/dash0hq/otelbin/blob/1d013b84b6c3b4f2b41be05a68944392a21499a8/src/contexts/EditorContext.tsx#L97-L100

roshan-gh commented 1 year ago

I will look into it and check it @bripkens